How do people stand Java?

Started by
49 comments, last by Washu 12 years, 9 months ago

"Measuring software productivity by lines of code is like measuring progress on an airplane by how much it weighs." - Bill Gates

And all this time people have been telling me my airplane design was foolish.
Advertisement
I haven't used Java since the early 2000s but the one thing I hated about Java was that their libraries seemed to be over all the place and had no logic to them. I don't know how it is now, but when I compare that to C#2.0, C# was a dream come true. The other thing I hated about Java (which wasn't really Java's fault) was that every book handled ... I think it was.... mouselisteners differently. Some with inheritance, some with composition, and no real explanation whatsoever. I was new to the language and my programming skills sucked, so I didn't know what the hell was going on. But at the time, it would drive me nuts.

Beginner in Game Development?  Read here. And read here.

 

Oh, Java is just great. Of course, at the start it is somewhat too complicated, but for large program packages it is just very conveniant and structured.
Enough people have pointed out to use the right tool for the job, so I won't reiterate that very important point.

However, I feel that java is getting criticized unfairly when C++ tends to get away with murder. The backwards compatibility with C results in what I really feel is a messy design. Bad C++ code is one of the horribly unreadable things I've ever seen, and you can't attribute that to a lack of programming skill because we're really all prone to certain pitfalls now and again.

I am a java programmer by profession but I have more experience in C++... and yes, in some ways C++ is better. And sure, operator overloading would be nice in java, but multiple inheritance is a bit problematic and other constructs (structs? union types?) don't really seem to have much of a purpose. The lack of consensus on C++ standards is a testament to this. Java has some faults, it certainly does. But to say that C++ has great design itself is something I cannot take seriously. But the worst thing about C++? Of all programming languages, it seems to have the most fanboys and blind followers who do not really take the time to consider - realistically - how good C++ itself really is. [sup]
[/sup]

[quote name='Serapth' timestamp='1310127812' post='4832739']
You sir, are insane. Having just finished working in Eclipse on an Android project, I will say that Visual Studio is not even in the same league as Eclipse, its hundreds of times better. The only place Eclipse ever had the edge was refactoring tools and now that is moot as well. Regardless to the language, Visual Studios is hands down the best IDE on the market by a country mile.
Also I cannot think of a single way that Java is superior to C#, although the opposite is not true. This makes sense though, as C# came later it got to learn from Java's mistakes, and it did.

Eclipse's intellisense isn't as balls as VS imo. With visual assist I think VS is better, but then you are comparing like a $300+ product to a free product and it's still a lot closer than it should be.
[/quote]

Oh...Are you and 6510 talking about the VS C++ intellisense? If so, then I agree; VS's C++ intellisense sucks and VAX makes it tons better. This is one of the reasons I don't like C++: It shouldn't be this hard to write intellisense for languages anymore. C++ just goes out of its way to be complex in the syntax and semantics departments.

On the other hand, my experience with VS's default C# intellisense is godlike (I actually have to turn OFF VAX because I like the built-in one better).
My biggest problem with Java is its overly verbose nature, which stems from some annoying design decisions such as "everything's a class", no operator overloading, a lack of generics for so long, etc.

There was, and still is, a school of thought which believes that programmers don't know what's best for them, and should therefore be disallowed from using things they might misuse. On one hand, I find this rather appalling (for myself), but can see the rational (for many programmers I've come across). Its a perhaps unfortunate side-effect that the language is so inconvenient, unwieldy and overbearing at times, but its the path the chose when they decided that the latter group of programmers is their target demographic (or at least that building a fence around less-skilled programmers was more important than enabling the capable ones).

Of course, there's a lot to like about Java in theory if not in practice -- it introduced, or at least popularized, the idea of a language which runs on a very generic virtual machine that would lend easier cross-platform capabilites, and which would later host many individual but mutually-compatible languages -- an idea that Microsoft's CLR later seized upon and improved upon in terms of both languages and the VM itself.

Java was certainly well-intentioned, but like many good intentions, it may have fallen short of what the world really needed.

throw table_exception("(? ???)? ? ???");

Java is the largest software ecosystem.

People often scoff at if because of the low-level tutorials shown in school, but they don't realize just how absurdly big it is. Enterprise Java is HUGE. It's everywhere. It runs just about every business.

It's similar to asking: How do people in car industry stand 4 stroke engines. Simple reason, one needs to search very hard to find something different, so it's better to learn it.

That said, just like C++, Java comes in layers:
- Syntax (taught in school, trivial, idiot proof)
- Collections + Patterns (typical graduate knowledge, toxic to projects)
- Entry-level frameworks, such as Spring (no longer Java as such, even though it's used)
- Full-blown JEE, tools like WebSphere (business processes, management, mostly deals with models, UML or RationalRose processes)
Low-level projects at this level are 1MLOC, 100k files and several 100 libraries is common. Teams of (tens of) thousands are typically involved in implementation, which is off-shored as a rule these days for cost reasons. The process is inefficient, but management has found a way to reliably progress, mostly due to abundance of work force. These are the systems typically found in anything government-funded or government-regulated so projects begin at tens of millions and commonly go over a billion. While software is central to them, it's the least relevant part.

- The outliers (Swing applications, some media applications, custom tool stacks built on JVM, real-time or embedded use, Hadoop), few and far in between.


Either way, Java as language in pure form is used only at entry-level. Everywhere else it's a hodgepodge of third-party libraries managed by various rule or process toolkits. Programming is used at various points, but it's not relevant to the whole process. Just like in construction, bricks do get laid and concrete gets mixed, but neither are all that relevant as far as construction industry goes.
So, uh, Pyramids eh? They're great!

There was, and still is, a school of thought which believes that programmers don't know what's best for them, and should therefore be disallowed from using things they might misuse. On one hand, I find this rather appalling (for myself), but can see the rational (for many programmers I've come across). Its a perhaps unfortunate side-effect that the language is so inconvenient, unwieldy and overbearing at times, but its the path the chose when they decided that the latter group of programmers is their target demographic (or at least that building a fence around less-skilled programmers was more important than enabling the capable ones).

It again depends on the goals of your project. If you want to do rapid development with fewer program shattering bugs, java is still a very appealing platform. The protection isn't there because programmers don't know what's best for them; it's there so programmers don't have to worry about what's best for them. It's a small but important difference.

If you go into Java thinking, "How can I do what I've been doing in C++ in Java," you are doing it wrong. Operator overloading is a great example actually. Is it that that difficult to write add( instead of +? Does it make more sense to use + for objects that aren't data types? Not especially. Compared to building and debugging having to write add( will save you maybe 1% of your time? How much time would you save not having to worry about memory leaks?

How about a better operator "="? Is it a deep copy? Is it a shallow copy? Reference assignment? Is it really that hard to just write "equals(" or "compareTo("? Operator overloading is a drop in the bucket when it comes to language features.

It can be convenient, but it is a convenience not a necessity. In some cases it can be as much a hindrance as it is a convenience when it is abused.

Generics are more a necessity, but it's had generics support for 7 years now.

I do think that C# is vastly superior to Java, but mostly because the design behind C# was pretty much, "Make a better version of java." The arguments for C# > Java carry a lot more weight than C++ > Java because they have similar applications.
I think c++ is a great language with some really crap API's* and that is why people (myself included) find it hard moving from Java/C#/Python to c++. Allthough it doesn't bother you as you work more with c++ the following is quite frightengin when you begin with:


void function(string str) ;

#ifdef 42BITWINDOWS
template class<ASBQ>
SOME_CRAZY_LIBRARY::usingDifferentStyle<TEMPLAT _AD_W::fromStom, NiceFormatingHereThough> function ( std::string a = ios_bas_::not_bas::weirdInteface.a, std::shared_ptr<typeX> a = 0);
#endif

Of course, there are some lovely C-Based libraries like openGl many suffer from being very hard to read.


So my answer to the question is, Java has a lovely library.

*actually I though about this and decided that it wasn't fair. C++ is used when you need these crazy API's.

This topic is closed to new replies.

Advertisement