I like the COBOL red-herring. Java can't be that bad because there's still COBOL! We must fight COBOL... wait.. that's actually kind of a good idea. Raise your hand if you're a COBOL developer. Any young COBOL developers trying to break into the field?
Hate Java? You’re fighting the wrong battle.
151–160 of 186 posts
Re: Hate Java? You’re fighting the wrong battle.
#152Earlier quoted context omitted.
I don't understand that because Java is more object-oriented than Ruby, not less. Most people seem to think that Ruby got popular because it was LESS Object-oriented than C++, Java and .NET.
In what way is Java more object oriented than Ruby? In Ruby, everything is an object. There's nothing like Java's glaringly out of place "primitive data types". Not to mention that late binding is one of the qualities Alan Kay listed as being central the the meaning of the concept "Object Oriented Programming".
Re: Hate Java? You’re fighting the wrong battle.
#153Earlier quoted context omitted.
"This is what switching out of the Java paradigm, into Ocaml or Haskell, is like." If you try to do real, production programs in Haskell or Ocaml, you find that they have a lot of problems too. I've written some reasonably cool stuff in Haskell (like one of the top tutorials that people use to learn it). My teammate got his Ph.D under Simon Peyton Jones and did his doctoral thesis in Haskell. We were talking one day…
I've been playing around with Haskell recently (actually have been for years, off and on) and have been thinking about doing a real production system in it in the near future. What is going to be so hellish? Space leaks? That doesn't seem like the worst thing in the world to me. Lots of scripting languages tend to bloat over time and the usual answer is to kill and restart the process every now and then. Even Apache…
You really want predictable execution behavior in those systems. You want to be able to look at a graph of runtime parameters - memory usage, or server load, or QPS, or 95th percentile latency - and see that it's stable, and not have surprises like a massive spike that then shows up as user-visible outages. Because getting paged really, really sucks, and losing money because your customers can't access the system sucks even more. "Kill and restart the process every now and then" is not robustness.
If your intention is to play around with some prototypes and see what you can build, Haskell on the backend and Python on the frontend is a fine choice. Your biggest issue (other than the learning curve of Haskell) will be finding libraries that you can leverage, and Haskell has one of the nicest C FFIs out there. Other than that, here're assorted other little annoyances I've run into.
1. Positional data structures (tuples, "naked" [non-record, no accessor] ADTs, functions with long parameter lists) really suck. You will eventually want to stick another bit of data in there, and then you have to update all the usage sites with new pattern bindings. As immature as the record system is, take the time to use it from the beginning; it'll save you pain later on.
This is a very common pattern in C++ as well; many experienced API designers I know will give all their methods the signature of "bool someMethod(const MethodInput& input, MethodOutput* output)", where MethodInput and MethodOutput are structs. At Google, we often use protobufs as the structs; that gives you a bunch of other benefits, as you can instantly print them out for debugging, and you can log them efficiently, and it becomes trivial to turn the API into an RPC service if it outgrows a single process.
2. Don't be afraid to use type inference; oftentimes, the compiler can infer a more general type than you can write down. If you do write down the types, be liberal with your use of type synonyms; you will probably end up changing those types later, and it sucks to have to visit a few dozen functions with a search & replace. "newtype" is very often worth it, if just for the added typechecking.
3. Point-free style is cool, but I've never been able to look at point-free code I wrote a month ago and understand what it was doing. Don't do this outside of very specific cases where the point-free version has some semantic meaning (for example, you're treating a partially-applied function as an object that does something. If you wouldn't define a closure for it in Python or JavaScript, don't make it point-free in Haskell).
4. Haskell module patterns are much more similar to C than C++ or Java. You typically want a clear divide between "data" modules (that define fundamental dataypes) and "code" modules (which define functions and algorithms acting on those datatypes). Trying to use the OOP-style, "one class per file" approach is very frustrating in Haskell.
5. The "mathematician's naming convention" (all single-character variable names, with "s" as a plural to indicate a list) is just as bad an idea in Haskell as it is in C. Go give your variables some meaningful names and ignore all the tutorials that have "xs" and "ps" and "qs".
6. Very often, you'll want to define a monad for your code from the get-go (you can even just typedef the IdentityMonad to start out with) and write your code in a monadic style from the beginning. You will want to add error-handling and probably state and logging at some point in the future. If you start out with a typedef'd monad type, you can just change the typedef to some monad transformer stack as you need to.
Re: Hate Java? You’re fighting the wrong battle.
#154Earlier quoted context omitted.
While I appreciate your experience, you basically are saying that it would be hellish because of two features. Haskell and/or OCaml have many incredible benefits, and many of them do not rely on laziness to work. Sure it allows you to write some incredibly elegant, generic solutions - but I don't think it is necessary to have it as the default. I think things like the record system could be fixed up with simply more…
Oh, I think that nearly all of the problems with Haskell could be fixed up if it had the resources of C++ or Java. The problem is that in getting those resources, it would create new problems that would end up looking a lot like the whining about C++ or Java. Java, as a language and a platform, is not fundamentally that bad. It was certainly done by very smart people with lots of experience. It sucks because it has s…
So, popularity requires bad design decisions. Put it bluntly, most programmers are ill-educated. Fine, let's fix that problem, then.
Re: Hate Java? You’re fighting the wrong battle.
#155Earlier quoted context omitted.
We went PHP->Java a couple of years ago, because we'd need thousands of app servers if we didn't. We recently agreed that when we replace the stuff that isn't performance-critical, we don't need to take the productivity or morale hits to do that in Java, but we'll be damned if it's staying in PHP.
Did you happen to write/blog anywhere about the scenario and the reasons for the move from PHP to Java? It would be an interesting case study.
We don't like Java, but the JVM has met our needs pretty well. I was tempted to argue for Clojure, but I'm not sure we could have taken the performance or maintainability hits for discouraging static typing.
Re: Hate Java? You’re fighting the wrong battle.
#156Earlier quoted context omitted.
Indeed. I implemented a linked list in C the other day, and it's the most fun I've had programming in years. as an aside, I feel old being able to talk about having programmed for years.
Coding in VB6 keeps you forever young
my first programming experience was in unstructured BASIC. I think I've managed to reverse the brain damage from that, but I can't be too sure.
Re: Hate Java? You’re fighting the wrong battle.
#157Earlier quoted context omitted.
I don't think those are examples of great software. They are very useful, and many fill a niche that needed filled, but they aren't great software IMO. Hadoop is a very leaky abstraction to give one example. I've seen it crash frequently because people used wild cards for their input and the job tracker would run out of heap and crash.
Hadoop is a leaky abstraction because it crashes ? Does not compute! I'm not very familiar with the others, but Lucene is really an example of great software. In a few lines, it makes you feel as if you can build a Google by yourself !
Hadoop is an abstraction over a distributed file system, that allows programmers to crunch large amounts of data using map reduce.
It leaks in the sense that you have to think about implementation details of the job tracker or you will crash it. That's a leak, right?
Re: Hate Java? You’re fighting the wrong battle.
#158Earlier quoted context omitted.
Steve Pavlina has one essay, in particular, which changed the way I thought about my business and directly contributed to my later success. (The five-second version: improvements in your funnel are multiplicatively effective. Does that sound obvious? It wasn't obvious to me, and it set me down the road of A/B testing and other hillclimbing, and I climbed my way right out of my day job.) Yes, he later went seven flavo…
Since Steve Pavlina makes something like a million dollars per year on his magical blog, he has credibility when it comes to making money. The real question to ask about Steve Pavlina though is whether his blog posts are designed to help YOU make money, or to help HIM make money. He typically doesn't provide objective evidence indicating you will be helped. And if he wanted to, he COULD get this evidence. So for inst…
Re: Hate Java? You’re fighting the wrong battle.
#159I'm going to cite Steve Pavlina here: http://www.stevepavlina.com/blog/2005/07/how-to-get-from-a-7... Some snippets: A 7 seems very close to a 9 or 10, but often a 7 is a local maximum — you can’t get any higher by continuing to follow the same path that got you to that 7 in the first place. A 7 is pretty good. At this level you feel generally content. It’s OK, fine, acceptable, satisfactory. What you’ll find when yo…
"This is what switching out of the Java paradigm, into Ocaml or Haskell, is like." If you try to do real, production programs in Haskell or Ocaml, you find that they have a lot of problems too. I've written some reasonably cool stuff in Haskell (like one of the top tutorials that people use to learn it). My teammate got his Ph.D under Simon Peyton Jones and did his doctoral thesis in Haskell. We were talking one day…
Ocaml is an elegant, simple language that is in many ways like a "functional C". You can also write very fast, robust code in it. Haskell is where the next generation of cool language concepts is coming from (like Lisp in the 1960s-80s) but I'd prefer Ocaml for production use.
That said, you'd need to put some resources into rewriting the runtime to make use of multicore. Ocaml is blazingly fast but right now the implementation is single-core only.
Re: Hate Java? You’re fighting the wrong battle.
#160Earlier quoted context omitted.
If I ignored anyone who I thought held a stupid opinion on any topic whatsoever, I'd be ignoring a lot of very smart people.
Not all very smart people are trying to help you, so it is appropriate to ignore a lot of very smart people. In order for someone to be useful to you they need to tell the truth and give you accurate information that has been tested and verified. There are lots of very smart people who it would be a big mistake to listen to. Cult leaders are the perfect example!
It is striking to me how often a world renowned expert, really top-notch in his field, can turn around and say something spectacularly dumb in an area that isn't his field. You'd be surprised how often people just don't know what they don't know, or get emotionally attached to something foolhardy. You get an expert entertainer talking about statecraft or a hard scientist talking about religion or even just a software guy talking about hardware. It can be gobsmacking.
There is a train of thought that tries to classify people into reliable and unreliable -- worth listening to or not. And I think that's a very bad idea. No one is perfectly reliable. No one has a completely rational and educated worldview. No one. I think just about everyone is going to have an opinion about something that I think is monstrously, provably, stupidly wrong.
I think the best you can do as far as reputation goes is assign it to (person, topic) tuples.
But I still think that's a heuristic at best. Perhaps a necessary one, but I think it's better still to reserve judgement for evaluation of the evidence. Listen to what someone says. Listen to the arguments he makes. Listen to the arguments other people make. Trust your own experience and reason, and go with what makes sense.
What I am saying is that if you ignore people who you think believe stupid things, you'll be ignoring a lot of people who really do know a lot of things worth listening to. And I think more than that, I'm saying that if you classify information, not by empirical value, but by the tribe of who it comes from, you're evaluating the world more like a cultist than like a scientist.