News for hackers. Stuff that matters.
Re:Ruby is beautiful (but I'm moving to Python) by bad_user on Sunday November 28, 2010 @03:43PM (#1948241)
I'm a Python programmer, and I find code written in Ruby to be more beautiful.

It's just a personal preference, but I find anonymous code blocks to be a lot more elegant and intuitive than decorators + with statements + for comprehensions. I also like that classes are open, and that you can execute code inside the declaration of a class and that self is implicit ... making tasks suited for the __metaclass__ concept in Python trivial.

I also find Lisp / Haskell and ML to be really ugly ... as in, I could never look over a piece of code and understand what it is doing without learning the language first (with the learning curve being as steep as it gets).

     the language is far more complex less orthogonal and far 
     more full of weird corner-cases than what you come from
But that's the price you pay for convenience.

E.g. I don't appreciate that ML doesn't have a simple concept like operator overloading, or that in LISP every DSL still looks like LISP. I don't like that a Smalltalk application is not portable between implementations or that applications are big, monolithic images of the virtual machine with everything included, even the IDE.

It's easy to get into these mine-is-bigger-than-yours contests, especially with languages, but you know what works better than formulating half-baked opinions?

Results. It's a lot better to shut up and show me some code ;)

Re:Ruby is beautiful (but I'm moving to Python) by nickik on Sunday November 28, 2010 @04:20PM (#1948336)
1. You can not really juge the source code of a language if you don't the language. Reading alot of functional code is almost always easier then OO code because of pure functions. Look at this video for example at the videos witch can be found here http://www.janestcapital.com/technology/ocaml.php

2. The learning curve of those languages is not bigger then the learning curve of other languages. Time time I spend with making pretty OO designs in school was way bigger then the time it took me to learn clojure and FP in general but this of course is a issue we can not solve. I just don't like it if people say something as if it is a fact.

3. Is it more convenient to do this array.select &:even? better then (filter even? array)

The later seams more intuitive to me and I didn't have to learn more syntax.

4. In Lisp not every DSL looks like Lisp.

Re:Ruby is beautiful (but I'm moving to Python) by foljs on Sunday November 28, 2010 @09:25PM (#1949137)
"The learning curve of those languages is not bigger then the learning curve of other languages."

If only it wasn't for the fact that reality and history has proven otherwise...

Re:Ruby is beautiful (but I'm moving to Python) by nickik on Monday November 29, 2010 @03:01AM (#1949741)
The Homecomputer on witch most programmer learned where to slow for functional languages of that time. So FP could only be used in specialized domains.

Most programmers went form basic (lack of alternative) to C then C++ and now Java thats a path of simularity. Most where never exposed to functional programming and now the all have a hard time to switching there OO brain off.

Re:Ruby is beautiful (but I'm moving to Python) by masklinn on Monday November 29, 2010 @02:29AM (#1949690)
Any source for that utterly outlandish claim?
Re:Ruby is beautiful (but I'm moving to Python) by foljs on Thursday December 02, 2010 @12:27PM (#1962812)
Utterly outlandish? Please.

The only proof we have of something being easier to learn, beside anecdotal evidence ("oh, I tried it and it was easy") is statistical empirical evidence, i.e people actually learning it. Well, people are not actually learning those languages. They are learning the "other ones".

(Where by people, I mean: a significant percentage of people, > 1%. I'm sure me, you and that "professional programmer who gives a shit about Haskell" do not a significant percentage make).

Even in universities, students find functional languages difficult, and opt-out of those classes.

Re:Ruby is beautiful (but I'm moving to Python) by masklinn on Sunday November 28, 2010 @04:20PM (#1948335)
> I also find Lisp / Haskell and ML to be really ugly

Wow.

> I don't appreciate that ML doesn't have a simple concept like operator overloading

ML operators are nothing more than functions. The issue of "operator overloading" comes from the type system and the simplicity of the language.

> or that in LISP every DSL still looks like LISP

You might want to read on Scheme reader macros.

> I don't like that a Smalltalk application is not portable between implementations

It's true that you don't have this issue in Ruby as the "standard" is simply the original implementation (aka there is no standard at all, and not really any competing implementation).

> or that applications are big, monolithic images of the virtual machine with everything included, even the IDE.

That definitely isn't the case. That's not the case in GNU Smalltalk, and most commercial smalltalk let you create a stripped production image which contains only the necessary code.

Re:Ruby is beautiful (but I'm moving to Python) by mnutt on Sunday November 28, 2010 @05:27PM (#1948536)
> It's true that you don't have this issue in Ruby as the "standard" is simply the original implementation (aka there is no standard at all, and not really any competing implementation).

Check out https://github.com/rubyspec/rubyspec.

And there are plenty of competing implementations: JRuby, Rubinius, MagLev, etc.

Re:Ruby is beautiful (but I'm moving to Python) by masklinn on Monday November 29, 2010 @02:28AM (#1949687)
Checking out an effort to extract a viable specification from an implementation which manages to be incompatible with itself every other release? Why?
Re:Ruby is beautiful (but I'm moving to Python) by bad_user on Wednesday December 01, 2010 @04:13AM (#1957333)
The C# compiler in .NET also has incompatibilities with the ECMA standard. Need I mention C++, the most widely used and at the same time poorly implemented language ISO standard ever?

In fact, can you mention a single language with a standard that doesn't brake compatibility with its standard?

And yet the point is moot, because compatibility between implementations is manageable for popular languages like Javascript, C++ and yes, Ruby (JRuby, Rubinius). That's not the case for Smaltalk.

Re:Ruby is beautiful (but I'm moving to Python) by steveklabnik on Sunday November 28, 2010 @05:34PM (#1948553)
Not to mention the impending ISO standard.
Re:Ruby is beautiful (but I'm moving to Python) by Xurinos on Sunday November 28, 2010 @09:50PM (#1949182)
or that in LISP every DSL still looks like LISP

<bait>When your language is already at the top of the beauty chart, why would you write a DSL that is not also beautiful?</bait>

It is really a programmer choice. Lisp programmers generally love the way Lisp looks because of the advantages awarded by those looks (check Myth #7 here: http://www.algo.be/cl/myths.htm). But you can certainly create a DSL that requires more extensive string parsing, and CL provides a lot of help towards that end, including native translations of strings to Lisp objects where your parser needs them.

Re:Ruby is beautiful (but I'm moving to Python) by contextfree on Sunday November 28, 2010 @06:16PM (#1948694)
while we're complaining - my big problem with, really, programming languages in general, these days, is that they're getting good at making it easy to do complicated things within a process but unfortunately typical development projects are getting to be more distributed, which means that the nice abstractions your languages provide usually can't extend across your entire application, so you end up dumbing things down, relying on stuff like web frameworks which imo tend to be a bunch of hacks, etc. (This is probably the reason for the current popularity of dynamic/untyped languages - why bother specifying types when the invariants they create will only hold across part of your application anyway?)

I'd like to see more effort put toward creating programming environments that provide clean abstractions that span entire multi-process distributed applications.