× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.




This is one of those long IMHO rants that kinda goes off topic...

>Java may be nice, but what about all of us non-C people?  We sure aren't   
going to
>embrace a technology that ignores our skill sets.

Um, Java isn't C, or even C++.  It's similar in some of the syntax   
(for(...) loops, the ability to do pre- and postfix increments and   
decrements, equality comparasons, line delimiting, etc.,) but it is   
light-years ahead of C in terms of ease-of-use, programmer protection,   
error trapping, and self-documentation.

I've been working in C for the last year on the AS/400 (my first   
experience of C), and although I can't say I like it much, it's useful   
for the sort of work that we do here (essentially,comms work across   
multiple platforms, with vast quantities of data manipulation).   
 Essentially, it's systems work.  We need access to the entire AS/400,   
and C gives that to us.  (Sometimes with a vengance.)  We need platform   
transparancy, and C gives a great deal of that to us.  (Probably 80-90%.)

But, outside of systems work, C on the AS/400 is not much use, in my   
view.  It's difficult to write real-world applications with C.  It's much   
easier to code a simple subfile inquiry program in RPG than it is in C   
because, again, the amount of hand-holding RPG gives me over C is   
superior.

If I write a subfile program in RPG, it's a breeze.  Why?  Well here's   
some of the things I don't have to worry about if I try to code a subfile   
inquiry program in RPG:

I don't need to include the recio.h file, cos I don't NEED it!  RPG has   
built-in database handling.  (This seems trivial, but I found I missed it   
big time.)

I don't have to worry about the silly way the C pre-compiler creates   
structures for externally-defined AS/400 records.  The pre-processor   
makes a structure name for a record format that includes the library   
name.  Why include the library name in the structure name?  C'mon guys!   
 I gotta manually search and replace all of the uses of the structure   
name if I move the file to a different library and re-compile.  That   
makes a library list useless.  If I create the structures manually by   
hand-coding them I can name the structures as I like, but that means I've   
lost all my database referencing.  Why couldn't they have just used the   
file name and record format name?

I don't have to worry about whether or not I'm creating files in the IFS   
or in the regular AS/400 database domain, so I can examine my work files   
directly, without having to use CA/400.

I don't need to worry about packed decimal, single quotes v. double   
quotes, single equals v. double equals, allocating memory, freeing   
memory, null terminating strings, arrays being zero-based, or null   
pointers.

RPG is an applications language.  C is a system programmer's language.   
 If you're not gonna write that many system programs, why bother with C?

Despite all that, I started learning Java, mostly cos I was curious, and   
also cos I thought it might be useful to broaden my skill set.  I find   
it's Java is MUCH better than C.  Java's type conversion is cleaner and   
more explicit (imagine REAL booleans), the code lends itself to   
self-documentation, it's much more difficult for the programmer to blow   
his or her own head off, the error trapping is great, the I/O streams are   
much superior to C's implementation, and...it's free!  I can pull down a   
version of the JDK from Sun's web page and run with it.

As far as the OOP thing goes, I like Java better, too.  Rather than   
having to play with C++'s implementation of OOP, which has to reconcile   
itself to the sins of C for purposes of backwards compatability, which   
Java doesn't have to support.

Since Java IS OOP, not kindasortawannabe OOP, it means that a programmer   
has to start learning OOP concepts or you can't write good code.  Or any   
code, in a lot of cases.  You can't get away from it.  As soon as I   
started learning Java, I started having to think in OOP terms, and that's   
a heckuvalot more painful than having to deal with the C-like syntax.

Because Java doesn't expose the programmer to the vaguries of a computer   
system, it's possible to actually concentrate on writing useful code,   
rather than wondering, "Did I put that memory back on the heap?", or   
 "Mmmm...well, if I use a far pointer instead...", so it's easier to   
actually write applications because you don't have to sweat the machine's   
reaction.  And with the concept of Java's packages, the OOP principles of   
inheratance and polymorphisim are a snap.  Also, because of packages,   
once you get a class that works, you can easily import it into another   
application.  You don't need to bracket your class implementation in a .h   
file with "#ifdef...#endif" as you do in C++.

My biggest problems with learning Java, as an AS/400 RPG programmeer have   
been:

OOP concepts.  These take time and effort.  But keep at 'em.  They're   
making sense to me.  Every so often I still scratch my head, but slowly   
but surely...

Java syntax.  You'll get your fingers burned on '=' and '=='.  (Single   
equals for assignment, double equals for checking equality.)

Setting up Java.  If you use the JDK, be warned!  You have to do some   
configuration after you install Java.  Mostly, setting up the CLASSPATH   
environment variable, and making sure the Java\Bin directory is in the   
path.

The integrated development environment.  If you use the JDK, you don't   
get an IDE similar to Microsoft's Visual J++ or JBuilder or Symantec   
Cafe.  To edit files and compile programs, you must use a text editor and   
DOS command-line arguments.  This can be extremely frustrating.  (The   
Microsoft book _Learn Java Now!_ provides a version of the Microsoft   
Developer's Studio that has Java 1.0.  I've used this for awhile, and I   
quite like it.)

Learning materials may not match the release of Java supplied.  The most   
current release of Java is 1.1.3 (I think).  Many books still only cover   
Java 1.0.  Some books with Java on CD ROM discuss Java 1.1 concepts, but   
only have a 1.0 compiler.

If you're at all curious, I recommend a book called _Core Java_ by Gary   
Cornell & Cay S. Horstmann.  The book goes to great lengths to explain   
OOP concepts practically (something that most programming books don't   
have), and has a bit of humor in it (something that most programming   
books also don't have), and then discusses Java as a useful language,   
with some good examples.

I say give it a go.  It's not expensive, it's kinda fun once you get   
going, and you can crack into the world of OOP without having to go into   
the C lion's den.

End of EXTREMELY long rant...

Thanks.  Look after yerselves...

 -Ed, Doc, well...I liked it...



+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to "MIDRANGE-L@midrange.com".
| To unsubscribe from this list send email to MAJORDOMO@midrange.com
|    and specify 'unsubscribe MIDRANGE-L' in the body of your message.
| Questions should be directed to the list owner/operator: david@midrange.com
+---


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.