Jump to content
This News Article
  • Doom WAD files found on Java


    CodeImp

    For anyone interested in making Doom editing tools (or other WAD file-related applications) in the Java programming language, insertwackynamehere has written jwadlib, a Java library that manages WAD files at the lump level. The library classes and methods are well commented and very straightforward. A nice chance for developers to start working on cross-platform editing tools, or just to look through it for educational purposes. More information is on his website or in his thread on our forums.


    User Feedback

    Recommended Comments



    There's a C++ Wad Library if you're looking for one. I'm just writing one for Java because I know Java better and want to apply things I learned at school in an environment I'm familiar with. Maybe Java doesn't have pointers and operator overloading and other things, but it's cross platform without refactors and recompiles, object orientated and very clean. It also doesn't have a painful to deal with #ifndef include header file mess. Plus, it's 2007 not 1998, so all the anti-Java stuff is kind of passe...it really isn't slow and bloated like everyone says it is.

    Link to comment
      Zeroth said:

    Java: castrated C++ for people who don't know any better.

    Expand  

    If that's what Java is... then .NET (at least C#) is a completely butchered ambiguous piece of meat with buffalo diarrhea on top.

    Link to comment

    Plus, it's 2007 not 1998, so all the anti-Java stuff is kind of passe...it really isn't slow and bloated like everyone says it is.

    Expand  

    Java was cool circa 1998. Slow - not really. Bloated - yes. Java uses dumb, verbose abstractions that result in extremely bloated code. To pull a number, 90% of any Java code is boilerplate.

    Link to comment
      Fredrik said:

    Java was cool circa 1998. Slow - not really. Bloated - yes. Java uses dumb, verbose abstractions that result in extremely bloated code. To pull a number, 90% of any Java code is boilerplate.

    Expand  


    Lol you use Python so of course other languages will have mostly boilerplate to you, it's not really a fair argument. But compared to something like C++, really whats the difference? The structure is very similar and as I said before, C++ has the whole header inclusion thing which has caused more than one headache for me on occasion when trying to get good code to compile just because of dependencies and linking errors. Also, Java and C++ both make it a hassle to print anything graphical to the screen I've noticed, at least with standard graphics libraries. But the point is, don't dis Java for that when it isn't alone and the competition is generally looked at as better and yet has some of the same shortcomings.

    Link to comment

    Lol you use Python so of course other languages will have mostly boilerplate to you, it's not really a fair argument.

    Expand  

    Comparing to something that happens to be better seems perfectly fair to me.

      Quote

    But compared to something like C++, really whats the difference?

    Expand  

    There are only two languages that rival Java's suckiness and you managed to nail one of them, so of course there won't be a big difference. But unlike C++ and Perl, Java is at least readable.

    Link to comment
      MikeRS said:

    If that's what Java is... then .NET (at least C#) is a completely butchered ambiguous piece of meat with buffalo diarrhea on top.

    Expand  

    At least C# 3.0 has built-in lambda expressions. Unfortunately, both of these, as well as C/C++, lack useful macros and good object orientedness a la Common Lisp. Hmm...maybe I'll make a wad library in CL for kicks...

      Quote

    insertwackynamehere said:
    C++ has the whole header inclusion thing

    Expand  

    Technically, that's the C preprocessor, and unless I'm mistaken, you can use that (and therefore #include and all those other statements) in Java or just about anything else, even text other than source code.

    Back on topic, this is still a cool library, so thanks for it. Out of curiosity, did you use JNI for this library, or is it all from scratch?

    Link to comment

    @Fredrik: okay fair enough :P And I dunno much about Perl but yeah C++ can be unreadable sometimes. At least you admit Java is more readable, because that is one of the reasons I prefer it and we can agree on that.

    @Haruko: Yeah, you're right it is the preprocessor but from what I remember it was necessary to include anyway. I could include preprocessor stuff in my Java project (and I do with things like @Override) but I dont need to include tons of manual preprocessor linking, at least not with a decent IDE. Also thanks :) And the library is from scratch. I am developing it using Java 5.0 only.

    EDIT: Also, I should say that while I have released a packaged Alpha, there are newer files in the SVN repos which I frequently commit my work to. In fact, already there is a lot of changed/fixed/new stuff (well not a whole lot but if you encountered any bugs they may have been fixed). Also, please feel free to use the trackers on the sf.net page to submit bugs/support requests/feature requests etc.

    Link to comment

    And I dunno much about Perl...@Haruko: Yeah, you're right it is the preprocessor but from what I remember it was necessary to include anyway. I could include preprocessor stuff in my Java project (and I do with things like @Override) but I dont need to include tons of manual preprocessor linking, at least not with a decent IDE. Also thanks :) And the library is from scratch. I am developing it using Java 5.0 only.

    Expand  

    I'm fairly certain there are ways around the preprocessor (aside from a healthy dose of copypasta), but they're probably hairy. I've seen a few things here and there about replacing CPP with an object-oriented one, but I don't think anything came of it. But anyways, it's not really "required"...just very useful.

    Aren't @ directives in Java for Javadoc, though? I try to touch Java only when necessary, so I'm not too sure.

    As for Perl...my favorite quote for the pathologically eclectic rubbish lister is:

      Quote

    Python is executable pseudocode. Perl is executable line noise.

    Expand  

    And that's just about true. It and APL are the only languages I know where slamming your head on a keyboard could potentially produce valid code.

    Link to comment

    Lol at the Perl reference and also, yes, @ is used in Javadoc documentation and applies to a special variable or reference when encased in a Javadoc comment (/**...*/) but it is also used for Annotations which I assume have something to do with the preprocessor (I'm not to sure of the technical aspects but judging by what I've read it does). Look here and here. Maybe it's not preprocessor specifically, but it's compiler info that doesn't affect the Java code itself.

    Link to comment
      MikeRS said:

    If that's what Java is... then .NET (at least C#) is a completely butchered ambiguous piece of meat with buffalo diarrhea on top.

    Expand  


    you're catching on!

    .NET should be avoided like the plague.

    Link to comment

    These guys know what they are talking about.

    I can tell you that my company has made the same experience. Most of the 'programmers' fresh off the university are utterly incapable of comprehending real life programming - and Java is the main reason for it. You have to teach them from scratch - or just not hire them and wait for better ones.

    As a matter of fact, the only people who seem to be capable of doing decent Java programming are the ones who fully understand the concepts behind the language (which in 99% of all cases are experienced C programmers.) All others just create horrendous bloat and don't have a shred of understanding why the code they created is bad.

    Link to comment

    I know what you mean, but I like to think I'm somewhat better than that. I do my best to write good code and on top of that I have been doing computer science stuff since 8th grade. I love programming and I think that taking my first class this semester was very beneficial because it only opened doors for me and taught me how to do things I wondered about. Of course, I know what the article describes and I see it all the time; people who could be described as code-monkeys but don't really understand what they're doing and can't translate it over. I like to think that I understand what I know enough that I could learn another language's syntax and have a fairly easy time programming in it.

    I'm not trying to sound like a dick, btw, I just think I'm better than that and in fact I have been applying it throughout all of high school. I went from teaching myself HTML to learning a bit of C++ to PHP to learning some Java from a class I took in HS and expanding it from there. In class at NYU, (my first compsci class, besides an "Intro to CompSci" class I took at UPenn summer of 10th grade) we learned the Huffman algorithm for compression and simulated it because we didn't learn anything about binary files. I did all the homeworks and got 100s, but instead of just accepting 101101 (or whatever) as a series of integers which isn't really compressed because its 6 bytes (or 32 bytes if written to the file as ints), when in reality it represents 6 bits of a byte, I decided to fork the homework and ended up writing a somewhat buggy compression program and huffman "zip" file format of my own design. For the most part, it could write and read huffman compressed text to a file, although I got bored before working out all the bugs.

    In fact, that was what made me want to program even more, because now that I understood working with bytes and bits (and bits are very hard to work with in Java), it opened up a lot of options for me. That is why I decided to make jwadlib, I had an urge to code and jwadlib would let me understand more about Doom's internal workings and work with binary file structures.

    Anyway, I took the class referenced by the article, I believe. The first course in systems is what I am taking next semester; you learn Assembly and C, it is called Computer Systems Organization. I just finished Data Structures. I placed out of the computer intro and compsci classes. But yeah, I understand Java's shortcomings and I think that Java probably does contribute to code monkey syndrome but I just want to clarify that I really want to avoid that and try to actually learn. I really enjoy coding and trying to figure things out and I enjoy what I'm doing and really look forward to a future in it. But yeah, I find it interesting that the professors at NYU are thinking of changing it. And I also don't want to come off sounding like I'm better than others or anything, but I take pride in my work and just want to acknowledge that I understand the shortcomings of many Java programmers and Java itself but I do my best to avoid the pitfalls of not actually understanding what it is I'm doing and praying it works.

    Link to comment

    Java itself isn't really the problem. Any school that only teaches you one language is going to seriously hamper your development. The solution to a complicated problem will look very different in Java vs C vs Lisp. All of these languages were designed with different problems in mind and are (let's be nice here) good at solving them.

    Learning these different paradigms helps a developer grow even if they spend most of their time writing in one language. Joel has an article somewhere saying that he doesn't trust anyone using strings in PHP or whatever that hasn't experienced the nuts'n'bolts of low-level C string manipulation.

    Link to comment
      Zeroth said:

    .NET should be avoided like the plague.

    Expand  


    Because?

    Also I don't think teaching C is going to help anybody. My course is all about programming micro-controllers in C, it's the third year and the students barely know how to do anything and have no idea how anything actually works. Sadly the tests are so easy most of them will graduate and not be able to make a "Hello World" program without somebody holding their hand.

    Link to comment

    Heh, if I would have glanced at the most recent update on Joel's page I would have noticed a link to the very article I was talking about : The Perils of JavaSchools

    It's a bit of a read but it sums up the issues much better that I could.

    Link to comment
      david_a said:

    All of these languages were designed with different problems in mind and are (let's be nice here) good at solving them.

    Expand  


    Correct. However, far too many people see Java's high level as the absolute way to do things and teach it to the next generation.

    Making Java the main programming language on extremely memory limited devices like cell phones doesn't help either. Especially there the bloated memory management starts to show its problems.

      Quote


    Learning these different paradigms helps a developer grow even if they spend most of their time writing in one language.

    Expand  


    Yes, but that's not what happens. It's no joke: 9 out of 10 people that come to my company straight from the university are simply incapable of decent programming. All they know is a style that has no regard for performance or limited system resources. As long as they are doing non-performance critical PC apps they'll get away with it but beware if they have to do something that is performance critical or has to work with limited resources - and they'll get nothing done and have to be taught from scratch how to do it properly. Some will get it and others don't. But somewhere these people will eventually find a job. That's what scares me.

      Quote


    Joel has an article somewhere saying that he doesn't trust anyone using strings in PHP or whatever that hasn't experienced the nuts'n'bolts of low-level C string manipulation.

    Expand  


    Most definitely. I fully concur with his sentiment.

    Link to comment

    Did you read the article I linked in my second post, Graf? You would probably enjoy that one as well. This schooling problem is not limited to Europe.

      Quote

    It's no joke: 9 out of 10 people that come to my company straight from the university are simply incapable of decent programming.

    Expand  

    Forgive me for asking, but... why does your company hire them? Surely you can give them a simple memory/cpu constrained problem during the interview? Or did you mean "... people that come to my company to interview?"

    Link to comment

    You think Java schools are bad? BASIC is used in the system we have over in Scotland at least up until the second last year. And even then the programs are barely past "Hello World" status. It's pathetic. Well and truly pathetic.

    Link to comment

    You think Java schools are bad? BASIC is used in the system we have over in Scotland at least up until the second last year. And even then the programs are barely past "Hello World" status. It's pathetic. Well and truly pathetic.

    Expand  


    the only BASIC that I consider worthy is CASIOBASIC. if someone could make a similar language for modern computers I'd be all over that.

    Link to comment

    You think Java schools are bad? BASIC is used in the system we have over in Scotland at least up until the second last year. And even then the programs are barely past "Hello World" status. It's pathetic. Well and truly pathetic.

    Expand  


    You seriously get taught BASIC at the college level? GW-BASIC or QBASIC? :)

    10 PRINT "Hello world"
    20 END
    

    Link to comment

    This is gonna motivate me to rework my (really, really awful) Doom data structure library for Java. What the hell was I thinking using Vectors to hold map data objects? SYNCHRONIZED structures being used in implementations that are most likely single-threaded? Ugh.


    Anyway, to contribute to the programming discussion, I concur with the sentiment that most programmers fresh out of college can't code for crap in Java. I've seen Java code written by people that have absolutely no idea how to write Java code that is, performance-wise, computationally viable. While Java implementations are getting better with memory management and virtual machine performance, no Java program will ever perform as well as it should if it is written haphazardly.

    Some words to budding Java programmers: Avoid using the "+" operator with String objects. Please. java.lang.StringBuilder is your friend.

    Some more words: Sun's JRE is at the point where it is about 1x slower than native code, and kicks the crap out of C in terms of memory de/allocation and stack call performance. It ain't yo momma's programming language anymore. ;)

    Link to comment



    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.

    Guest
    Add a comment...

    ×   Pasted as rich text.   Restore formatting

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...