4 ms·
It's my main language for almost two years now ;)
by janmonschke 14y ago
It's my main language for almost two years now ;)
- notiontaxi 14y agoFirst they ignore you, then they ridicule you, then they fight you... ...than u rule da web.
- Destroyer661 14y agoI'm not saying that it being your main language is bad, it's just the syntax is absolutely terrible to read and understand for those of us on C-style languages. If the point was to teach others, the vast majority of your audience is not going to be reading coffeescript and learning much.
- tinco 14y agoIn all code examples you can press the down arrow to view the horrible (c-style) Javascript source. The javascript seems to be mainly horrible because of the coffeescript code being object oriented and its lack of a more powerful looping construct.
- ville 14y agoIt looks like there is something missing in the first example in Javascript. Population = (function() { Population.prototype.genomes = []; })(); This throws a ReferenceError because Population is not defined. Genome = (function() { Genome.prototype.values = []; function Genome(values) { this.values = values != null ? values : this.initial(); } Genome.prototype.inital = function(){ return [RANDOMARRAY FROM [0-14]] } })(); After this part Genome will be undefined.
- janmonschke 14y agoThx, forgot to copy the var statements. It's fixed now.
- jeswin 14y agoIMHO, I don't think it is fair to suggest this. - There are GA tutorials available in several other languages, if this doesn't work for you. Btw, if a tutorial was offered in Lisp/Haskell, would we see the same suggestion? - For Ruby/Python programmers, this isn't hard at all to read. Familiarity with non C-style languages might be something to pick up. - Having moved to Coffee from C-style languages, I prefer coffee. But that is just my opinion. I think HNers should be more tolerant of language choices. That argument can't really be won.
- phpnode 14y agothat's funny because coffeescript is meant to be all about readability in code. I wonder if you really tried to read this or if you just commented based on the title. If you did really read it, I wonder if you found it hard to read because your opinion is tainted by those C style languages? It's not scientific of course but I just got my non coder, non technical girlfriend to read through both the coffeescript and javascript versions of this and I definitely had to explain a lot less to her with the coffeescript version, she says it's easier to read because it's structured more like plain English.
- jashkenas 14y agoHurrah. That's a big part of the entire premise.