[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [computer-go] C/C++ programmer ready to try new language



Chris Fant,

Assuming you are interested in producing well designed Object Oriented software, I second (or third or whatever ;^) the opinion you take look at Java. I also highly recommend you use Eclipse (FOSS - Free Open Source Software) as your IDE: http://www.eclipse.org

For me, my personal time is the largest constraint in my coding projects. I have a full time job, two kids and have to do all my development work on my own very scarce personal time during evenings and weekends. So I sought maximum leverage first on my time and then on my existing skills. I was already an OO coder in C++, Eiffel and Delphi for years. Java/Eclipse has definitely maximized my "coding time investments" and minimized my "chasing arcane and subtle bugs time losses".

Eclipse is fantastic in the number of ways it assists me in smashing problems before they can even begin to be bugs. Additionally, the refactoring tools (ex: renaming or relocating a class to another Java package [name space]) are awesome. I cannot tell you how many hours I have saved just learning to leverage my time using Eclipse effectively. BTW, it compiles my code AS I AM WRITING IT. And then shows me issues by putting small indicators underneath problem elements (kind of like how MS Word puts a red squiggly line under words spelled incorrectly). And all of the assistance is done as a lower level background process/thread so it does not impede my work. And it completely and comfortably integrate JUnit so automated regression testing is as simple as a single click (invaluable after a long redesign and/or refactoring session). It is so pleasurable to work in Java on Eclipse. And it gets better all the time. The plug-ins available for Eclipse now number in the hundreds for just about anything you can imagine.

From a performance perspective, I have been able to squeeze pretty
substantial results from Java (+80% on hand optimized C). And the time I save hunting subtle memory and pointer issues from my C++/C days is enormous. That is not to say there are not challenges with memory and references in Java. Memory leaks are possible. However, the set of possible issues is so much smaller and my designs account for the issues anyway. In Java I am finding they are design level issues as opposed to language syntax/semantic issues like I experienced in C++/C.

And what little performance advantage I was able to detect from C++/C, I am neutralizing by purchasing higher powered equipment as it comes out. And I am leveraging how trivial it is to do multiple hardware/OS distributed processing with the MOBILE CODE characteristics built into Java. I don't have to recompile to target specific hardware/OS environments. I just toss work across RMI to machines and any code the particular node needs it fetches VIA THE STREAM THE DATA ARRIVED UPON. The amount of time this one attribute of Java has saved me in terms of having to screw about with file formats, streaming changes, subtle issues related to shared instances, is enormous itself (measured in dozens to hundreds of hours with my more complex architectures). In fact, I almost don't have to think in terms of persistence and/or compilation, at least compared to what was required in C++/C and Delphi. And what I do have to end up thinking about is insignificant.

Once I have my own player advanced enough, I may flip back into C++ and quickly implement what I have created in Java (again pretty easy once the difficult design work has been completed) and see what kinds of speed benefits are gained. This will require I reinvest in becoming a C++ coder with intense focus on efficiency. That may be a pretty substantial investment in my personal time as well.

The liklihood of my trying the move back to C++ keeps descending, though. In the last two years, I have read numerous accounts of projects being moved from C++ to Java with the result being a performance improvement, not loss. And this is across quite a few domains including traditional board game programming. Creating very efficient C++ code is itself a very challenging, apparently. And it is also very compiler/hardware target sensitive.

Additionally, IBM and Sun have both been trying to outdo each other in generating the "best performing" JVM (the thing that "interprets and JIT [Just In Time] compiles executing Java code). So the runtime optimizations (not currently possible with C++/C code) these two JVMs have achieved is nothing short of astonishing. Just in terms of garbage collections, both JVMs now outperform traditional memory management used in C++/C code. The techniques are very clever and very fast. Here is some information about how the JVMs are continuing to get substantially more effective using runtime (as opposed to compile time) optimizations:
http://java.sun.com/products/hotspot/docs/whitepaper/Java_Hotspot_v1.4.1/Java_HSpot_WP_v1.4.1_1002_1.html
http://java.sun.com/docs/hotspot/index.html
http://java.sun.com/j2se/1.4.2/1.4.2_whitepaper.html
http://java.sun.com/docs/hotspot/gc/index.html

And to keep up with the latest in tuning performance in Java:
http://www.javaperformancetuning.com/index.shtml

And if you are just starting out in Java and/or OO, a *free* book titled "Thinking in Java" iby Bruce Eckel (famous for "Thinking in C++") is available:
http://www.mindview.net/Books/TIJ/ <-look for link at top right titled "Download here" to go straight to the book - he has other great books on there as well

I will stop for now. There are actually a number of other benefits I am receiving from continued investment in Java/Eclipse (ex: my resume keeps looking more and more attractive in the job environment). If you have any particular questions about Java, please don't hesitate to email me *directly*. Ohers on this mailing list get bored with the "which language is best" discussion that breaks out every 4-6 months.

I hope this helps you in your choice.


Jim


----- Original Message ----- From: "Stuart A Yeates" <s.yeates@xxxxxxxxxxxxxxxxx>
To: "computer-go" <computer-go@xxxxxxxxxxxxxxxxx>
Sent: Sunday, September 19, 2004 8:45 AM
Subject: Re: [computer-go] C/C++ programmer ready to try new language


Chris Fant wrote:
 So what do the readers recommend I look into first?
I would recommend Java. I use Java as a better C++ and find that it serves me well. GCJ will compile to a binary executable and run most of the normal C/C++ optimisations on it. Internationalisation, portability, debugging, serialisation and compression code are things I've found really useful.

As other people have mentioned, you almost certainly want to move to something with an IDE for your platform, because it helps greatly to overcome the initial hurdles of learning the language. Having local experts to discuss the language with may also be helpful.

cheers
stuart
_______________________________________________
computer-go mailing list
computer-go@xxxxxxxxxxxxxxxxx
http://www.computer-go.org/mailman/listinfo/computer-go/
_______________________________________________
computer-go mailing list
computer-go@xxxxxxxxxxxxxxxxx
http://www.computer-go.org/mailman/listinfo/computer-go/