(no title)
devinus | 11 years ago
C# - 7.9% C - 7.2% Rust - 7.1% Visual - Basic - 6.6% Makefile - 6.5% Java - 5.8% Forth - 5.0% Go - 4.5% PostScript - 4.2% Haskell - 4.0% Shell - 3.8% Perl - 3.5% JavaScript - 3.4% Matlab - 3.2% Scala - 3.1% PHP - 3.1% OCaml - 3.0% Lua - 2.8% R - 2.7% Python - 2.7% CoffeeScript - 1.9% Ruby - 1.9% Clojure - 1.9% Scheme - 1.7% CSS - 1.4% Other - 1.1%
It seems you could extrapolate interesting theories regarding productivity using these numbers.
There's a jump between Ruby/CoffeeScript and Python, and I wonder why.
barrkel|11 years ago
Veedrac|11 years ago
zatkin|11 years ago
edgyswingset|11 years ago
https://github.com/kanaka/mal/blob/master/cs/core.cs#L272
Could easily be turned into one line ... not that any sane person would want to, though.
unknown|11 years ago
[deleted]
Veedrac|11 years ago
`core` has inline lambdas in Ruby:
but separately defined ones in Python Note that `return None` isn't needed - Ruby doesn't have it, so that's a "wasted" line. The function should also be more like or, if Python 2 support wasn't needed, Defining these out-of-line is a good idea, though (it improves introspection in Python).`mal_readline` has a bit of support for Python 2 which takes a few lines, but mostly it's code like
versus The Python code handles errors but has two pointless `pass` statements and a couple of odd choices. It should better be: Note that the Python uses lazy reading which is why it needs explicit closing; Ruby likely would too if it read lazily.I have no idea what's up with `mal_types`/`types`; Ruby does simple stuff and then Python does... something. I will say that the Python can be a lot simpler at minimum, although I'd need to grok what it does before I can say what. For example,
can be replaced with I think the `_Q` suffix is a the writer missing Ruby's `?`-suffixes on identifiers.There's also a lot of mess that I think arises because the writer might not be aware that you can make callable objects in Python.
I think in the end it comes down to language experience. My Ruby would probably look as hacky as Joel Martin's Python. I doubt there would be as large a difference if they were both written with the same language familiarity.
agumonkey|11 years ago
kanaka|11 years ago
I'm happy to take pull requests that make an implementation shorter and/or more idiomatic as long as it doesn't change the overall order/flow (and doesn't break any of the tests of course).