Flutterby™! : Java ranting...

Next unread comment / Catchup all unread comments User Account Info | Logout | XML/Pilot/etc versions | Long version (with comments) | Weblog archives | Site Map | | Browse Topics

Java ranting...

2006-08-02 21:57:48.208182+00 by ebradway 3 comments

While meuon is having fun in Flash-land, I'm getting deeper and deeper into Java. Everytime I learn a new language, I find myself trashing about a little harder. Going from C to Perl was quite a fright as I had to change the way I looked at information (C handles things byte by byte amazingly well whereas Perl likes to look at things as collections or strings). In Java, I'm finding that I have to do everything as an object even when I just want to sneak in a smidgen of procedural code. I mean, what if I want to do a similar operation on two integer values stored as private members of two different class? I have to create a separate method for each class! And data structures have my head spinning... In C you start with simple types and you build your STRUCTs and go from there. Want an array? Just declare it! In Java, to get an array of objects, you have to declare the array[], use new to instance the array AND use new to instance each element in the array... But wait, that's not all! There is java.util.Arrays that implements things like ArrayList, a generic, automatically resizable array that you can throw any object into.

Don't get me wrong... I feel that once I get a little further up the learning curve, I'll become a Java convert. I like it when crazy things are taken care of for me... For instance, once I got my array converted to an ArrayList, I was able to sort it by simply implementing a comparator for the class I'm storing in the ArrayList and calling Arrays.sort on it!

I guess the real problem is that I'm a grey-haired C coder who's copy of K&R says "Based on the Proposed ANSI C Standard" across the top (note the Proposed). I'm not used to so much hand-holding by the language. But I will say, Java beats the heck out of VisualAbysmal BASIC!

[ related topics: Perl Open Source Software Engineering Java ]

comments in ascending chronological order (reverse):

#Comment Re: made: 2006-08-03 01:58:15.524921+00 by: meuon

At least (hopefully) you are doing things that NEED the power of a language like Java.. instead of writing what is essentially a very simple content management system in it.

I found out today, that my collection of Flash based game interfaces (the final 3 look pretty snazzy, but I can't share them yet.. but will be able to soon) that essentially took me a solid week to learn Flash/ActionScript from scratch and tie them into the main system, was something "PhD. Jimmy" had been working on for over 2 years. Argh...

#Comment Re: made: 2006-08-03 03:07:31.433402+00 by: Dan Lyke

I've just spent some time mucking about on the Amtrak web site and it's making me loathe Java[Wiki] for web apps, although I realize it's unfair to condemn a language based on the applications it spawns.

But, yeah, encapsulation hurts, hopefully it's a hurt that's good for you. Does Java[Wiki] have a ref operator? It's been a while, but I remember doing silly things like encapsulating integers in objects so that I could pass references, and I'm sure that wasn't the right way to do that.

I think it'd probably be a bit easier on ya if you'd gone through the horrors of C++ on the way to Java[Wiki], but take heart, at some point you'll embrace interfaces versus implementation, and enjoy private members...

#Comment Re: made: 2006-08-03 06:57:58.65789+00 by: ebradway

I enjoy my member in private, thank you!

What I'm doing is implementing some data structures based on theory and testing how well they'll work. Java, in my opinion, is the best language because it's accepted in academia (my target audience) and it keeps me from dealing with too much stuff unrelated to my research (like user interfaces). Further, once I have the classes worked out, I should be able to integrate them into uDig (the free GIS based on Eclipse) and ArcIMS (which is a big huge pile of stinking Java servlet). Rather, I'll find some undergrad or Master's student to do the ArcIMS implementation...

What I'm really learning is to just let go of my C paradigm and allow myself to fall into Java. It really does cool stuff if you do what it wants you to do (and not do things like try to pass references). Actually, this ArrayList object takes care of most of my referencing issues.