Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I can (obviously) only speak for myself, but the reason I use and like lua isn't because I particularly love lua-the-language; it's because lua's syntax/semantics/implementations are tiny. I can easily hold it in my head and build on top of it. Its simplicity is its strength.


But then surely the Lua code you write has to be more complex, harder to hold in your head, etc.?


Not sure I buy that argument. By that reasoning Code written in Go must be more complex than code written in Scala since the language is much less expressive. However in practice I haven’t found that to be the case at all.


That’s so interesting to me, I totally have had that experience specifically with Go! The lack of exceptions and genetics contribute greatly to Go’s simplicity but I have always felt like my code suffers for it.

Do you find that your Go code is, if not more complex, at least more verbose than in Scala?


If that were the case, would you also say that surely c++ code is simple and easy to hold in one's head, since c++ itself is comparatively large and complex?


For the same algorithm implemented in both C and C++, I generally find the C++ easier to write and follow, yes. Am I weird?


That's interesting. The opposite is true for me, but I can see (in the specific circumstance of C vs C++, at least) how you would see it that way. For me to find C++ easier (or equally easy) to read or write than C, it has to be a very particular subset of C++.

Do you find it to be the case generally, that larger / more complex languages result in code that's easier to read and write? If so, are there many exceptions?


I think all else being equal, yes? C# is very complicated and LINQ is an extremely complicated language feature, but if I need to express something that fits well with LINQ it’s stunningly clear. ES2017 has destructuring and async/await, quite complicated compared to ES5 yet they make my logic easier to follow vs doing the same tasks without. Even if each individual expression or statement in ES5 is easier to understand than ES2017.

Of course, with larger languages you can also come up with weird examples and say “what do you think this does?” in a brain teaser sort of way, or play “spot the undefined behavior” in C++.

Exceptions? I guess if features are both hard to understand and mandatory, like monads in Haskell or structural typing in TypeScript (not saying they are bad features, just that they add to the cognitive overhead for me). Or if there are lots of features and they’re not orthogonal to each other, leading to lots of surprises. Or certainly if you’re working with people that are overly clever and you find it hard to understand their code.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: