I have to admit I'm really starting to like OOP and you can't do that with BASIC. Also, back when I was using it, I didn't understand the concepts of arrays and functions/methods, so the stuff I could actually do was pretty limited. Maybe I'll go pull out some old BASIC programs and fool around with them, though.
I used Java a long time ago. Even though I haven't tried C yet, judging by what I've read so far I would prefer it. I've used Director, Flash and Logo and by God something's gotta be better than that! Director's terminology just piffes me off so much.
Me: Load 400 Images.
Director: Error In Local Global Constant Variable Boolean Integer Of Event Handler Of Behaviour
Script. To Many Cast Member Clones.
Me: WTF Are You Talking About?
Director: Memory Error Variable Is Not A Handler.
Me: What? There's Nothing Wrong With Any Variables Or Handlers.
Director: Druplicate 3D Mesh Cannot Be Deformed As It Already Exists.
Me: I Can't Deform Something That Doesn't Exist.
Director: We Suggest You Use A Primitive Cast Member In The Local Stack Of The Array List Of The External Library That Doesn't Exist.
Me: Cut Code, Paste It In Word, Cut From Word, Paste Back Into Director.
Director: No Error. We Suggest You Submit An Error Report.
Absolute_Zero
Veteran
Joined: 8 Dec 2004
Age: 44
Gender: Male
Posts: 643
Location: New Brunswick, Canada
Java == crap.
It is too slow.
It's trendy because it is portable.
It is so slow that it is nearly worthless.
I'm biased having learned programming from Z80 assembler, 68000 and C/C++.
Even on a Sun Ultra 30 Java is so slow it's a joke.
C++ is good, hard, but all you need is to use Tcl/tk to handle the GUI and you have all the functionality you need for a relatively portable application (barring system specific functionality).
Bjarne Stoustroup's books on C++ tell you all you need to know, then grab some examples and tutorials off the net and you are off with C++. Then search for Tcl/tk tutorials and integration with C and you are in. That cuts out the really ahrd part in C/C++ of creating GUI's and event handling.
Nuttdan
WP Co-Founder
Joined: 13 Jun 2004
Age: 35
Gender: Male
Posts: 323
Location: White River Junction, VT
It's kind of neat as a language, and can teach you some good OOP practice/thinking. As a platform, it kinda blows, and as a solution, it really depends on the problem and the resources available.
For me, languages don't really matter that much, they're all very similar. It matters more what you're aiming for, how well you're able to create a good product from <i>any</i> language, but some languages/development tools make you jump through more hoops to do certain things than others.
I've been learning Oracle application development lately, transitioning from PHP+MySQL to Oracle+PL/SQL (as well as learning Spatial and HTMLDB). There are a lot of things that I like about it, like how tightly it's integrated with the database, but there are some hurdles to get through. PHP has a very nice/easy solution for saving state info called sessions, but there is no easy one for PL/SQL, you have to roll your own.
One thing that I never liked about Java is that it had to run on top of that virtual machine. I realize that the virtual machine was necessary for the java program to run on any system regardless of the system, but having compiled code run on a virtual machine isn't true compiled code. Java, because of this, is just like Visual Basic before version 6, back when a Visual Basic program was actually pseudo-compiled and run on an interpreter. I'm sure many of us can remember having to download the latest version of VBRUN.DLL to run the latest VB shareware games.
If you want to see something scary, I started out programming in FORTRAN.
**********
DO 100, I = 1, 10, 1
WRITE (*,"I2") I
IF (I .GE. 9)
WRITE (*, "C11") "ALMOST DONE"
ENDIF
100 CONTINUE
WRITE (*, "C8") "FINISHED"
Sorry if that is incorrect. It's been years since I've touched that.
_________________
My life is a dark room. One big dark room.
-Lydia Dietz, "Beetle Juice"
I always put my opening brace on a new line. I frequently do not put my one-line if statements in braces, but I will always put a one-line if statement on the same line. e.g.
I've never run into a situation where I had to put multiple lines in a if condition for a one-line if statement, but if I did I probably would set it up with brackets.
_________________
My life is a dark room. One big dark room.
-Lydia Dietz, "Beetle Juice"
Nuttdan
WP Co-Founder
Joined: 13 Jun 2004
Age: 35
Gender: Male
Posts: 323
Location: White River Junction, VT
Michael.
I'm very compulsive about my coding style. I always use braces, even for single line statements, and I always indent, and I prefer the braces on a new line. I also am compulsive about the way I write conditional statements, so I don't get the parenthesis in nested boolean logic confused. And with functions that take a lot of parameters, or really long SQL queries, I tend to break them up on multiple lines.
To me an if-statement which has only one conditional statement would confuse me if it had brackets as I see it as a single command spread over multiple lines. Just like functions that take a lot of parameters, which it sounds like I format the same as you. I do not like lines wrapping so I do spread a lot of statements horizontally to avoid that.
For SQL I always put everything on separate lines, so "SELECT" would be one a line, followed by each column on its own line and tabbed, and so on. I usually have very long SQL statements!
Michael.
We got taught java in CS and had to use it for assignments. Quite often we have to write sorts or something like that.
I've heard that people say it's slow and has all these problems. So I thought as an extension excersise i'd write the same thing again in C and write one of those performance test scripts we always have to do. I failed to find much of a difference between the java and C program. Ok it was only mergesort on 100,000 numbers java took something like 0.001 of a second longer than the C program.
It could be that the lab machines are all brand new 3.2Ghz P4s with 1Gb of ram each, but i suspect it might be beause they are running linux and using the sun java runtime. I suspect that the java interpreter that comes with windows is rubbish.
A properly implimented abstract stack machine runtime using just in time compiliation should execute no slower than native code, but it will definately *load* more slowly, since what's really gone on is the run time is compiling the byte code to machine code into ram. Anything but minimal slowdown compared to native code is evidence of bad implimentation rather than anything actually wrong with this way of doing things. Then again by my standards every program ever written is poor implimentation
As for my own programming I use java as a RAD tool mainly, and for making little GUI apps and things like that.
I use C and C++ for most stuff. When i've had a go at making games i've done C, C++ and Assembly mixes. Since java can't be mixed easiler with assembly and the runtime doesn't provide any way to access SIMD instructions, nor does it appear to be able to use them for vector calculations (this is the real reason games written in java would be hopelessly slow).