Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×
Programming

Journal Pinball Wizard's Journal: Thoughts on Java? 6

<background>I've been programming now for 8 years, 6 of them professionally. I started off learning C++. On the job, I started out doing web pages using ASP/VBScript and ocassionally writing backend components and programs in C++. Recently, my company changed its server platform and I've been doing a lot of Perl. Although I've never had the opportunity to use it professionally, I'm now completing my second class in Java.</background>

So here are my thoughts about the language. I would especially appreciate anyone who's had more experience with Java(FortKnox?) to add their thoughts here.

1) Java is just about the nicest, cleanest language I've had the opportunity to program in. The structure of this language, the syntax, and the conventions employed all combine to make Java a very nice, easy to write, and easy to read language. I feel it would be very enjoyable to use it in a professional setting.

2) Java is a very complete language - meaning that for 95% of anything I would want to do, there is a library available to help me do it. Of all the other languages I've looked at or used, only Perl has a similar capability. That's good, because I really hate reinventing the wheel every time I want to put a vehicle together.

3) Java has some shortcomings - such that I could see myself hitting a wall in serious(read: not classroom) development. For instance: what would you do if you need to create complex data structures like a hash table or binary tree? Or if you did manage to create those structures(perhaps by using references rather than pointers?) what do you do in a program where you wanted to inherit from both classes? Java allows for single inheritance, and mimics multiple inheritance by allowing interfaces(you can't modify or implement new methods in an interface, you only get what is there) Now I know you can use CORBA to interact with other languages. However, it appears to me that you can't make use of the other languages special features(like, say templates or multiple inheritance in C++) because the interface itself isn't designed to deal with them.

3a) Another shortcoming with Java compared with other languages is the investment a company and its programmers need to make to become productive with it. Think of all the things you need to do just to get a simple servlet working on the web - you need to create an application, create and compile your classes, write your web.xml file to let the server know where everything is, and finally package it all into a war file. With Perl, by contrast, all you need to do is write a Perl script and drop it in your cgi-bin directory. I heard complaints from other students who worked for huge organizations about the complexity in getting a Java environment working. If its difficult for them, it would be next to impossible to realistically deploy Java in small to medium sized companies.

4) OK, I'll admit. For most corporate development you are not going to be concerned at all about things I brought up in item 3. You will be creating user interfaces, simple classes that incorporate your business logic, and database access methods. For this type of development, Java excels, and the bigger your company is the better off you will be for using Java since it is logical, very well organized, and can scale itself to the biggest of companies. But, where is Java going? For the last couple of sessions at my Java class, everyone has been talking about how Sun's stock is basically in the toilet(hovering around $5), how they might get taken over by another player(Oracle, IBM), and the fact that while Java makes no money for them, it requires a huge amount of development resources. If a company did take over Sun, would they want Java the way it is? Or would they exercise their right to make Java a proprietary language and try to start making money off of it? Meanwhile, MS is promoting .NET, and although they have their problems, they appear to be a much stronger company than Sun. How closely tied is Java to Sun's success as a company? What will happen if Sun folds or gets bought out?

Experienced Java programmers, your comments are very welcome.

This discussion has been archived. No new comments can be posted.

Thoughts on Java?

Comments Filter:
  • 1) Java is just about the nicest, cleanest language I've had the opportunity to program in.

    Indeed. Its why I love the language. No need to worry where to use a pointer vs. a reference, cause Java is intelligent enough to do that for you. Garbage collection ensures no memory leaks. Exception handling is an absolute DREAM (no core dumps!).

    2) Java is a very complete language - meaning that for 95% of anything I would want to do, there is a library available to help me do it.

    Depends on what you are talking about. Java is a complete language, but opening up into the open source realm, you can find a lot of code for any major language.

    3) Java has some shortcomings - such that I could see myself hitting a wall in serious(read: not classroom) development. For instance: what would you do if you need to create complex data structures like a hash table or binary tree?

    I had this VERY SAME thought when I first started with Java. C++ has taught me the supreme power of the pointer, and figured I'd miss it. Then comes the joys of the "Container." I easily made a "map" datastructure out of a container. Not in the academic sense, but in the object sense on what I was using. I found it very powerful. Whats more, is that most containers are already made (at least in an interface).

    3a) Another shortcoming with Java compared with other languages is the investment a company and its programmers need to make to become productive with it

    This is its major flaw. Only use Java on a project that will be large and require time. Java is a WONDERFUL language for enterprise sized apps. Java is a TERRIBLE language for a personal webpage. Why would you take the time to create a servlet-ejb-jsp MVC pattern application when you can plop something together in perl in a lot less time?

    How closely tied is Java to Sun's success as a company? What will happen if Sun folds or gets bought out?

    BEA and IBM have a LOT invested in Java. I think either of them (or both) could easily keep Java strong. EJB2.0 recently came out, and (having used it the past few days) it makes life a LOT easier. Java1.4 adds perl-like regexp to the language, increasing its power.
    Java is big business for internal intranet websites. Look for Java jobs compaired to all others.
    Also, .NET will become a VB enterprise, and C# will die (lets face it, I can make a website twice as fast with VB than C#, and its just as powerful).
    Also, C# took all that is great in Java, and took out everything that was bad in C++, making it a very nice language, also. Java still has its place. When you learn servlets, then JSPs, then taglibs, you'll see why Java will always have a place in the internet world.
    HTML monkeys can EASILY modify Java programmed websites (especially with struts), without having to know a lick of code.

    Oh, and the whole "inheriting from multiple parents" is a flaw in OOP. It, eventually, leads to headaches.

    I suggest reading a book entitles, "Thinking in Java" by Bruce Eckel. Its available for free on his website [bruceeckel.com]. Sure, its basic at first, but taught me the joys of Java programming quickly, and its simple to read.
    • great answer!
    • 1) Java is just about the nicest, cleanest language I've had the opportunity to program in.

      Indeed. Its why I love the language. No need to worry where to use a pointer vs. a reference, cause Java is intelligent enough to do that for you. Garbage collection ensures no memory leaks. Exception handling is an absolute DREAM (no core dumps!).


      From C++ to Java, I would second the praise for references, garbage collection and the improved exception handling. But Java isn't all nice and pretty.

      Java really needs a template or generic programming construct like C++. The compiler should error out when I try to add classes to a LinkedList that don't live in the same inheritance hierarchy. I would rather have the compiler check something so simple instead of trusting my unit testing.

      I'm also uneasy about forcing exceptions to be caught when thrown. If the method doesn't handle them or declare them to be thrown, the run time should stop execution of the program at that method and report the exception as a top level exception. I've seen too many new programmers trap the exceptions just to get the code to compile and then never do anything with the exception. That's a fun one to debug.

      I'd also like to see a language that divides the methods into sections - precondition, method, post condition, exception. I don't know what anyone else thinks, but making well defined sections to make sure the method conditions are checked. It also documents the method in a more modular approach.
  • the built in package java.util is the collections framework, where things like hash tables, trees, arrays, etc are built in. If you have a structure not implemented, or would prefer your own, it shouldnt be that hard, especially if you've implemented them in C++ as templates, only move the template'd type to type Object.

    One feature I highly appreciate: Serialized classes. I like serialization because it eliminates the need for me to develop I/O formats for data files, but only if the file gets used by Java programs.

    Multiple inheritance is something I've been taught to avoid at all costs, even using C++. One book I have (C++ Software Design) uses the phrase "if the feature is available, it doesnt mean you have to use it." (ok, not the exact quote, but you get the idea) Personally, I'm glad Java doesnt allow MI to begin with.

    recommended: Java In a Nutshell, the API specs [sun.com], and the tutorials [sun.com]. Those have been just about all the documentation I've ever needed to do work in Java.

    hope that helps
  • I just started using Java at the beginning of this year in a corporate environment. I had been using VB for CGI, a little C++ (Although ironically my training was in C++ and I haven't had VB since high school.) and some JavaScript. (Which is not even close to Java.) I've been using JBuilder Personal (FAIB) (Free As In Beer) which I like, although for corporate work, I'd really rather have the Enterprise version. (I'm trying to convince the bean counters we need it.) It handles all the Interface coding (to a degree) for you. I agree with FortKnox... too many other companies have a stake in Java for it to die, even if (God forbid) Sun does. (As a stockholder, I'm hoping they make a comeback, since I lost my butt on that one.)

With your bare hands?!?

Working...