4 ms·
one persons 'lack of expressive power' is another persons 'this code is easy to read'. i've moved from python -> go for server backends & some personal command
by dilap 10y ago
one persons 'lack of expressive power' is another persons 'this code is easy to read'.
i've moved from python -> go for server backends & some personal command-line tools, and couldn't be happier.
i still use python for interactively for figuring stuff out, but for anything big enough to be saved to a file, i'll reach for go.
ymmv!
- crimsonalucard 10y agoexpressive power can make things easier to read. python reads like pseudo code and is arguably the most readable language out there. C has more expressive power than assembly and is also more readable.
- weberc2 10y agoPython can be very readable. In practice, it's much less readable than Go. Also, Python's lack of typing makes it very hard to follow type arguments (something I lament daily). I love that I can enter a few keystrokes in vim and see the type signature, methods, fields, documentation, or even the full definition. Python doesn't really have this (at least not unless your project is using mypy).
- xapata 10y ago> in practice I guess that depends on who is practicing.
- trentnelson 10y agoOne of the side projects I've been working on attacks this in a different way; what if we efficiently trace every single call point at the Python and C level, including all arguments, such that we can build up a historic inference of types a given object label had at any point in time.
- coldtea 10y ago>one persons 'lack of expressive power' is another persons 'this code is easy to read'. Expressive translates to "easier to read". Having 100 lines of very simple procedural statements to accomplish what an expressive language does in 5 higher level lines doesn't make the 100 lines easier to reason about or maintain. At worse it makes reasoning about their memory/speed beahavior harder -- but when it comes to reasoning about their functionality and the correctness of your program it's orders of magnitudes easier.
- collyw 10y agoI agree. If I am doing something "complicated", that won't be obvious to a beginner, I put a comment beside it. Having two or three lines as opposed to 20 or 30 is often easier to read if you ask me.
- dilap 10y agothere's defnly some truth to this -- more concise (via expressive power) code can be easier to grok, because it's easier to see the forest w/o so many trees in the way. but on the other hand, having simple code where it's easy to point at each bit and say 'that does this, that goes here' can also make code easier to understand. for me personally, on balance, the latter wins outweigh the former losses when going from python -> go. i'd say it's probably a small bump down in expressiveness for a large jump up in 'look and know what it does'-ness. (it's not like go is really missing that much that python has -- maybe list comprehensions (which are great!), tuples, and generators?) it'd be fun to do some empirical investigation of these things. take some toy problem, code up idiomatic, by-the-language-advocates solutions, and then throw them at large groups of people asking them to make some change, or fix some deliberately introduced bug, and see how the #s came out. :)
- yandrypozo 10y agowell said, I still like Python but it was a great move for me
- nine_k 10y agoThe problem with under-expressive code is boilerplate. "You cannot pay people enough to carefully craft boilerplate code" (quoting the founder of Jane Street). When you glaze over while reading boilerplate, or wearily copy-paste when you write boilerplate, the chance to make an error grows significantly. This used to be a problem with Java (and still partly is), despite static typing and top-notch IDEs. It's sad when a new language suffers from that, too. OTOH, it took Java 8 years to introduce generics. Go just need to mature a bit (not ironically; it needs to sort out less ambitious technical issues first).