HN Theater @HNTheaterMonth

The best talks and videos of Hacker News.

Hacker News Comments on
Kevlin Henney - Seven Ineffective Coding Habits of Many Programmers

NDC Conferences · Vimeo · 5 HN points · 1 HN comments
HN Theater has aggregated all Hacker News stories and comments that mention NDC Conferences's video "Kevlin Henney - Seven Ineffective Coding Habits of Many Programmers".
Vimeo Summary
Habits help you manage the complexity of code. You apply existing skill and knowledge automatically to the detail while focusing on the bigger picture. But because you acquire habits largely by imitation, and rarely question them, how do you know your habits are effective? Many of the habits that programmers have for naming, formatting, commenting and unit testing do not stand up as rational and practical on closer inspection.
This talk examines seven coding habits that are not as effective as programmers believe, and suggests alternatives.
HN Theater Rankings

Hacker News Stories and Comments

All the comments and stories posted to Hacker News that reference this video.
Oct 15, 2018 · jpfed on Alternative code styles
Kevlin Henney gave a talk ( https://vimeo.com/97329157 ) that included an interesting idea for style:

Imagine every non-whitespace character in your code were replaced with garbage. Indent so that the reader could still understand the structure of your code.

Jun 11, 2014 · 5 points, 1 comments · submitted by sidcool
collyw
I find the "no/less comments" always seems to come from Java programmers. In Perl / Python you can easily do the equivalent of a screen full of Java code in a couple of lines. In these cases I think it is helpful to comment liberally and explain what a list comprehension, or map is doing.

Comments adding signal to noise? I agreed with him on that point, but thinking back, I find the most useful time to have comments is when looking at someone elses unspecced code for the first time.

    # open file 
    file = open('filename' 'rw))

    # seek to bit 8
    file.seek(8)
This is pretty close to a real world example I had to fix.

Now The comments should have explained what we expect to see in the file. What happens at byte 8? I still have no clue, and fixing the bug in that code took me nearer to a week than the day it should have done.

HN Theater is an independent project and is not operated by Y Combinator or any of the video hosting platforms linked to on this site.
~ yaj@
;laksdfhjdhksalkfj more things
yahnd.com ~ Privacy Policy ~
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.