Book Review: The Programmer's Brain
shkspr.mobi
shkspr.mobi
Quotes like this always make me nervous about trusting a book, because these sorts of studies tend to be pretty difficult to replicate, or have very small effect sizes, or just be examples of poor research. Yet I see a lot of people use these sorts of studies to back up their opinions about what code should look like without really acknowledging how difficult it is to test these sorts of comparisons. As others in the comments here have pointed out, there are other studies that seem to say the complete opposite to the one quoted here, and I strongly suspect that there are far more important measures of readability, the effects of which would completely dwarf any discussion about case.
And I think at the heart of it too is when you interrogate certain topics too much the answer will often boil down to "We don't know" and that's something that's really hard for people to grapple with if they're not used to admitting it.
There's plenty of alternatives. "Fake-science, Barnum-science, garbage-science, non-science, nonscience, TED-talk..." It's fertile ground to go all poetic too.
This is binary thinking, language is more flexible than this.
What's more, bro-science isn't purely pejorative, it's /descriptive/ of something that is happening as we speak on bodybuilding forums.
Afaik the term was invented by 'bros' for 'bros' as a way to caution against being too credulous when folks were discussing their personal training regime, supplement 'stack' or what have you with steroids and testosterone.
The closest term for it here in this forum would be 'trading anecdata' or 'Why we chose X to build Z-corp'.
For obvious reasons, they organically settled on 'bro-science' and it's fine for it to be that way.
Programmers often do the the same thing (replace 'supplement stack' with 'tech stack'), and for much the same reason as the gym 'bros', good data is hard to come by, but you need to muddle on and choose /something/.
> What's more, wives-tales isn't purely pejorative, it's /descriptive/ of something that is happening as we speak among married women.
Gentlemen who do body building, ladies who are married are not being described here. Choosing something better from the multitude of possibilities is hardly a blow for freedom, liberty and justice. The sun is gonna rise tomorrow. I can't see any reason not to do it and think it worthwhile if only to exercise our minds as to following principle. YMMV.
For example the term "wives-tales" isn't just about gender. It brings forth to mind ideas that are incorrect and passed down through generations as correct knowledge. The full phrase is generally used as "old wives tale"
The reason I used "bro-science" instead of a term like "pseudoscience" (or the other alternatives you mentioned) is because it came to mind first as it fits the nuance I'm going for. Which that nuance is not "Gentlemen who do body building." (As if only "gentlemen" do body building, ironically half of the body-builders I know are women). The nuance, if you're familiar with the term, is that it brings to mind something like "regular people who share opinions as if they're facts when they're actually opinions" (and they might be facts, but it's unknown). Or additionally it also brings in another nuanced meaning which is "an opinion that is shared by someone who expresses it strongly and reacts negatively if you question it"
Your alternatives may share some of this, but not in the same way. If you want to invent a new-term and get it into the lexicon I'd be happy to use it.
I can't help you, sorry. I wonder what we did for all those centuries before "bro-science" was coined and heard by some of us here for the first time. I expect wives-tales was popular for some of it.
That is precisely the main reason I got rid of my copy of Steve McConnell's "Code Complete".
I prefer camel case but I am very skeptical about snake case being so much different. Anyway, that's really another type of thing from advice about making small tweaks versus comprehensive models (for example.).
I tried to apply this to my last attempt at doing the advent of code. I tracked every error I made with every solution. It was interesting because a few days in I would think, "I don't want to do this because it leads to this bug".
If I were really meta, I would go back and analyze it.
Then there's the feeling you get after you have done a dozen of fixes to your code and none of them fixed the problem which got you started until you realize that you were debugging the wrong file. There was so much room for improvement.
I can only expend so much energy learning a problem domain so many times a day, sometimes, using instinct and learned heuristics to find a fix without building a mental model of the wider picture is good enough.
I should also add it depends greatly on your codebase. Some code bases are so rotten your heuristics won't work but if you have clean abstractions or even just code that generally limits the amount of weird and unexpected shit it does you should be fine brute forcing a few things saving brain power for later in the day.
This problem can be solved by increasing compile time.
But that sort of dumb deployment thing is what gets me when I am tired, more often than something really complicated.
I eventually realized I was running into a bug in my build environment. It wasn’t detecting the library had any code changes so it was “optimizing” my build by skipping that library. It was one of a dozen or so dependencies so it wasn’t immediately obvious. Eventually, I set a breakpoint somewhere else in the library code and realized it wasn’t being hit because the source code didn’t match the symbols!
I felt pretty dumb once so figured this out even though rationally I know it wasn’t my fault.
Doesn't work with clients who aren't quite sure what their own requirements are, of course. Then it's more of a few days at most, so revisions can be done early.
If I'm interfacing with a library that I'm not familiar with, I'll usually do trial and error in a blank project, separate from the actual project, first. Then write cleanly in the real project. Iteration times on the learning process are faster that way.
Sometimes I'll just write long drafts or snippets in notepad at first, just to stay clear of IDE distractions. It's a fast way of figuring out the structure of things without the need for everything to compile at all times.
My code is targeted to experienced functional programmers, and others of the same skill level seem to have no trouble with it, but the less experienced will bounce off it. My thinking is that those people should get more experience and come back instead of optimizing my codebase to a lower common denominator for ease of hiring. This has made hiring difficult as anyone who can work on my code base can probably get a high paying job at a FANG. But as a solo dev the productivity gain is enough that I still have no trouble competing in my niche.
[1] https://www.felienne.com/archives/2974
[2] https://www.microsoft.com/en-us/research/blog/lambda-the-ult...
I highly recommend it.
[0]: https://www.amazon.com/Pragmatic-Thinking-Learning-Refactor-...
Identifying these 'feelings' is what turned my productivity around.
There's a lot you can do at work that makes you feel productive - fiddling with LaTeX, answering emails, scheduling meetings - but that are not productive at all.
It takes a bit of introspection and pain to realise that I wasted my day doing nonsense, in the worst case with emails I am creating work for others while wasting my own time.
Realising when you're being fake-productive is a great skill to have.
I turned off intellisense in vscode and just practiced writing by copying open source code side by side.
As a polyglot developer it feels a little weird but it can't be helped. The mix of camel cased and snaked cases languages in the same project or in the same file is inevitable sometimes. Think a JS script tag and Ruby <% %> inline code in an html.erb file.
http://ieeexplore.ieee.org/xpl/articleDetails.jsp?reload=tru...
so in this study, where the subjects were trained in snake_case, they found snake_case was better.
and in the other study, where the subjects were trained in camelCase, they found camelCase was better.
I bet if we did another study of programmers who used kebab-case they'd find that kebab-case is better.
I don't think there's any reason to believe any particular case style is better than any other. personally I like snake_case and kebab-case because I find the word boundaries easier to recognize, but that's just a preference on my part. I have no idea if it's objectively better.
I prefer snake_case and believe it probably is mildly more readable than camelCase.
The underscore comes closer to space-delimited words like we use in English, typographically speaking. It's hard for me not to think that must be easier to read that way.
Obviously I can't prove it's better, but it both makes sense to me that it would be and fits with my subjective experience.
Code will be read more than it will be written, so it should be optimized for the reader.
I vote for kebab-case, but I didn't find any study where it was included...
But I'm eager to find counter examples.
> Results indicate that camel casing leads to higher accuracy among all subjects regardless of training, and those trained in camel casing are able to recognize identifiers in the camel case style faster than identifiers in the underscore style.
What does it mean:
> those trained in camel casing are able to recognize identifiers in the camel case style faster than identifiers in the underscore style.
It is not normal if you train in reading something => you are good in recognizing that things that you are trained than something else than you did not train for?
If anyone has access to the study, how many among 135 are programmers that were trained in camel case and how many in snake case?
Seems like it should be shift+space inserts a variable-split-token and different editors can display it as a - _ or caps of the next character as desired. Like tab characters being configurable as a number of spaces.
"We found a statically significant association with cars that drive well and have their wheels properly fitted."