-
Website
http://archive.patmaddox.com/ -
Original page
http://www.patmaddox.com/blog/2007/1/22/java-people-must-be-stupid -
Subscribe
All Comments -
Community
-
Top Commenters
-
jfcouture
2 comments · 4 points
-
Pat Maddox
49 comments · 1 points
-
Jörg
1 comment · 1 points
-
lucashungaro
2 comments · 1 points
-
Jason Coffin
2 comments · 1 points
-
-
Popular Threads
Got milk?
raise "milk can't be nil" unless options[:milk]
The message, ultimately, is to educate rather than insulate. That's a theme you'll find pretty common in the Ruby community. What do you find assholish about that?
It might be more accurate to say that Java people are smarter than they give themselves credit for.
The thing is, telling people they're stupid, when their problem is an equal mix of bad ideas and defensive thinking, that's not the most persuasive argument available.
I think the only compelling argument, from a Java perspective, at least, in terms of Java people I've talked to, is that nobody ever actually accesses the stuff inside Rails which, if it were inside Java, would be hidden. The door isn't locked, but still nobody goes in.
In any OOP language you do want to keep client programmers only using the API, not the internals of the objects the API is made of. That's a good design principle. Java makes it happen by building a fort, locking everything down, the theory being they can't steal it if it's nailed to the floor. Their goal is legitimate, but their way of achieving it is kind of paranoid. Ruby's got the same goal, but a radically different approach to achieving it. It doesn't enforce any kind of security, but makes it easy to build such elegant APIs that entering the "forbidden zone" never even occurs to people, because it just isn't necessary.
It's like the opposite of thinking defensively isn't thinking offensively; the opposite of thinking defensively is thinking *creatively*.
I read your whole blog entry, and I found it arrogant, and mean spirited. I can make 101 arguments why static type checking increases code maintainability, prevents runtime errors, makes code easier to write when dealing with unfamiliar libraries, and makes tools more useful. I don't know how many times I have had a problem show up in ruby at runtime that would have easily been caught by a good Java IDE as soon as the problem was created.
Calling people idiots, and stupid because they think static type checking is a good thing is just uncalled for. There are many very good arguments for static type checking.
Ruby allows you to lower the entry barrier to API programming *because* it lets you add or modify willy-nilly.
"Type-safety" and "block-boxing" are the arguments I hear the most when defending Java. If I'm dealing with Johnny McOutsource that might be a valid concern: ignorance or stupidity.
If I'm programming with people that are unwilling to, or incapable of, learn how to use Ruby *the way it was intended* then with any luck I'll be working with other people soon.
"Stupidity" may be a *harsh* way to put it, but it's still accurate.
I'll take you up on your "101 reasons..." challenge. I also don't know how many times you've had problems show up at runtime that would have been caught by a good IDE, but it's a pretty rare occasion *I* have, and for most things, it's *my* experience I care about.
My point is that programmers are *intelligent* people and should be treated with respect. Part of that is trusting them to make the correct decisions. If you don't think they'll make the correct decisions, you should _teach them the correct way_ rather than hinder their abilities.
At no point in my post did I call people idiots for liking static typing. Seriously, take some time to reread it.
_Concerns like these all seem to boil down to one major theme: The people I work with are stupid._
So let me make things *perfectly clear*: I don't think Java people are actually stupid. I'm just amazed that Java programmers all seem to think their coworkers are stupid. The title of this post was meant to draw attention *only* to that fact.
Unit testing was invented to help detect these mistakes as quickly as possible.
Strangely enough, the fact that old-school compilers all had built-in automatic error detection just isn't good enough for some people.
The idea that only idiots have any use for automated testing seems kinda strange.
"Stupid" is a word better used to describe people arrogant enough to assume absolute perfection in their own code, because inevitably they'll be unwilling or unable to actually do anything about their own mistakes.
If you are the Dave I think you probably are (Dave Thomas?) then thank you for contributing the whole two reasons you can think of for static type checking. However, we all know you are not exactly an objective source when it comes to the Ruby vs. Java debate. now are you.
I was naturally exagerating when I said 101 reasons. But I can come up with a lot of reasons, which I will try to list when I get off work.
Early on when I was still coding Java, I was working on a project that had really intricate object structures. I had basically no clue how to combine the classes usefully, it was a real pain.
After lots of frustration, I asked one of the other developers how he managed to use the classes. He took a look at my code, laughed, and showed me a builder class they used.
One approach would have been to hide all constructors, so that the only way to instantiate objects was through the builder. Of course they realized that it may be useful to instantiate objects directly at times, so there’s no sense in completely preventing that.
Instead of preventing me from making mistakes, these developers let me make them and then showed me a better way. This is a small, trivial example, but not only was I using the library correctly, but I also understand how, when, and why to use Builders.
That’s what I’m suggesting here. You shouldn’t lock people down in a fort. You should let them make mistakes and then guide them along. And you can do that in ANY language. Freedom and respect for programmers is philosophy, not a language construct.
@Dave - yeah, but again, they reach in to create APIs, not to circumvent them.
@Everybody! There's a lot more to understanding Ruby than intelligence or stupidity. I've met very intelligent people who didn't understand programming at all. I think any programmer who ever leaves their house will do the same thing sooner or later. It generalizes up from there. Criticizing smart Java people who don't understand Ruby is like criticizing smart Americans who don't speak Japanese. It's got nothing to do with intelligence, it's just where you're coming from.
You can't claim to know teams when you spend your nights coding your very own Ruby app; Put it into team of 15 people under strong business drivers and lets see what people say about "not coding with stupid people".
Once again, The Ruby community thinks it's god. Meanwhile the rug is being pulled from under their feet...
The only people calling Java programmers stupid are Java programmers themselves!
Here is my message, in bite-sized chunks, for those people unable to get past the title before hitting reply:
* It is a programmer's right to use his judgment when coding
* It is your responsibility to assist and instruct a programmer when his judgment is misguided
* Mistakes are natural and desirable. That's how we learn. Use mistakes as an opportunity to teach critical concepts, rather than let those concepts be hidden by safeguards
* These rights and responsibilities are universal to programming, and are not unique to any language. The only thing that can hold those back is your own attitude.
This has NOTHING to do with Ruby vs Java, static- vs dynamic-typing, or anything at all related to a language war. It's all about having respect, compassion, and faith for your fellow programmers. It's about being passionate and proud of what you do, and going the extra mile to share your ideas with others.
Doh!
I program games, which isn't very similar to web aps as there's not as much of a bend on security, and we build most of our own systems. Though there are certainly are some similar issues. But, I've always found, that, no matter how smart I think I am, the moment I think I have something figured out and can coast, I don't, and I learn the same stupid lessons over again. And with the loose type checking, never crash part of scripty languages, I get that sensation, and it scares me. They are nice and fun when I'm wipping up a util or personal app, but I'm really afraid of running them for anything serious. I would at least think some kind of verification layer would be nice for them, or maybe that already exists? I don't see any reason a psuedo/real compiler can't be run over them in some form, Python has this for speed doesn't it? Also, you got me to your article with the title (java: good idea, no follow through), I do most things in C/C++, and prefer C#. Haven't played much with Ruby yet... maybe that makes my post pointless?
@Giles: No, people reach in both to create *and* to circumvent, because writing APIs is hard. But I'd rather say "extend" than "circumvent", as extension seems to be the most common usecase.
"It doesn’t enforce any kind of security, but makes it easy to build such elegant APIs that entering the “forbidden zone” never even occurs to people, because it just isn’t necessary."
Now, I don't profess to be a Ruby expert (or even a Ruby dabbler), but this statement floors me. Every malefactor out there must be salivating when they read about things that are unlocked because properly-motivated people wouldn't "need" to break in.
There are very few real 'liberal' individuals when it comes to programming it seems .
You guys have so many interesting things to say but you are so passionate about your respective fields it clouds the kernals of truth within your thoughts.
A Rails webapp user wouldn't be able to "break in" to either the app or the code.
In addition, there are several ways to make a class final or closed so that if you didn't have access to the base-level code you couldn't wreak havoc malevolently via subclassing.
I agree with nearly every one of your points inside the body, but I don't agree with the title. And that seriously weakens the post body. It's not about people "not reading past the title". It's that your attention-getting title sets a bad tone for the post to follow.
It's called testing. :) I contend that anyone who says static type checking is essential doesn't know how to write good tests (and, yes, you should be writing tests for that regardless of static or dynamic typing).
There exist a number of places where you can fool Java or C# or whatever into thinking that its static typing has it all figured out, when, in fact, it does not. I know from some very annoying experiences that this is true. This is why testing is so essential, and if you're going to write tests, then why bother with static type checking? It's silly, because at that point you gain nothing. The advantages of a dynamic language so far outweigh the tiny degree of security that type checking offers me that I can't imagine ever going back if I don't have to.
I agree that the title sets a poor tone. When I reread the title after the post, it doesn't look like an assertion of fact or even his opinion. It sounds to me like he's shrugging when he says it.
[1] "If you need to protect someone on your team from code [...] the person is stupid."
[2] "[Ruby] certainly doesn't need static type checking. What we need is to kick the idiots out [...]"
So, you are certainly calling a class of programmers "stupid idiots." I wouldn't say you're calling Java programmers stupid idiots, exactly. You're calling anyone who's ever made the sort of mistake that a language feature such as static typing would catch, a stupid idiot. That is a rather large subset of all programmers; I'd wager it may be as large as {All Programmers - Pat}. This is call hubris.
fn1. "If you need to protect someone on your team from code [...] the person is stupid."
fn2. "[Ruby] certainly doesn't need static type checking. What we need is to kick the idiots out [...]"
So, you are certainly calling a class of programmers "stupid idiots." I wouldn't say you're calling Java programmers stupid idiots, exactly. You're calling anyone who's ever made the sort of mistake that a language feature such as static typing would catch, a stupid idiot. That is a rather large subset of all programmers; I'd wager it may be as large as {All Programmers - Pat}. This is call hubris.
If you _properly_ quoted my post, you’d say that your fellow programmers are _either_ stupid _or_ naive (inexeperienced). You’d also highlight the fact that I think *most programmers fall into the second category* – i.e. we should help them out, rather than just dismiss them.
Real idiots don’t help the industry at all. Just like they don’t help any industry. I don’t see why that’s such a controversial issue. I’m suggesting though that *most programmers are capable* and that when they screw up, we should help them out. I certainly wouldn’t have learned anything meaningful if it weren’t for people with that attitude.
All programmers make mistakes, that's how we learn. I make mistakes several times throughout a single day, and I have no shame for it!
There's no hubris here. I just wish people weren't so fucking dumb that they turn this post into something that it isn't. It's like they're just looking for excuses to waste time and energy. I'd rather be coding.
P.S.: Have you noticed how nobody has really responded to my challenge? Especially “somebody,” who was so adamant about me being an asshole. He couldn't find a part of my post where I actually proclaimed someone stupid, but he _did_ manage to bring up his *high school test scores*.
I am more productive because of strong type checking. I can say to myself, you know, this LoginManager class ought to take a String username and a char[] password, instead of a String password. I change it. I compile. The compiler shows me 5 places where this won't work. I fix it. I'm done.
Let's say that I want to rename 6 badly-named and rarely used methods in my LoginManager class, and then I get a phone call in the middle of this. I can take the phone call, leave for a meeting, come back to my project tomorrow, compile, and see exactly what I broke. In a weakly-typed language, if I forget the next day to do a find-and-replace, these missing methods would just sit there until they were called a month later and then break on a deployed application.
One of the arguments made about test cases is that they give you the flexibility to freely change your code, knowing that the tests will fail if you break something. Ruby users seems to get this. Now apply the exact same logic to the compiler - you have the flexibility to rename, remove, and change method signatures, knowing that the compiler will fail if you break something. Think of it as whole bunch of tiny test cases that are written for you automatically with no effort.
I feel that I am individually more productive because of this. But in addition to my own personal productivity, I am the lead developer on a team of 5 developers, some of whom work on the other coast, and now imagine the difficulty involved with one of these developers freely changing and refactoring their code libraries without strong type-checking.
Stupidity has nothing to do with it: I'm smart enough to know what weakly-typed languages are good for, what it's they're not good for.
Thanks for your thoughtful comment. I definitely understand that there are some benefits to static typing. Like anything else in programming, we look at the tradeoffs of various approaches and figure out what works best in a given situation.
I'd just like to point out that my post wasn't about static typing at all, nor was it an attack on it...which makes me wonder why so many other people managed to get pissy about that particular topic.
Pat
or, if you're more into the traditional methods, just hire an editor, the ultimate lifesaver of writers everywhere.
To me, it seems that this post is making two points (not in this order):
1) You should not try to protect stupid people from themselves, you should get rid of them and hire smart people.
Agreed.
2) The main purpose of static type-checking is to protect stupid people from making mistakes.
Strongly disagree, for the reasons I previously mentioned. If this is not what your post is about, then by all means feel free to correct my misunderstanding, but the beginning and end of your article (specifically paragraphs 1-3 as well as the last paragraph) certainly give me that impression.
unsubscribe. plonk.
From a Java guy, and a Ruby guy - I couldn't agree with you more. It really boils down to choosing the right technology for the problem at hand. And, sterotypically speaking, what I've seen from most members of the Java community is a complete and utter disregard, maybe even disdain, for any language that is "not Java".
I like Java, a lot. But I like Ruby a lot, too. And I'll use them both, but instead of choosing a technology for the sake of being a zealot, I'll choose it for the sake of what's best for my client/customer/end user/whatever.
Thanks Pat, this was a good read.
-daniel
I guess you don't work in the finance industry then. What you say is fine in many situations, what what if need that security/protection against misuse?
In an everyday situation, it is often more important to be able to demonstrate from a compliance POV that your code takes appropriate steps to prevent misuse, than there being much risk of it.
I don't want to plug some 3rd party API into my financial applications (like an API from a bank), which could possibly route through my code and send them back the trading algorithms I use. I want to lock down what they can do, which is easy enough in Java though isolation, tightly-written API's and the SecurityManager mechanism.
I guess this is a reason why Java would live on in the finance world...
I'm a Java-bod, but I love some other languages, Occam, Haskal. I also quite like PHP, though I feel dirty most of the time I use it. ;) My point is that although I appreciate the glorious usages of other languages, Java is currently my number one choice for enterprise development.
Actually why you don't attack C++/C# or Any lang that is using in the serious place? all these langs are having type checking during compiling and runtime to make it "safer".
BTW, how can you require anyone that using your API have to know what you are hidding behind the API?
how can your code know "1"+"1" = "11" or "2"?