Java is pretty cool

Errr…null is not an object :point:

In C and C++, you can get a segmentation fault by attempting to create an array with a negative size or by attempting to go over the bounds of an existing array.

I assume he meant that null is treated like an object when using instanceof even though you’re right.

Java is quickly evolving into a legacy technology like Cobol.

At my workplace we’re turning away from Java to simpler more productive-focused solution-oriented technologies 8)

There’s a bigger chance you’ll be writing your “enterprise” code in javascript than in java within 5 years. With the advent of technologies like NodeJS, json, HTML5, REST, and even database systems like MongoDb then the use of Javascript is obvious.

I dread opening up my Java project at work, it’s so heavy, it’s so difficult, it’s so nightmarish, legacy, difficult to debug, difficult everything. I scream in my head. The project is a multi module maven project, which I cannot even open in Eclipse, I’m forced to use IntelliJ, which is dead slow and I can’t use in a productive manner. It reminds me of a huge enterprise legacy project that I used to work on in IBM’s WebSphere, where all the code was intermingled in some JSP and servlet classes. Honestly, I can’t be arsed with a museum codebase like that.

And remember, Java vs. Javascript vs. C vs. C++… it’s not about the technology and how good it is from a computer engineering perspective. These languages only exist to deliver results, to make a good product efficiently.

Although Java may seem like a good language, it’s not very efficient to make stuff in it. I can do much more in Javascript in shorter time.

And let’s not forget, client PC’s are getting very powerful, the browsers themselves are pretty good powerful virtual machines with good rendering capabilities. Obviously the language of choice in those VM’s is javascript. And for the sake of simplicity, programmers would write both their backend and frontend in javascript.

And already, javascript is the most used programming language in the world.

Well, I can see that occurring since everything is moving straight to web now. With the advent of smartphones and tablets, laptops and desktops are becoming more obsolete. The technology that is the best for working on these devices, JavaScript.

If only Java didn’t have to hulk around the JVM on its back, it probably would have been accepted into a lot more companies. The Java Applet was actually years ahead of its time, but just didn’t get the right support. Reminds me a lot of why the Sega Dreamcast failed dooming that company.

I hope that the various efforts done here to try and keep Java relevant would spark interest. I definitely would not like to see Java become legacy. The idea behind Java is a little too good for that.

Er, what??? instanceof doesn’t treat nulls like objects - null is never an instanceof anything.

OK, I’m going to get all WikiPedia on your ass now and scream CITATION? ;D

I agree with a lot of what you envisage mind you. Still can’t stand JavaScript though! :slight_smile:

String a = new String();
a = null;
System.out.println(a);

mfw it prints “null”

I don’t think this proves anything it is just an implementation thing,

if the argument is null, then a string equal to "null"

After using C# for a few weeks, I definitely would like to see more C# features get introduced into Java, or have proper cross-platform game libraries available for C#.

wait another few weeks^^

FTFY

http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html
c is currently the most used beating js by 18%. and java beats js by 16%

TIOBE is a very subjective ranking.

[quote] JavaScript Leads The Pack As Most Popular Programming Language
the TIOBE Index is listing C as the most popular programming language in use at the moment. TIOBE bases their rankings off of the number of skilled engineers, courses and third party vendors that cater to a specific language.
[/quote]

Ask yourself and programmers around you, how many have written C code. Not many I guess. In my company I don’t think I can find anyone who writes C code.

According to TIOBE, perl is more popular than javascript. Excuse me while I laugh. Consider this, almost every single website out there uses javascript, and when you think of how many websites are actually out there… that’s a whole lot of code.

Redmonk has a better approach than TIOBE, they consider the popularity of languages on community and collaboration sites that coders use TODAY. Granted, this may not reflect on enterprise level programming, because programmers can’t freely put their code online, but what people are willing to spend their free time writing code in usually translates into enterprise level a little later.

So, TIOBE is more reflective on the past, while Redmonk is more reflective on current trends and the future.

Writing C code is not a skillset that is in a huge demand, and prospective employers are few. Everywhere I look companies want someone with experience and is productive in the most commonly used languages, and that usually means Java and C# coding, and languages like Ruby, Javascript and even Python, and more importantly the ability to pick up whatever interpreted/scripting language.

If you want to write anything for the web, Javascript is your language of choice. The old model of rendering web pages server side is quickly dying out, javascript enables clients to render pages themselves.

So if you want to be “future proof”, C is obviously not the way to go, but mastering Javascript is.

Sorry, but that’s a bunch of BS IMHO. :slight_smile: JavaScript is only needed for webcrap. It is not a skill needed to be employed building non-webcrap software. While you can write non-webcrap software with it, your life will be hell (though you may not realize it and may even be content in hell), especially in a corporate setting working with a team. JavaScript is not the future.

I’m completely uninterested in writing software to run inside a browser and I’m sure others are too.

Well, I think most of us here can thank that “webcrap” for paying our bills every month. Truth is, most of us work with something that is related to the web.

Try telling Google that Javascript is not the future, they’re heavily invested in it. So, if you’re going to apply for a job at Google, they’ll laugh you out if you want to do everything in C.

I concur. Especially google with chromebook and their shitty google docs saying you can and will do everything in a browser some day.
Every browser app sucks. Nobody is going to write code, design 3D models, doing photoshop or edit video in a browser…

And Javascript is shit which accidentally got popular, and everybody knows it. So it’s bad from the user side AND the developer side.

Also I think the whole Diablo 3 fiasco showed that, “always online” is just not realistic and it might never be. And if you cant do you work because you are offline or their servers are down, that sounds like fun. Let alone the fact that they potentially monitor everything you do.

Given GWT, Go, Dart, etc. you could be forgiven for thinking that Google are doing their best not to have to code in JavaScript! :stuck_out_tongue:

I love Java because

  • Has near C/C++ performance! In some microbenchmarks I did Java 7 code took about 15% longer for heavy number crunching than straight C. In similar tests, early Java 8 builds run even faster. I wonder how competitive Java is with OpenGL for high end 3D stuff. I’ve heard some say that the JNI layer adds substantial overhead to the Java OpenGL bindings, but I don’t know that first hand.
  • Java is way more elegant than C/C++. I don’t mind memory management, but there are tons of other warts. The #include system is awful, managing third party library dependencies is a mess, the standard library is awful. It isn’t very standard, it doesn’t touch things like networking or threading and generally expects you to use native libs for that. I remember I had to write code to upper case a string, with full internationalization support, that compiled under several different C++ compilers: wow, that was hard and required many different platform specific #if blocks.
  • The community is awesome.

But actually, today, I must say, Java is really heavily dated. Scala is really a dramatically better language. Even without the heavy functional stuff, just as a basic OO language, Scala is far better than C++/Java/C#.

A few examples:

  • Properties. C++ and Java had this informal notion of “properties”, which is an internal variable with getter/setter methods. C# improved, by making this an official language construct and streamlining it and adding appropriate internal code generation. Much better. Scala has the way better design, in that there is no difference between a class variable and a property. A class implementation can change between a val and a get method or a var and a get+set method without impacting external code.
  • Static. Scala fixed the C++/Java/C# notion of class “static” data/methods with the singleton companion object.
  • Type inference. In C++/Java, I frequently see code like “SomeClass i = new SomeClass()”. Why do you have to duplicate the type information? Much better to write “var i = new SomeClass()” and have the compiler simply see the type. C# has this type inference too.
  • First-class support for top-level constant/immutable variables or values. Scala has val which is equivalent to Java final variables (C# doesn’t have this). This is really nice for read-only properties, and limiting mutable state.
  • for loops, if blocks, and any code blocks in braces can return values. Extremely nice and elegant. Removes the need for a separate ternary operator.
  • Scala removes special case “arrays” which are separate from the generics used by the rest of the language. Java and C# both started with just arrays and later bolted generics on, while Scala started with generics and designed them to handle array type usage with zero performance loss. Also, Java/C# arrays have a broken type variance, where you can cast a Circle[] to a Shape[], add a Rectangle, and get a runtime exception rather than a compiler exception.
  • Persistent immutable data structures in the native library. In other wrords you can do: “val modifiedList = sourceList.add(item)” and sourceList isn’t modified and guaranteed to never be modified until it is not used and garbage collected.
  • Native tuples
  • Pattern Matching
  • Option rather than null. Null causes tons of errors and requires tons of safety if-checks. Option provides safety, and simplifies the if checks. Null is baked into C++,Java,C#, but Scala is very consistent about Option.

Also, Scala generally runs slightly faster than Java in benchmarks. Obviously, they use the same VM, but I believe Scala does more aggressive inlining and other performance tricks. One caveat is for performance sensitive code you often need to use while loops instead of for loops, which to me is a glitch, but I am sure they will fix that.

The JavaScript VM engines are legitimately amazing and are doing their best to work around the problems that exist.

The compile to JavaScript options are getting better rather quickly.

I agree that JavaScript has some poor choices, but as a practical tool, it offers a lot.

Scala is one of these oddball languages

Like for example no semicolon at the end of a line. That’s wrong.
And I like to write two commands in one line from time to time…

If I would really learn to master another language again, besides web stuff, it would be C++ because the usage and toolchain for games is so big.

In Scala, you can totally use semicolons to put two commands on a single line like this:

println(“hello”); println(“there”);

But for the times when you don’t put multiple commands on a single line, you don’t need to write the semicolon. You can if you want to or if it makes you feel comfortable. But Scala doesn’t enforce needless ceremony.