5 ms·
> It's readable because if you've worked with Golang for more than a week, you basically know every language construct you'll encounter. If you've used Brainfu
by catnaroek 10y ago
> It's readable because if you've worked with Golang for more than a week, you basically know every language construct you'll encounter.
If you've used Brainfuck for more than 5 minutes, you already know the entire language. Is it the most readable language ever designed?
> I can usually just go to the source code if I'm trying to figure out how to use a library I just pulled in from clojars.
Will a cursory read of the source code either tell you how the library deals with corner cases, or convince you that such corner cases don't exist?
- Jtsummers 10y agoAnd the source code doesn't tell you why something was done. Why is this message expected to be only 42 bytes long or less? Is there a specification for it? I can see that someone grabs two adjacent bytes, pulls out 12 bits from them and puts them into a variable called "version": version = ((data[0] & 0x0F) << 8 | data[1]); But why? Is this still correct with the current specification of the message format? Who knows! And this is a best case, where "version" is a meaningful variable name.
- catnaroek 10y agoMy thoughts exactly.
- jcadam 10y ago> If you've used Brainfuck for more than 5 minutes, you already know the entire language. Is it the most readable language ever designed? Oh, come on... BF was specifically/pathologically designed to be unreadable. > Will a cursory read of the source code either tell you how the library deals with corner cases, or convince you that such corner cases don't exist? Um... no, not really (at least not a cursory glance), but readability certainly helps track down issues later when you do run into an unforeseen corner case. Language choice is all about trade-offs -- if things like this are what is most important to you, perhaps you would be happier with something like Haskell or Ada.
- catnaroek 10y ago> Oh, come on... BF was specifically/pathologically designed to be unreadable. I was just exposing a flaw in your “readability” criterion. Another example: you can learn the rules that govern a given cellular automaton in 5 minutes, yet be completely unable to predict what said automaton will do when run. > readability certainly helps track down issues later when you do run into an unforeseen corner case. I'd rather not have issues, and always be sure that I've handled everything. Only applied formal logic can help. > Language choice is all about trade-offs Normally, understandability trumps all else. The only exception is when it's too badly in conflict with performance. > if things like this are what is most important to you, perhaps you would be happier with something like Haskell or Ada. Nah. GHC Haskell and Ada are both ginormous languages that I don't believe anyone could fit into their heads in their entirety. In particular, with GHC Haskell, I don't feel confident saying “this code does exactly what I want and nothing else”, because someone might enable an extension I haven't accounted for, and then hilarity ensues. (And nobody uses the language specified in the Haskell Report.)
- jcadam 10y agoTruly. I used Ada professionally for several years and wouldn't want to go back. Even though programs that compiled had a much higher probability of just working compared to other languages, programming with Ada was both dull (or maybe that's just an Aerospace industry thing) and frustrating (that type system, ugh). One thing I found while messing around with Haskell is that while learning and writing vanilla Haskell is one thing, deciphering Haskell written by others is quite another, given the propensity of library authors to use language extensions and stuff like TemplateHaskell.
- tome 10y ago> I don't feel confident saying “this code does exactly what I want and nothing else”, because someone might enable an extension I haven't accounted for If you have any examples of code that, when an extension is enabled, neither fails to compile nor fails to behave in the same way it would be really interested to see them! If I were to try to conjure some up the first place I would start would be interactions between scoped type variables and typeclasses.