I've realised what the real problem with Java is, for me. It's not the fact that my productivity is much lower with Java than it is with Python. After all, it's my management that decide that I should be using Java, and if they want to make me less productive than I could be, it's their prerogative.
And it's not the vast raft of tools, libraries and frameworks that a modern Java application uses that bothers me. It's a problem for a lot of people - c.f. Bruce Tate's superb Better, Faster, Lighter Java (on which more later), but I like learning new stuff, so I'm happy.
No, the problem is that Java coding is just no fun...
Posted to Java by Simon Brunning at February 23, 2005 12:54 PMCompared to RPG and Cool:2e, Java coding *is* fun, just not so much fun as Python (probably).
Posted by: Steve on February 23, 2005 02:15 PMPerhaps is not that programming in Java is "not fun" . Perhaps the problems you're solving using Java are "Not Fun".
Food for thought
Posted by: Rafael Alvarez on February 23, 2005 03:09 PMi agree with Rafael. when you code for the same type of applications over and over, no language is really fun :). For me java is fun.. Especially with IDEA.
Posted by: aaa on February 23, 2005 04:04 PMI'll go farther -- Java is depressing and ultimately turns you into a drone. It forces you into a brittle, boxy, narrow mindset, and you have to live in it and think that way. And that makes Jacob a dull boy.
Posted by: Jacob on February 23, 2005 04:08 PMNope, it really is the language for me. But I do realise that this is totally subjective. If you love Java, more power to you.
Posted by: Simon Brunning on February 23, 2005 04:36 PMSimon -
Totally agree mate. It is a personal thing. Some people love the sound of French. Some love Italian. Weird people like German :)
Java is a very simple *language*. All the power is in the APIs, so you can't express yourself that much in the language (IMO). However, when I work with Ruby I feel like I am in total control, and it is a lot more "fun" (comparing the same task in both).
I see how the strictness of Java helps huge teams, but on a small project, or with the right team, I would rather be coding in Ruby (or Python, or ....).
Cheers,
Dion
Posted by: Dion on February 23, 2005 04:50 PMI enjoy coding in Java me.
I'd say more, if I was sober...
I think it's great fun. It's nothing like sex or skiing or scuba diving with dolphins but it's still fun...
Posted by: Yagiz Erkan on February 23, 2005 06:54 PMI good IDE like Idea makes coding Java fun again, as does getting back to basics and removing dependencies on all of the frameworks which people use.
Posted by: Anthony Eden on February 23, 2005 07:21 PMSimon,
I think the problem with Java is that everything is possible, with just a little bit more code. There are no limitiations, so you spend 1/2 a day working on a problem, you fix it, then you find another problem, do a bit more research, coding, fix the problem, get a bit closer to your goal, get another problem, little bit more coding, download another framework, etc, etc, blah, blah, blah. Then you look a your watch and realise 3 months have just gone by.
I personally love web development using eclipse and java,j2ee
Posted by: David Free on February 23, 2005 10:21 PMI was find every Java project a PITA until this last one. Still, it's not Java that I'm finding fun, but the integrating a range of libraries, getting the engineeering right and meeting the reliability and interface requirements. It would be just as possible and much more fun in Python.
Posted by: Alan Green on February 23, 2005 10:48 PMAlan,
what is it about Python that makes it so great then? (Ive never tried it)
Posted by: David Free on February 24, 2005 12:32 AMHere is a visual demonstration of why Ruby is more fun than Java:
Java:
Map personToTypeMap = new HashSet();
personToTypeMap.put("Fred", "ISTJ");
personToTypeMap.put("Mary", "ENFP");
personToTypeMap.put("Bob", "INTJ");
for (Iterator i = personToTypeMap.keySet(); i.hasNext(); ) {
String person = (String) i.next();
System.out.println(person + " is type " + personToTypeMap.get(person);
}
Ruby:
["Fred":"ISTJ", "Mary":"ENFP", "Bob":"INTJ"].each { person, type |
print(person + " is type " + type)
}
Oops ... that was Groovy. But the Ruby would probably be similar.
Posted by: Jonathan Aquino on February 24, 2005 05:44 AMFor me, coding Java is much fun. The problem with Java is the missing standardized infrastructure/architecture providing basic services such as persistence, synchronization, authorization, transactions etc. J2EE seems not to be a good solution to me. Compare Java with SAP and you find Java is not a platform in the sense SAP is (not looking at the business logic coming with SAP standard modules but thinking of the SAP kernel).
Posted by: Klaus Meffert on February 24, 2005 09:37 AMIf you like expressive languages but you are stuck to the Java platform by your management, you can try to convince them to let you use a better language that compiles to the JVM. Since you like python, there is JPython. Or something that is more similar to Java, but with all the goodies, like Nice (http://nice.sf.net )
The above iteration example in Nice:
[("Fred","ISTJ"), ("Mary","ENFP"), ("Bob","INTJ")].foreach
(((String person, String type)) => println(person + " is type " + type));
Is that *THE* fun that you're talking about:
["Fred":"ISTJ", "Mary":"ENFP", "Bob":"INTJ"].each { person, type | print(person + " is type " + type)
}
Dude! You seriously need some REAL fun! If "fun" means to you "to write the most complex looking line so that only I can pretend to understand it therefore I feel smarter" then you may be having fun but not the people maintaining your code. *sigh*
Please show both examples to a friend of yours who isn't software developer. Let's see which one comes up as being more readable...
Posted by: Yagiz Erkan on February 24, 2005 10:48 AMWhy do python people hate java people ?
Maybe they want the world at their knees because they think they are worth it as best programmers of the universe.
"what is it about Python that makes it so great then?"
How about not having to write millions of lines of boilerplate just to turn one bizarre over-engineered Java framework object into another? (With both objects being arbitrary abstractions with dozens of perverse accessor methods just to satisfy some other badly-engineered specification thought up at Sun or IBM, or in some Apache project on a slow day.)
"Of course," say the IDE advocates, "you can always get the IDE to fill in all that boilerplate with [insert random favourite plug-in of the month]." But then, running development hardware with more computing power than the 1960s, just so that they can have the IDE randomly underline snippets of code that they're about to erase and replace with the classic text "hello world", they're satisfied deploying thousands of jar files for a mediocre Web application.
Posted by: The Badger on February 24, 2005 03:54 PM(oops)
"Why do python people hate java people?"
I don't think that Python users hate Java users, so asking "why" assumes a bit much. Python users may hate Java, and Python users may strongly suspect that Java users hate themselves, but that's not the same as Python users hating Java users.
Posted by: Chad on February 24, 2005 03:57 PMAlexandria, Egypt, circa 500 b.c : c=a+b
(and endorsed by newton, leibniz, einstein
etc)
C: c=a+b;
C++: c=a+b;
Tcl: set c [expr $a+$b]
perl: $c = $a + $b
Python: c=a+b
Now how many times have you forgotten the
semi-colon, dollar, brackets etc. ? never?
(well sorry you might need to check if you're
human) for the rest of us thats why
we love python. Its called elegance.
"Beauty is truth, truth beauty" - John Keats
Posted by: Martin on February 24, 2005 04:04 PM"Please show both examples to a friend of yours who isn't software developer. Let's see which one comes up as being more readable..."
But we're writing software, not prose. If your software is being maintained by non-software developers, that's a problem.
I agree that overly terse code is a bad idea in any language, but being forced into overly verbose code sucks too.
Posted by: tj on February 24, 2005 04:52 PMWell, to continue on the iteration example, a python version:
for person, type in {"Fred": "ISTJ", "Mary": "ENFP", "Bob": "INTJ"}.items():
print person, "is type", type
"But we're writig software, not prose.."
This is the mandarin approach. Wrap new
knowledge up in complexity and obfuscation
so the avergae person is too intimidated
to ever touch or benefit from it.
Congratulations on upholding
the values of Wall Street, the darker side
of the legal process, government etc.
To make software code
accessible to the everyman is a truly
great and astonishing achievement and why
I take my hat off to Von Rossum. Software
should be, must be accessible to 'non
software developers' to the point where
any clear thinking individual can create
and maintain it. Clarity fosters clarity.
Java born of the corporation
upholds the corporate world view and values
(control, conformity, complexity). Python
born of the individual champions the
individual. Hard not to choose sides...
Or perhaps:
for person, type in (("Fred", "ISTJ"), ("Mary", "ENFP"), ("Bob", "INTJ")):
print person, "is type", type
Does it *need* to be a mapping?
Posted by: Simon Brunning on February 24, 2005 05:13 PMHeh. I suspected the "prose" comment would generate a response. I agree that writing software can feel like writing poetry. Still, we're not writing software to be read by the layperson. We're writing it for a) developers, b) machines, in that order.
That said, Python makes it pretty simple to bridge the gap between "clear thinking individual" and productive software developer. Then, once you're productive there are still juicy bits like metaclasses to keep you going.
(Notice I'm not dissing Java, just championing Python.)
Posted by: tj on February 24, 2005 05:23 PMI'd even say:
for person, type in ('Fred', 'ISTJ'), ('Mary', 'ENFP'), ('Bob', 'INTJ'):
print person, 'is type', type
Even less ink ;-)
Posted by: Marcos on February 24, 2005 05:25 PM"But we're writig software, not prose.."
- Most of the time, writing software is a team activity. And if we are doing well in creating successful software, it outlives the development period and probably outlives the team. The living software is always maintained. Therefore our job is not only to make the application work but also to make the code easier to understand, easier to maintain. Simplicity is not very easy to obtain because it requires discipline, maturity and intelligence. And as a smart guy once said "Things should be made as simple as possible, but not any simpler" and I think Java does a good job in that.
- The more experienced among us will probably agree, most of the developers in our industry aren't passionate about writing code or let's say they're not having fun in writing the code. For most of us it's a job. Professionalism requires creating understandable code, simple design and simple architecture. Recent IT history is full of failures of overly complex technologies. Most of us laugh at VB and most of us don't even consider it good enough to develop with, however it's currently one of the most widely used languages (if not the most). Why? Because it is simple. If we want to distinguish ourselves, we don't need to write complex code, writing good code would suffice!
That's why that the code example given above doesn’t convince me that Ruby/Groovy/Python is a better alternative, let alone being more fun...
"Most of the time, writin software is a group
activity etc."
Are you for real? Java is 'simple' compared to
Python? lets try the basics
Python: print 'Hello, world'
Java: public class HelloWorld {
public static void main (String[] args) {
System.out.println("Hello, world!\n");
}
}
I bet your 80 year old granny might have
a good shot at the Python... the java might
well be the end of her..
PS.
The quote is "Make everything as simple as possible but not simpler" by Albert Einstein.
> The quote is "Make everything as simple as
> possible but not simpler" by Albert Einstein.
:-) Thanks! I was wondering who he was
For God's sake! I don't consider writing "Hello World" on the screen a real example. Give us an example about some database operations for example! How easier it is compared to Java/Hibernate solution? How intuitive it is?
Posted by: Yagiz Erkan on February 27, 2005 11:41 AMI'll give you 'fun' (back to opening topic).
Fun for example, was building in 3 DAYS using Python the same ethology model for microbes it took 3 WEEKS to build in Java.
The fun can be in what you do - getting the feed-back soon...
And by the way, it was my FIRST Python program ;-)
Cheers,
Re "For Gods sake..."
You don't consider 'Hello World' a 'real'
example? Shame, since a lot of programming
language books begin with it. You get a
real working program and build momentum from
there. Never used print statements to give
yourself a sense of where your program is
at or to aid real time debugging? (hmm well not
surprised since the bloat in java would
be large). You are telling me that in
any realm of human endeavour something
that makes the simplest task more complex
can still be in some overall sense be simpler? I
have an open mind, give me some examples...
I am sure Java has elegant solutions in
certain situations. But it takes effort,
real effort to get Java (or C++ or even
C) progrmas to actually work in the first
place. Eric Raymond wrote a superb essay
about the startling experience of reluctantly
writing in Python for the first time and being
blown away when his program worked right off.
I am not for one second saying Python is the
'best' language. But it scores hugely on
simplicity. And for me (personally speaking) simplifying technology is far and away the
most important step to be taken right now.