Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
CodeImp

Doom WAD files found on Java

Recommended Posts

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.

Share this post


Link to post

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.

Share this post


Link to post
Zeroth said:

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

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

Share this post


Link to post
insertwackynamehere said:

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.

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.

Share this post


Link to post
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.


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.

Share this post


Link to post
insertwackynamehere said:

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

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

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

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.

Share this post


Link to post
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.

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...

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

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?

Share this post


Link to post

@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.

Share this post


Link to post
insertwackynamehere said:

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.

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:

Python is executable pseudocode. Perl is executable line noise.

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.

Share this post


Link to post

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.

Share this post


Link to post
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.


you're catching on!

.NET should be avoided like the plague.

Share this post


Link to post
Bloodshedder said:

I think you people have the wrong place for the "my programming language is better than yours" argument.


Programming??? Godammit, I was hoping this was a thread about coffee :(

Share this post


Link to post
Russell_P said:

Programming??? Godammit, I was hoping this was a thread about coffee :(


Yeah like I thought I could run Doom with my coffee

Share this post


Link to post

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.

Share this post


Link to post

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.

Share this post


Link to post

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.

Share this post


Link to post
Zeroth said:

.NET should be avoided like the plague.


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.

Share this post


Link to post

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.

Share this post


Link to post
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.


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.


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


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.


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.


Most definitely. I fully concur with his sentiment.

Share this post


Link to post

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.

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

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?"

Share this post


Link to post

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.

Share this post


Link to post
david_a said:

Or did you mean "... people that come to my company to interview?"


Precisely. The interview is where most fail.

Share this post


Link to post
TheDarkArchon said:

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.


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.

Share this post


Link to post
TheDarkArchon said:

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.


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

10 PRINT "Hello world"
20 END

Share this post


Link to post
×