# I need to learn Java



## Nachohat (Sep 20, 2001)

I'm a pretty good C++ programmer and I would like to learn Java.  These two languages are very similar and I don't have to learn everything from scratch.  Are there any good sites with tutorials where I could learn Java reasonably fast?

I found this so far : http://java.sun.com/docs/books/tutorial/

But I would prefer something that really assumes that you allready know how to program.  I don't want to have to skim through all the basics to find something new for me.  

To all the programers out there, how did you learn Java?


----------



## mpconnick (Sep 21, 2001)

I've been programming in Java almost exclusively since late 1995, when the 1.0 JDK was still a beta if I remember correctly.  Before that, I programmed mainly in C and during a brief dark period in my life, Visual Basic.  Since I started in Java during the early days, there weren't nearly as many resources available as there now are.  Some suggestions:

- Get a copy of JBuilder, but make sure you have plenty of RAM.  It's a pure Java application and can be memory intensive. 
- Grab copies of the Java In A Nutshell series from O'Reilly.  These are great quick references to the APIs.  I'd start by getting Java In A Nutshell, Java Foundation Classes In A Nutshell, and Java Examples In A Nutshell.   The first one mentioned contains a very brief tutorial/comparison that is targeted at existing programmers who are learning Java.  These a good references to keep nearby no longer how long you've been programming in Java.  
- Consider grabbing the book Effective Java Programming Language Guide.  Its essentially a series of good practices to put into use, and is a nice book for both new and experienced Java programmers. 
- Visit sites like JavaWorld.com.
- Sign up for Sun's Java Developer Connection and their weekly Java e-mail.  Start at http://developer.java.sun.com.  You'll find loads of tips and articles here.
- Investigate some of the Java publications such as Java Pro, Java Report, and Java Developers Journal.  Java Pro seems to include more complete examples. 
- Explore the Java newsgroups.  If I remember correctly, they are in the hierarchy comp.lang.java.*
 - Check out the website www.gamelan.com.
- If you plan to develop Java applications that will be deployed on the Macintosh, check out the Java developer mailing list available from Apple.  Here you can find answers to platform specific issues.

These suggestions should, through exploration, get you on a good track and help you to find additional resources.  Hope you find them helpful. 

- Mike Connick


----------



## Nachohat (Sep 21, 2001)

Wow Mike!! Thank you very much for the very lengthy post! Learning all this will take me years.

I'm still a student though so I'm just doing this as a hobie.  And I have many hobies at that. I have gotten the Java in a Nutshell book at a second hand book store and it's pretty good. It will get me started that's for sure.

I love Java, but I don't quite see the advantage of using it over C++ in OS X.  Yes, it is very cross platform but damn the load times are slow.  In a few words, what are the main advantages of using Java over C++ in a single platform product?

I have so much to learn it's unbeleavable. School is just the tip of the iceberg.


----------



## mpconnick (Sep 22, 2001)

School is certainly just the tip of the iceberg, especially in an ever-changing industry.  You can never stop learning as a software developer.  Java was at most a twinkle in James Goslings' eye when I was in college 10 years ago (boy, time flies), look how quickly it's become one of the dominant development languages.  

Regarding advantages of Java over C++ for a single platform (like OS X), that's not the real question to think about (and don't let anyone try to convince you otherwise).  Don't ask what language is best for what OS.  Ask, of the languages available to me, which is best to achieve the task I am presented with.  Java and C++ each have their advantages for specific tasks.  Without knowing a specific task, it's nearly impossible to recommend a language or other tool.  

For me, Java is important for the cross-platform capabilities.  My company develops educational software, and our products must run on Macs and PCs.  Java allows our very small team to deliver high-quality products for both platforms very quickly.  That makes it the best language for our tasks.  Since I'm a Java enthusiast, I'm glad to be able to use it.  

Although I have noticed that Java seems somewhat sluggish in OS X right now, I expect the performance to increase substantially.  Apple has a lot on their plate right now, and I have confidence the performance of Java in OS X will improve.      

Take care,
Mike


----------



## HECTORdaBIZATCH (Sep 22, 2001)

Yah, I read that java performance will be improved in 10.1.

I'm a college student, and I'm just starting to learn Java too... my computer science class is great but it's moving really slow... some of this info (maybe some books n' stuff) will help me go at a faster pace. Thanks.

...Here's a question... what would some of you recommend for software to start doing Java on my Mac? (Right now I'm doing everything on PCs in a lab... )

...the only package that I know of is Codewarrior. Is it good? Are there any other good ones?

Thanks!


----------



## knighthawk (Sep 22, 2001)

Project Builder supports Java... at least in Cocoa.  Check the developer tools for more information about Java developing.  There is also a MRJAppBuilder application in the developer applications folder.


----------



## Nachohat (Sep 22, 2001)

I'm in computer engineering and I'm specialising in hardware but I'm realising now how much I love to code.  At least you can learn software on you own, don't even think about doing that for hardware though.

I use Codewarrior myself.  I find project builder is just too damn slow for the moment although I haven't gotten the chance to get the latest version, I will when 10.1 comes out.

Mike, do you own a software company?  I would sure like to start one after I get a bit of experience in the area.  Right now I'm on my coop work term and it's a great break from studying. It's a completely different world out there.


----------



## AdmiralAK (Sep 23, 2001)

I love java 
Learnt it 2 years ago   I am doing prorammin in ANSI C now  ... damn  computer science department lol

Java is really easy to learn and no idtioc stuff like C where you have to alot x amount of memory for stuff like arrays and do garbage removal manually. java rocks!


----------



## knighthawk (Sep 23, 2001)

What does everyone think about the new C# that Microsoft is trying to push instead of Java... and about the fact that a virtual machine will not be loaded on XP?  Will software developers require an install of a Sun Virtual Machine with every install like many programs require Quicktime or DirectX?


----------



## mpconnick (Sep 23, 2001)

Regarding Microsoft not including a Java VM with XP, it is not unexpected but still slightly disappointing.  Microsoft's business practices really upset me to the point where I dislike using their products anymore than I have to.  Since the early days of Java, they have done a number of things to attempt to hamper its adoption.  Many of us know those things, so I won't rehash them.    

However, I don't think Java developers should really consider Microsoft's failure to include a Java VM in XP as a big deal.  We knew they weren't Java advocates, and it's easy to bundle a Java VM with a Java application.    I use a product called InstallAnywhere (www.zerog.com) to do just that, and have done so even when Microsoft did include a Java VM.  This is seamless and does not require any step on the part of the user.  Products like Java Webstart (a Sun technology) should also help with such issues. 

Why have I always installed a Java VM with our product?  Because it allows me to control the Java VM that is running our program without replacing any Java VM the user might already have installed.  There are differences between Java VMs, and you should learn about them if you're going to develop commercial software in Java. 

For instance, although Sun's Java VM version 1.3 for Windows is quite fast and good at managing memory, we cannot ship it with our product.  Why?  Because of nasty bugs related to anti-aliasing of text.  As a result, we ship IBMs Java VM for Windows with our product, which is not as good about managing memory.  When Sun's Java VM version 1.4 comes out, we will test our product under that VM and re-evaluate our decision.        

It's also very important to test the virtual machines on all the platforms you plan to deploy on, even if there isn't a choice of Java VM vendors.  Does the Java code I wrote on a Windows machine run on a Mac?  Yes, under MacOS 8.1 and higher as well as OS X.  Are there platform differences you must accomodate?  Yes.  There are times where you must check what OS you're running on or what Java VM version is running, and have your code address that.  Write once, test everywhere.    

Regarding C#, I think its timing is such that it will have minimal impact on Java.  Java has had a 5+ year headstart on C# and is now quite well established.  Java also has the backing of most other major players in the software industry outside of Microsoft.  I don't see compelling benefits to C# over Java, except for those developers who like the comfort of a Microsoft-centric world.

The above said, Microsoft has done some great work on Macintosh products lately.  I've looked at the Office package for Mac OS X, and it seems quite impressive.  I will probably buy it and use it rather than Appleworks (which I did purchase) because it is easier for me to interact with coworkers and their documents by using Office.  Internet Explorer 5.1 for Mac OS X 10.1 seems quite stable, although I generally use Opera, OmniWeb, or Netscape 6.1 in OS X (yes, I am using IE right now).      

- Mike


----------



## mpconnick (Sep 23, 2001)

> _Originally posted by AdmiralAK _
> *Java is really easy to learn and no idtioc stuff like C where you have to alot x amount of memory for stuff like arrays and do garbage removal manually. java rocks! *



Be very careful in what you assume about Java and garbage collection.  Although you don't deal with memory in the same way as you do in C (alloc, free, etc.), there are things you should do.  You should:

- make sure to call the dispose() method on objects that use system peers, such as windows
- make sure to call the flush() method on Image objects
- make sure to set objects you will no longer be using but do not quickly fall out of scope to null
- call System.gc() to ask the system to do a garbage collection when you know you're eating up memory (calling this method does not guarantee garbage collection will occur, it is only a suggestion to the virtual machine)
- some other things I'm too tired to think of right now

If you don't do these things, you may find your program running out of memory.  For instance, under Apple's Macintosh Runtime for Java (MRJ) for what are now called the classic versions of the OS (9.2.1 and below), it didn't release memory used for images readily.  From what I understand, that was because it used a different heap for images than it did for other Java objects.  If you wrote good code and the heap for other Java objects wasn't filling up, the garbage collector might not get called and the image heap would get eaten up.  To work around that, you had to do the things I mentioned above.

- Mike


----------



## mpconnick (Sep 23, 2001)

> _Originally posted by Nachohat _
> *Mike, do you own a software company?  I would sure like to start one after I get a bit of experience in the area.  Right now I'm on my coop work term and it's a great break from studying. It's a completely different world out there. *



My day job is for an educational software company.  We were purchased by another company during May of this year.  I manage the operations of our small satellite office (our main office is out of state) and continue to develop in Java on a daily basis.  Our office is a nice situation, because there are only "developers" there.  I use the term developers in the last sentence to mean anyone who contributes to the development of a product, and not just coders.  

Prior to May, we were an independent company of which I was one of the founders and the Director of R&D.  The company that bought us is the one I courted, so I am quite happy with the outcome.   

I also have a night time project I'm working on that I hope can be turned into a company once I complete the prototype.  It's a much tougher market to go out on your own and do something interesting these days than it was a couple years back.  I wouldn't even consider it without a good, working prototype to generate interest.       

- Mike


----------



## mpconnick (Sep 23, 2001)

> _Originally posted by HECTORdaBIZATCH _
> *...Here's a question... what would some of you recommend for software to start doing Java on my Mac? (Right now I'm doing everything on PCs in a lab... )
> 
> ...the only package that I know of is Codewarrior. Is it good? Are there any other good ones?
> *



Rather than name a project to develop, I'd suggest some goals you should achieve by doing your project.  These will help you in a number of ways in other projects.  
- develop a program that utilitizes many of the main Swing (JFC) components, such as windows, dialogs, menubars, text components (these range from simple to complex), buttons, etc.
- with those components, learn to program for the Java event model
- properly use layout managers, don't hardcode pixel positions

Quite a bit is involved in just those few things (tired, probably fogetting something critical), but knowing them will allow you to build a basic interface shell for any application you might want to develop.  And the rest of your code is all about APIs and algorithms, which isn't all that different from other languages like C and C++.  

Of course, if you're going to do server side stuff or things without an interface, you can ignore those suggestions.

As far as a development package, I use JBuilder 4.0 from Borland.  There is now a 5.0 version, but I didn't want to switch mid-project.  They have a free version available for download, but it can only be used for non-commercial projects.  Be aware that JBuilder likes memory, lots of it.  A relatively fast machine is helpful too.  I am looking foward to the release of the 5.0 version for Mac OS X so I can turn my Windows development machine off for the last time.  I don't know much about CodeWarrior, but have heard it's good.      

- Mike


----------



## Nachohat (Oct 2, 2001)

I can see you REALLY like Java with all those posts   Thanks for all the insight. Finally, I also picked up a copy of Cocoa by Oreilly to learn better how to code for Mac OS X.

You're doing exactly what I would like to do in 10 years time (after I get my PHD and more experience hehe  )   Starting my own company is my dream.   It's hard at first, you need to have some sort of incom to survive, that is why I think you are making a good choice to keep working while working a bit on your own.  Of course it takes more time and it is hard work, but at least you won't be eating bread crums for the first few years.

I think a good market right now is games.  Not 3d games, god that takes a huge amount of resources, but 2d games on handheld systems.  Game Boy Advance seems perfect.  Imagine that you make a game, sell 50 000 copies of it for a cost of 40$ each.  Lets assume that you make 10$ a copy, that's a cool 500 000$ and it shouldn't take you more than a year to make the game. The hard part is to find a publisher though, maybe I can work for one, that'll break the ice


----------



## dougk_ff7 (Oct 2, 2001)

Good: learn it.  You shouldn't find it too hard... My advice: buy a book.


----------



## Nachohat (Oct 2, 2001)

Even better, I bought 2


----------



## bewshy (Oct 3, 2001)

I got a question.  I've been using NetBSD since I was 13 on my LCIII.  Currently I work for a major insurance company and I have noticed that a large majority of companies like you to know RPG for AS/400 and COBOL.  Im currently going to take classes to address these, but also JAVA is kinda something that my company wants also.  Maybe this is a dumb Q..but what is the difference between Java and Java2?  THe last time I programmed was when I was 16 and that was in C for UNIX and some cheesy BASIC on the Mac under 7.1/7.5   


thanks ericb


----------



## mrjohns (Oct 3, 2001)

The best language for developing applications on any UNIX varient is C. UNIX is written in C. C is the best structured language there is. There is nothing special about Java as a language itself. It has its own complications that programmars need to be aware of or they will stuff their application. Java has one thing going for it that makes it special. That is a set of standard class librarys for doing stuff like graphics. But that all runs as non native code so its slooooow. someone port them to C/C++ then you'll see their worth.

Computer Science teachers have a lot to answer for believing the hype of java and not correctly instucting students in a low level language like C. Knowing C gives a individual a understanding of computer memory data structures. I employ programmars and as a programmar I am disgusted at the lack of fundamental knowledge of what a computer is and what you can do with it. I blame Java's over hyped. How can you program in java well without knowing a structured language like C well.

Sorry bout the rant. Just finished interviewing 20 people for a programming position. All crap. Do they just give out degree's?!?!?!?


----------



## Nachohat (Oct 3, 2001)

hire me!


----------



## Nachohat (Oct 3, 2001)

mrJohns: Why do you praise C so much?  I don't know much about C, all I know is that the equivalent of new and delete in C++ is malloc and free.  C++ is C with object oriented capabilities. Isn't C++ much better than C?


----------



## AdmiralAK (Oct 4, 2001)

Knowing C gives programmers a knowledge of where stuff is in memory ???
HAHAHAHAHAHAHA   Learn Assymbly language.  THAT is the "best" lower level language...or better yet why not binary ???  (on an asside note I am learning assebly now)

On the flush() comments, those points are well taken.  I prefer java to anything else.  It is simple, no C hassles like alloc  and free and things not working.  C just doesnt do it for me.  

On C#, too little too latem BUT with its inclusion in M$'s .net strategy it "might"  take off (too many people are M$ zombies these days lol).... In my opinion its goot to know C# just to know it, other than tha foh-get-bout-it.


one last thing ...

I LOVE JAVAAAAAA!!!!!!!!! (can I get a mocha double latte with half skim and half full foam, with vanilla, coconut and extra chocolate caramel please ? )


Admiral


----------



## mrjohns (Oct 4, 2001)

Why do I love C so much? basically because it is as low level as you can go WITHOUT programming in assembly (though you can embed assembly in C). 

This means that the compiler doesn't restrict you in what you can do. This is a plus and a minus. If you know what you are doing C can let you do very very powerful things. But because of this freedom with C then a inexperienced or unknowledgable programmar (your typical java programmar) can get himself into a awful mess. C forces you to understand your computer because it lets you play around with things like memory. You can learn how to impliment data structures like tree's linked list's stacks queue's etc etc not just use a something in a class that you have no idea what it does.

I actually use the C++ compiler to compile my C code as C is basically a subset of the C++ language. My reasons are that it forces you to write neater C.

The OO model of programming is a flawed model. It is very hard to write GOOD re-usable OO code. Structured programming tends to be faster to write neater and more maintainable especially if more that one person is working on a project. 

There is a reason why 90% of the open source comunity writes in C. It is the standard and it is still the best language for robust maintainable code.

if you don't believe me count the most used UNIX apps and see how many of them ARENT written in C.

"And god made C and saw that it was good"


----------



## AdmiralAK (Oct 4, 2001)

OOP is not as reusable ??? ROTFLMAO 
Obviously you havent done extensive coding in java 
Just face it.. C is *your* domain and not necesarily the domain of others/


----------



## mrjohns (Oct 4, 2001)

As i said in my previous post. Count the most widely used UNIX apps. See how many of them are written in any other language than C. Then get back to me.

OO that people write themselves is hardly ever if ever reused. Mainly because the people that wrote the code are unskilled in the are of writing generic class's.

I don't expect non programmars like you to understand this concept. You can roll around on the ground laughing what ever you have off as much as you like. But I have 10 years commercial UNIX programming (C/C++/Java/Pascal/Fortran/etc) experience backing me up as well and the vast vast majority of UNIX developers. Who have you got. You have a hobby and Scott McNealy.

Saying that Java is a fine language for a hobby. If you want a real UNIX job and you don't know C don't come knocking on my door.


----------



## AdmiralAK (Oct 4, 2001)

I would thank you not to make assumptions about me! 
You don't know me and don't know what I am and what I do.

I am not a commercial programmer for I am "only" 20 years of age but in a few years I will join the ranks of "commercial programmers".

You are right in saying that most, of not all, programs in a UNIX enviroment are writen in some C variant.

you are wrong in assuming that most java programmers are "non-programmers", and you are also confusing widespreadedness with efficiency.   Just because most programs for unix are written in C doesnt mean that some other language cant do things better.

I respectfully tell you to Get over yourself and C.



Admiral


----------



## mrjohns (Oct 4, 2001)

My assumptions were based on reading your posts throughout macosx.com. And they turned out to be correct. I didn't mean any offence by making the assumptions though and i apologies if any offense was taken 

Your right indeed, some languages can do stuff better and more efficiently than others take A.I languages for example. Doing list processing and predicate calculus are perfectly suited for languages like Lisp and prolog (respectivly). C is inappropriate choice for these tasks.

Java has no advantage over C in any task where as the C has many advantages over Java.

I would be happy to take any example of where you think Java has advantages over C.

Don't say automatic garbage collection and no pointers cause thats a load of rubbish.


----------



## Nachohat (Oct 4, 2001)

I agree with Admiral on this one.  Assembly is definatly the best way to learn the inards of a computer. Besides, you are practically writing the code in machine language.  

Admiral: What are you studying? Do you know assembly language? It seems to me that anyone who knows assembly also knows that you can just as easily convert it to hexadecimal, which can just as easily be changed to binary.  Provided you have LOTS of time though 

MrJohns: I disagree with you on the OOD.  Damn OO is so sweet! Come on, don't tell me you don't use it, what about making a GUI? Java is practically all OO for the little I know.

I'll admit that when you have a profound knowledge of a language, it might be easier to code all in a stuctured programing method. But it seems to me that OO is far easier to understand for anyone (including new employees you might hire).  It's also much more manageable for me. I guess if you like it old fashioned style, fine but it will get harder and harder for you to hire some good C programers because everyone is now learning C++.

As for C#, it's a lame attempt by M$ to limit our choice of OS.   If all apps where written in Java, no one would need to buy a Win pc anymore. That make Billy boy scared


----------



## mrjohns (Oct 4, 2001)

Assembly is the best way to understand what you computer is doing. I agree. I don't disagree. But nobody programs in Assembly these days because it is too slow to write anything useful. But by all means learn it. It will teach you at least one thing.... that you don't want to write anything in assembly 

OO sucks arse. Thats not to say that i do not on the occasion have to use it. i.e with any Java i write it has to be OO (no choice Java is only OO). But I work on large projects with many programmars OO in that enviroment would be a nightmare. Mainly because it would take twice as long for new programmars to become productive and it would take twice as log to write applications.

as C++ is only a superset of C then I would quite happily employ C++ programmars.

Its people that have no C or C++ that i cannot even contemplate giving a job to in UNIX development. as i said before UNIX is written in C 90% of all open source projects are in C. If you don't know C get a job on windows platform.


----------



## Nachohat (Oct 4, 2001)

I missunderstood what you said a bit. I though you were saying that C is what needs to be learned and not C++.  I totally agree with you though, a programer who doesn't learn C/C++ is a like a painter who only learns pencil. I'm pretty clueless in C, maybe not because I know C++, but appart from OO I don't really know the difference. 

I don't know of many Universities that only teach Java.  In engineering at least, you learn C++ first and then you either take a course on Java packages (the syntax can be learnt in a weekend if you know C++) or you learn it on your own.  Maybe they only teach Java in computer science?  What diplomas do the people you interview usually have?


----------



## Nachohat (Oct 4, 2001)

Example of when Java is better than C++:  

- When making a multiplatform product
- Time to market is faster because there is less platform specific tweaking
- Java is free (not a very good argument but it's still free for the tools and all)
- Languages are better supported with letters stored in 16bit instead of 8bits like in C++. This is better for everything that is not based on our alphabet.  This can also be done in C but not out of the box.
-Java is very safe and the security level is easily configurable
- Java is very network oriented

When C++ is better:

- Games and CPU intensive apps. C++ is just faster than Java.


Except for performance, I don't really see why Java isn't better than C++.


----------



## jarinteractive (Oct 4, 2001)

Assembly language is still used.  Many embedded controls are still being programmed in Assembly.  Colleges are teaching more than Java, as well.  I am currently in a C++ class (which I already know). Later I will need to take Java, Assembly language, FORTRAN or LISP (Don't remember which), and Perl (I think).  I also skipped out of a VB class (It was intro to programming).

-James Rantanen
I already know:
BASIC and REALbasic
C++ (enough to make sophisticated command-line apps)
PHP--the coolest language!!
javascript, HTML, etc. (non programming languages)


----------



## mrjohns (Oct 4, 2001)

- When making a multiplatform product 

Let me be clear... there is NO thing in the Java language. 

Java has a set of standard class libraries for doing this.Just like C has a standard library on ALL platforms write a program using those libraries on any platform and it will work on any platform that has C. just a recompile away.

Now GUI development is different. There is no standard GUI library for C. Microsoft has a cross platform (mac and PC) GUI library and so does metroworks.

On UNIX there is a standard GUI library called X which allows cross platform GUI development accross all UNIX that can compile the X librarys (this includes solaris linux BSD AIX and Mac os X). These C GUI librarys compile to native code and they run much much faster than java.

- Time to market is faster because there is less platform specific tweaking 

wrong. Java is really bad at working cross platform and has been since day 1. Sun wrote Java yet their Java development enviroment written in Java only works on Solaris and Windows. 

- Java is free (not a very good argument but it's still free for the tools and all) 

C C++ Java Fortran Pascal are all free. see gcc

- Languages are better supported with letters stored in 16bit instead of 8bits like in C++. This is better for everything that is not based on our alphabet. This can also be done in C but not out of the box. 

This is done via class libraries. it is nothing to do with the language and their is equivilent Libriaries in C.

-Java is very safe and the security level is easily configurable 

As a applet yes. As a application No. But Again this is nothing to do with the language.

- Java is very network oriented 

So is C.


jarinteractive: You are right that embeded systems use assembly. There will always be a need for assembly in lots of areas of computers. But it is not main stream and the vast majority of code is written in a higher language.


----------



## mpconnick (Oct 4, 2001)

In response to MrJohns, using the same/similar outline points he did:

- Multi-platform

Are you honestly trying to say that C has equivalent capabilities to Java in terms of multi-platform development?  Are you nuts?  

It is fairly easy to create a C program that will run on multiple platforms, if you stick to a very limited subset of what can be done in C and have machines available to compile for each target platform.  Beyond that, you're in trouble.  Yes there are cross-platform GUI frameworks for C and C++, but none approaches the cross-platform capability of Java.  

Our product is written entirely in Java and uses Swing (JFC) for the GUI stuff.  It runs on Mac OS 8.1 through Mac OS X, Windows 95-XP, Solaris, Linux and IRIX without a code change or recompile.  And those are just the operating systems we've tested it on.  

- Time to market

Ok, now you're really convincing me you don't have any practical, hands on experience with Java.  Many studies of proven that time improves time to market because most of the stupid memory issues you normally have to deal with in C/C++ are eliminated (though there are still things you should do as a good programmer to help the garbage collector and VM).  Additionally, Java's class library is very rich so you don't have to spend digging for the right 3rd-party library to do what you need.

Early on, Java did have many cross-platform issues when it came to developing sophisticated applications.  However, most of those have been eliminated and the good Java programmer knows how to address the other issues that remain (differences in things like fonts across platforms).

When you say Java development environment, I'm not sure if you're referring to the JDK or their Forte IDE.  If you're referring to Forte, it runs on my Mac under OS X just fine.  Ran in Linux too.  If you're referring to the JDK, they also provide a Linux JDK.  

Although Sun doesn't provide an Apple JDK directly, Sun does have employees on staff at Apple assisting with Apple's implementation of Java.  That was a decison made early on, let the experts (people at Apple) develop the JDK for the Macintosh and assist them.  Unfortunately, Microsoft doesn't know how to play well with others and Sun had to keep developing the compliant Windows JDK. 

- Java is very safe

Although applets are safer, Java applications are still much safer than their native C counterparts.  Many of the things that computer viruses take advantage of in C are not possible in Java because of the inability to access memory directly.  

- 16 bit letters

Yes, Java's 2-byte unicode storage of letters is technically provided by class libraries.  Libraries that are guaranteed as part of every compliant Java implementation.  In C you have to add a third party library on. You might learn one C class library for unicode, then take a job somewhere we you need to learn a separate class library because they use something else.  Java doesn't have that problem.

- Java is network oriented

There is not a single thing about the core of C that is network oriented.  Everything must be provided through clas libraries.  Java provides built in networking features.  Through a class library?  Yes.  But a class library that is guaranteed to be part of any conforming Java implementation.


----------



## mpconnick (Oct 4, 2001)

> _Originally posted by mrjohns _
> *
> OO sucks arse. Thats not to say that i do not on the occasion have to use it. i.e with any Java i write it has to be OO (no choice Java is only OO). But I work on large projects with many programmars OO in that enviroment would be a nightmare. Mainly because it would take twice as long for new programmars to become productive and it would take twice as log to write applications.
> *



You're suggesting object oriented programming is bad in an environment with many programmers on large projects?  That's absolutely crazy.  What could possibly lead you to believe that?  

Object oriented programming, Java or otherwise, is perfect for that environment when used properly used.  Why should I need to know anything about Johnny's code?  All I need to know are the classes Johnny provides and the public APIs I can access.  Everything is nicely encapsulated, Johnny does his thing and I do mine.


----------



## mpconnick (Oct 4, 2001)

> _Originally posted by mrjohns _
> *As i said in my previous post. Count the most widely used UNIX apps. See how many of them are written in any other language than C. Then get back to me.
> 
> OO that people write themselves is hardly ever if ever reused. Mainly because the people that wrote the code are unskilled in the are of writing generic class's.
> ...



After everyone gets done counting the most widely used UNIX apps and what they're are written in, why don't we count market share of the top 10 UNIX apps in comparison to the top 10 Windows apps?  Then, just for fun, let's start counting the number of paying jobs open for UNIX programmers as compared to similar job openings for people who can program for Windows, or Macintosh computers.  Heck, let's compare job openings for Java programmers to UNIX specific programmers.  

I personally hate Windows, but needed to make a point of how small the UNIX market is compared to the PC market or even Java market.

I also have 10 years of commercial programming experience.  The first 5 mainly in C, the last almost exclusively in Java (I must admit that I had to use Visual Basic part-time during a dark period in my life during the mid-1990s).  

If Java is just a fine language for a hobby, then I've got a great paying hobby.  And so do a lot of other Java programmers.  Whether you want to admit it or not, it's a serious language with real capabilities that isn't going away anytime soon.


----------



## mrjohns (Oct 5, 2001)

Basically largish development teams write code as individuals. They don't generally know what classes johnny has to do what and in the end it just seems easier to write your own. Or you hear about someones class that does something and you want to change it to do something else, You spend the rest of the day searching through header files trace what these damn objects do... in the end you give up and write your own class. In the end there is 15 million different classes all of which the people who didn't write them has no idea what the do and how they work. unmaintainable. Very few people have the skill to write clean good OO. When people use function overloading, virtual class's template class's, multiple inheritance etc etc all very handy things to the person that understands the code and has a map in his mind of how it all fits together. But this is bad for a team of programmers who all have to work in the code.

The same can be said about structured programming code too but to a lesser extent. see obfiscated C contest.

Its alot easier to write crap OO than crap structured code.


----------



## mpconnick (Oct 5, 2001)

> _Originally posted by bewshy _
> *Maybe this is a dumb Q..but what is the difference between Java and Java2?  THe last time I programmed was when I was 16 and that was in C for UNIX and some cheesy BASIC on the Mac under 7.1/7.5
> 
> 
> thanks ericb *



Not a dumb question at all.  As Java has evolved so quickly over the past 6 or so years (since the cat got out of the bag, not counting when Gosling was pontificating), it can be hard to keep up.  

Java 2 means JDK versions 1.2 and above, including the current 1.3 JDK and the beta 1.4 JDK.  From outward appearances, Java 2 was primarily about adding a lot more APIs to the Java library.  Some of these APIS, such as Swing (JFC) and Collections, could be added to JDK 1.1 versions by downloading them.  

Aside from the new APIs, Java 2 also included the HotSpot compiler.  HotSpot is used to take Java code and convert it into native code on the fly.  It uses sophisticated algorithms to control what is and isn't compiled into native code.  Hotspot has really started to mature, and anyone who compares JDK 1.1 to JDK 1.3 and 1.4 beta will see a significant performance difference.

Java 2 also marked the point where Java really became a mature platform with the inclusion of new APIs, increased performance, and new Enterprise level features.

If you're new to Java and don't have to program for Mac OS 9.2.1 or below, focus on Java 2.  If you need to support Mac OS 9.2.1, get a detailed understanding of API changes and such.


----------



## mrjohns (Oct 5, 2001)

call me a bigot if you like but I don't consider PC (mac or windows) serious programming. Sure you can do fantastic things on these platforms but its just not where you write serious code.

I work for enterprises. I write serious sized applications on very serious hardware.

If you read what I said:


> If you want a real UNIX job and you don't know C don't come knocking on my door.



If you DONT want a real UNIX job then do what you like.

If you own mac osx and you don't wanna get into the UNIX side of it then you don't understand why OSX is very very cool. And you might as well stick to OS9 cause its a better GUI operating system at the moment (yes even after X.1) or switch to windows.

To get into the UNIX side of macosx you should get to know C. Java is not a factor.

And as for Java being unstoppable.... hrmm we will see. The hype is wearing off.... C# is here to compete... we will see.


----------



## mpconnick (Oct 5, 2001)

> _Originally posted by mrjohns _
> *Basically largish development teams write code as individuals. They don't generally know what classes johnny has to do what and in the end it just seems easier to write your own. Or you hear about someones class that does something and you want to change it to do something else, You spend the rest of the day searching through header files trace what these damn objects do... in the end you give up and write your own class. In the end there is 15 million different classes all of which the people who didn't write them has no idea what the do and how they work. unmaintainable. Very few people have the skill to write clean good OO. When people use function overloading, virtual class's template class's, multiple inheritance etc etc all very handy things to the person that understands the code and has a map in his mind of how it all fits together. But this is bad for a team of programmers who all have to work in the code.
> 
> The same can be said about structured programming code too but to a lesser extent. see obfiscated C contest.
> ...



Well, a lot of the arguments you bring up are valid, but are related to a generally uncohesive team, lack of design ahead of time (I'm not design crazy, but defining public APIs upfront helps OOP work a lot better), or not using the tools available.  That is, many of those things you mention go wrong, but shouldn't.  

For instance, Java provides Javadoc which, when used properly, eliminates searching through code to find out what objects do.  That kills searching through header files.  The contract for the API is all there, hopefully the programmer used some sensible naming scheme for their objects and methods.  ;-)   

Large teams will write code as individuals (unless they are into extreme programming, which I'm not sold on), but that doesn't mean they shouldn't define APIs as a group before hand.  Example, we agree Johhny is writing the checking account code and we need a deduction method/function/procedure.  I don't care what's inside that method, I just need to know the contract for the method/function/procedure.  What do I need to supply to his code and what can I expect back?

I agree that OOP seems to be difficult for many.  I find it quite natrual myself, but can still handle procedural C code.  Only thing I hate programming is SQL code for relational database stuff.


----------



## mpconnick (Oct 5, 2001)

> _Originally posted by mrjohns _
> *call me a bigot if you like but I don't consider PC (mac or windows) serious programming. Sure you can do fantastic things on these platforms but its just not where you write serious code.
> 
> I work for enterprises. I write serious sized applications on very serious hardware.
> ...



Serious code can be written on any platform.  It's not about the platform at all.  At one time, some very serious and tight code was written on Apple II computers.  Apple II programmers, and I used to be one when young, knew how to push the limits of the hardware like most new programmers cannot understand today.  They didn't have the luxury of "add more memory".  

Believe me, I understand the technology under the hood of Mac OS X and why it's cool.  That doesn't mean I intend to program it as if it was a Solaris or IRIX box.  I code stuff that people see for the most part (interactive stuff), and when I'm doing backend stuff I can still use Java for servlets and JSP (an area where Java really signs is server side stuff).

As a side note, I disagree that the OS 9 GUI is better than OS X 10.1.  Although I have always been a Mac guy at heart, I would have never spent $3,000 on a Mac if it wasn't for the beautiful new Aqua interface.  That's what caused me to leave Linux behind.  

I don't think I claimed Java was unstoppable.  I did say it wasn't going away any time soon.  Yes, the hype is wearing off, but the programmers aren't going away.  Look into the continued growth rate of Java conferences, even in this down year for the industry.  Hype should go away with maturity.    

C#, I perdict it's dead out of the gate unless there really are that many people in the world who can't see beyond Microsoft.


----------



## mrjohns (Oct 5, 2001)

> I disagree that the OS 9 GUI is better than OS X 10.1



It is definately not as polished as OS 9. for example mounted volumes from Samba shares or NFS shares aren't updated in X.1 they are in 9. You have to dismount the Volume and remount it before change you have made to that drive are seen i.e new files.

I love X.1 but the GUI needs maturing. The major problem with linux is that there isn't a standard GUI and the available GUI's aren't as polished as Mac OS (X or 9) or windows or even CDE.




> when I'm doing backend stuff I can still use Java for servlets and JSP (an area where Java really signs is server side stuff).




See this is where I have to say Java is inapproprate. Servers are supposed to be the best they can be. Efficient little beasties that can churn out their stuff as fast as possible. Java is not the obvious choice. Interactive stuff you could argue the case. Server's nahhhhhh.


----------



## mpconnick (Oct 5, 2001)

> _Originally posted by mrjohns _
> *
> 
> It is definately not as polished as OS 9. for example mounted volumes from Samba shares or NFS shares aren't updated in X.1 they are in 9. You have to dismount the Volume and remount it before change you have made to that drive are seen i.e new files.
> ...



You're right, OS X 10.1 needs to mature and has a bunch of quirks, but I'd never go back to Mac OS 9.  I can live with the quirks.  It never crashes on me!

Server side, I think it depends on th usage.  Additionally, if you've got a servlet or JSP that remains resident, it will be compiled into native code.  Java servlets also have an advantage over traditional CGI scripts because it doesn't need to spawn new processes all over the place.

Java is obviously not the best for everything, but it does fit well in many places.  Some of those places, the decision to go with one language over another is an arbitrary one.


----------



## Nachohat (Oct 8, 2001)

Wow, there's been quite a bit of action in this thread since last week!   I'm still learning Java and I must admit that it's a nice change from C++.  I've been programing in C++ only for a few years now and I just started learning Java last month.  The major difference I notice is the ease of use of Java.  In Java there are so many build it functions and classes to use and all I have to do is open my book to look for the appropriate one.  

I just might not have the right documentation in C++, I only have an introductory book that doesn't talk too much about the standard library ( Deitel & Deitel C++ learning to program).  But when I code C++, it is far more complicated to find the appropriate functions or classes than it is in Java.


----------

