• 0 Posts
  • 42 Comments
Joined 3 years ago
cake
Cake day: June 16th, 2023

help-circle
  • I had a boss who wrote a script to automatically remove all comments from code for pull requests. Since nobody ever added meaningful comments to their commits (or made any contributions at all to the alleged documentation), the code base was a complete mystery to the people who were actually working on it. God knows what it seemed like to new developers added to the project. But hey, comments are a “code smell” (his exact words) so it was all good.

    His primary justification of his “comments bad” philosophy was that if comments aren’t kept up-to-date with the code, they can mislead and confuse future developers. This gets said a lot but it is something that I have literally never seen in 25 years of programming (I’ve witnessed – and participated in – a large number of project failures, and misleading comments have never been the cause of the failure). I pointed out that the same exact thing could be said about method and variable names but nobody ever advocates not using descriptive method and variable names; he had no response to this.






  • I’m currently reviving a personal iOS project that I last worked on almost 10 years ago. At the time, I was working under a (much younger) tech lead who was a firm advocate of the “all comments are bad” philosophy and reported me to management as being technically incompetent because I commented my code. Thank god I’m technically incompetent because there’s no fucking way I could be making any sense of my 10-year-old code without those comments.

    Somebody here is probably going to reply that nobody literally thinks all comments are bad, but I assure that you such people do exist in this profession.










  • FWIW I used to hang out with behavioral psychology grad students, who were in the Skinnerian tradition of operant conditioning research. They mostly worked with pigeons, and to transport the birds they used juice pitchers with a few air holes cut into the bottom. I asked them once how they got the birds into the pitchers and they laughed and showed me: they would just open the bird’s cage and hold the pitcher up and the birds would dive head-first into the pitcher, sometimes knocking themselves out in the process.

    As part of the research protocol, the birds were kept on a diet that included about 80% of their normal caloric intake; the rest of their food was provided by the reinforcements of the experiments themselves (this was done to maximize the reinforcement effect of the rewards). So those birds were way the fuck into those experiments. To add to that, these students were all behavioral pharmacologists, so in addition to getting food reinforcement the birds were also getting drugs like cocaine and heroin.

    BTW a lot of people confuse the operant conditioning research with the people who put animals into cages and shock them. This is definitely not what BF Skinner was all about. In fact he wrote books on the subject of how punishment is a bad thing for all animals (including humans and pigeons).





  • I wrote mobile apps for Blackberry back in the day. As part of their security fixation, all library modules you incorporated had to be signed as your app was compiling, even if you were just testing out a single line change. This could make your app take upwards of a whole hour to sign, if the signing servers were even up and running at all; they were often down completely which meant I could go home and get high instead of working. Which is why I never badmouthed Blackberry to my bosses.

    The absurdity of having every module signed meant that I had to think long and hard about whether I wanted to use built-in library functionality or just roll my own code. For one UI I needed to use trigonometry functions. These were located (logically or not) in one of the encryption modules which were especially prone to taking a long time to sign, so I ended up writing my own sin()function (in Java) just to save myself ten minutes of compilation time.


  • One under-appreciated aspect of leaf design is that in addition to being able to spread out and absorb sunlight, they also need to be of a shape such that in a strong wind they tend to curl up on themselves and provide a minimum of wind resistance. Otherwise their collective sail effect would tend to uproot the tree. Fortunately, there are lots of beautiful ways to solve these related problems.