Hacker News new | ask | show | jobs
by lampe 4931 days ago
I worked on a bigger JavaEE project with serverlets and all the other things...

after doeing things like: "someurl".toURI.toURL; to get a valid url and some other stuff that i really dont wanne start with...

I just refuse do code something for the web with Java and Servlets and RMI or Beans or Java Technologie X...

now i code in Javascript and ruby and iam so much happier as a developer :)

3 comments

I'm afraid to say this, but you sound exactly like someone with very little experience when it comes to large scale enterprise systems (your "serverlets" sums it up).

Java EE is extremely powerful if you can wield its power, and obviously a good understanding of object oriented programming and design patterns is critical in order to make systems that are rock stable, safe (container managed transactions comes to mind) and scalability.

I think you'll see my point once you start working on larger problems. It's not random that many really big enterprise projects (such as banking software) are based around Java EE, and not Ruby on Rails.

Note that I am not trying to be overly negative - it's just that I see this kind of argument all the time, usually from people with no real enterprise experience.

I like Play framework as an statically typed alternative, doesn't have most of the things we like less about Java, feels like RoR / Django, but is still statically typed (and supports Scala which I think is much more fun than Java once you get passed the "Scala is complicated" myth)
Scala may be "more fun", but, personally, I still have reservations about it being used in-the-large and I think calling the observation that Scala is, yes, complicated a "myth" is unnecessarily dismissive. You may not find it as such, but the language's kitchen-sink approach to features does have its drawbacks; I find that part of it manageable but that doesn't mean it's not complicated, it means I can deal with it.

I'm more concerned about legibility of Scala code. I've been using Scala in anger for about two years now and I still find myself writing what seems to me to be idiomatic Scala code that I have a lot of trouble reading three days later. (Play makes this worse, I find, because of the way that objects are exposed into your scope--these objects are super handy, but tracking down where they're coming from and what they're doing produces nontrivial cognitive load.)

I don't think its dismissive, The truth is Scala is _not_ complicated. People can do complicated things with it, but in general the language poses no real barrier to entry. Now the second point you bring up is more of an issue that I run into at times as well. Where I find a solution to a problem that presents itsself as the "Scala" way of doing something, and After i close my browser and go home for the day I forget about why I did that and show up the next day staring at magical Glyphs on the page that appear to work ( ohh i needed :>> not >:> ). To solve that problem you need to stop doing things you don't understand and instead take the long way around and write out function names instead of using the shorthand operators that your provided with. Once you get used to a library you will commit the operators to memory and you will know that :: is cons and ::: is list append and you won't have the "what did I do here" problem nearly as much
That's good for small teams/individual developers, but it really does become a nightmare in 5 years time. How do we know this? Go ask anybody who has had to maintain any kind of Perl code.

Scala is still very nice, but you need to exercise very heavy restraint so you don't end up with write-only code. (Java, and every other language, does admittedly have the same problem: I've seen Java code made up of so many levels of interfaces that tracking down what it does is almost impossible. Obfuscated C/C++ is a true terror. Ruby can get very nasty if you go 'off the rails'. etc etc.)

Right its a problem that exists in every language, there is nothing novel about scala that lends it to being any more cryptic then c++, other then there is a different set of rules as to what can be used where. Operator overloading in C++ is just as bad as scala, but most c++ programmers are used to it since they have seen it for a while. The first time I saw :/ I was really confused as to what it was since that's not an idiomatic C operator, but after seeing it in a few places you get used to the fact that its an operator and you read through it, just like I would if I saw a << in C++
I don't think its dismissive, The truth is Scala is _not_ complicated.

No. You think it's not complicated. I think it's complicated but manageable and that its real problems lie elsewhere. Claiming your position as "the truth" is dismissive and insulting to people who have the temerity to disagree with you.

As for your second bit--the thing is, I do not use "shorthand". The problem, I feel, lies more in the haphazard (to a reader) usage of "code punctuation marks" like braces and so forth. You find situations where they're used inconsistently or not at all, making it much harder for the eye to pick up what are otherwise natural breakpoints within the code for your eye to use to parse the intent of the code. Other design decisions such as including initialization logic in the class body, versus using a dedicated constructor method, contributes, for me, to a general sense of chaos. I do not feel like a lot of effort was put into writing a language that is conducive to reading the next day.

Note that I am not saying that you cannot write clean code in Scala--but I am of the opinion that the language's design is such that it does not encourage it.

No claiming that complexity is _subjective_ is dismissive. there is complexity and there is simplicity. There is also perceived complexity and perceived simplicity. As far as languages go Scala is pretty darn simple. There is very little going on in the background and the core of the language was designed to be a small set of orthogonal features that can be layered to build complex pieces of software. The perceived complexity is something we can argue about as it is subjective which is why you need to take a look at what your doing and how you might alter your practices to make it a more readable and simple implementation. You will always run across bits of a language that you will not understand, that doesn't mean the absolute state of the language has changed just your perception has changed.

This happens every time new developers run across a piece of Object Oriented C code with run time function overloading, their default reaction is I don't know whats going on this is too complex. C didn't magically become a more complex language because we introduced a new guy to function pointers and dynamic dispatch. Likewise Scala doesn't become more complex the first time you need to understand why marking your types as being covarient is important.

"You may not find it as such, but the language's kitchen-sink approach to features does have its drawbacks; I find that part of it manageable but that doesn't mean it's not complicated, it means I can deal with it."

I don't find the language to be a kitchen-sink at all. It is a fusion of OO and FP, and so would reasonably be expected to support features from each of those paradigms. And it does so quite nicely. It is very well designed for this purpose. However it does provide facilities that allows the libraries to become arguably complicated, especially if you are not used to them. But being unfamiliar with a library's API is not really the same thing as the language being unreadable or obfuscated.

To be honest, it scales up pretty well lines of code-wise. You just need to break it up into smaller apps.