anyways. I have some reasons for my strong dislike of Java: a) checked exceptions, b) no method pointers or something similar and c) lots of the code produced by the community out there (and in the standard library itself) is full of FactoryFactoryFactories and other typing intensive, mind-bending and ultimately useless abstractions (most of them not DRY at all either).
Back in 2004 I did strongly consider Java though, but ultimately, I didn't have time to implement this web application AND learn a new library (learning the language is easy. learning the library is what makes you slow in the beginning).
As a side note: Said web application also accesses locally connected barcode scanners over the local serial port. Unfortunately the only way to do this (aside of a locally installed client) is still using a Java Applet which I've also written back in 2004. So I do have the Java experience to know that I don't quite like it :-)
Java throwables come in two flavors: Exceptions like IOException which must be checked, and Errors like AssertionError which do not need to be checked. If you really, really don't like checked exceptions you can easily build libraries and write code that rely exclusively upon unchecked exceptions. I wouldn't personally recommend this design methodology.
Errors and unchecked Exceptions in Java should not be confused. An Error is typically reserved for the runtime environment for a "this ship is sinking, abandon all hands" kind of unrecoverable error. More properly Exceptions in execution that aren't checked in Java extend RuntimeException and not Error.
The stigma that Java has too many checked exceptions is no longer true with modern Java code. Everyone is using unchecked children of RuntimeException almost exclusively. Of course, there is still plenty of legacy code out there using outdated checked exception paradigms.
lots of the code produced by the community out there is full of FactoryFactoryFactories and other typing intensive, mind-bending and ultimately useless abstractions (most of them not DRY at all either
So what? Why does the code produced by others in "the community" affect your perception of the language and/or tools, if you aren't using their code?
Whether you fall in line or not, the culture around Java is around writing code to a certain style. Agree or disagree, there's an argument that by writing in a style that is familiar to Java programmers, your code is easier to read and maintain.
If you're one guy off in a corner, write however you want. But if you're not, you have to take the culture into consideration. And if you are one guy in a corner, why are you using Java?
I just started working for a large enterprise corporation (one of the biggest financial companies in the world). We have a lot of old code written in Java that needs to be maintained. I've been trying to advocate new ways of doing things, but almost every time the other developers will respond with, "that's just not how we do things here."
Java has a very strong culture around it. I worked in academia and startups previously and I didn't realize that there is a huge number Java programmers who do nothing but program in Java. They aren't interested in learning new languages and will only grudgingly learn a new framework. Their biggest concern making sure the lowest common denominator can still maintain the (unmaintainable) code.
An example is unit testing. Our current "unit" tests start up a JBoss instance, connect to the development databases, and take ~5 minutes to run just one test. But I've been told not to waste my time working on anything more modular and that if I'm going to put in any time working on unit tests, I should contribute to the framework everyone else is already using.
I'm already doing it. I set up cucumber + webrat to run through some quick UI tests. I wrote a mock-object framework into the last feature I designed so I could test it. There's still a huge resistance to change. I'm just hoping I can show how useful it is in the long run. In the short run it just looks like I'm wasting a lot of time tinkering on silly side projects.
I don't think that your company's conservative attitudes are because of their usage of Java.
I think that "one of the biggest financial companies in the world" would be just as conservative and anxious about the tiniest technology changes with any language: Ruby, Perl, or Fortran.
The attitude you describe sounds like it has more to do with being a large financial institution and the type of place where software development is a "cost center", not a profit maker.
It is MUCH easier to show someone how something like a single 5 minute unit test holds them back from being bigger better badder. Unit testing should take less than a minute for ALL of them in a project to run.
Ask for forgiveness after you do something...
The other way to go about it is to 'gingerly' find the single ally, and build on that.
Because when we call Java "ugly" or "stupid," it's the community we're talking about. My room mate is an extremely talented Java programmer, and he can fly around Eclipse[1] like a giant rainbow steamroller[2]. He uses Java like it should be used, and it's great. But I don't think he represents the community.
He tells me horror stories of code he refactors at work written by people in his own office, or worse, outsourced companies, and it's bad. It seems to me that that kind of code is more representative of the community.
When you're going to join a project, you have a better chance of encountering code not sucking if the overall culture of that language is better.
Ha, if you are thinking that way, I would suggest VB.NET or C# instead. Why? I remember the first time I was creating an MFC project using Project Wizard, I felt like I'm a fool looking at a bunch of auto-generated text & having no clue what it is about. And once again, I was in the same situation when I was using VS.NET to generate code for my first ASP.NET web app. But I still completed that webapp without even knowing what code is for. Does that make VB.NET/C# community more stupid than Java? Does that mean C#/VB.NET should be the ugly & stupid thing other than Java? So, you should better have another way to explain that.
personally, I prefer the dynamically typed languages.
but I hate. No. HATE PHP's type conversions with its == operator.
0 == 'foobar'
but
true == 'foobar' && 0 == false
so
true == false ?
eek.
Yeah. I know === exists. But if you have to compare strings and numbers, why is the default conversion method you do the lossy one? If you compare a number to a string, why can't you convert the number into a string and compare the two strings? Why convert the string into a number which will be lossy in most cases?
Sometimes it is "easier" to just type:
if (isThisReturningEmpty()) {}
instead of typing:
if (isThisReturningEmpty() === "") {}
And if you know something could return 0 (which is not empty), you should know to do a type-sensitive check). You are trading off HAVING to set types with HAVING to check types when needed (I think the latter is better).
Note that this isn't anything to do with dynamic typing: Python is very dynamic, but it doesn't have this weird coercion (or is it "automatic type conversion"?).
I hate this as well, but, I love dynamic typing. They aren't the same thing.
there are none, but to implement a callback you also wouldn't have to declare an inner class implementing some interface that in turn declares tens of methods just to react to that one callback.
In PHP 5.3 you'd just pass the function (which of course will pass a pointer to that function) and in earlier versions you'd hack something with eval or variable-variables which, while bad, is still better than either writing half a screen full of empty methods or inheriting an inner class from some meaninglessly named class that only exists for you not to have a screenful of empty methods.
In all versions of PHP, callbacks are extremely easy (no eval or variable-variables required). You just have to pass the name of function or method around and use the call_user_func() function to call it.
anyways. I have some reasons for my strong dislike of Java: a) checked exceptions, b) no method pointers or something similar and c) lots of the code produced by the community out there (and in the standard library itself) is full of FactoryFactoryFactories and other typing intensive, mind-bending and ultimately useless abstractions (most of them not DRY at all either).
Back in 2004 I did strongly consider Java though, but ultimately, I didn't have time to implement this web application AND learn a new library (learning the language is easy. learning the library is what makes you slow in the beginning).
As a side note: Said web application also accesses locally connected barcode scanners over the local serial port. Unfortunately the only way to do this (aside of a locally installed client) is still using a Java Applet which I've also written back in 2004. So I do have the Java experience to know that I don't quite like it :-)