Ask HN: What is the most enlightening concept that changed how you program?
11–20 of 33 posts
Re: Ask HN: What is the most enlightening concept that changed how you program?
#12The gist of it: you program procedurally without thinking too much about the code and only add "compressions" when the need for them arises. The compressions can take various forms like encapsulating data types within objects, behaviour within functions, extracting often-repeated operations into separate libraries and then loading and referencing them when needed, etc.
Re: Ask HN: What is the most enlightening concept that changed how you program?
#13YAGNI and WET - You Ain't Gonna Need It and Write Everything Twice - Copied code leads to simple bugs; premature abstraction leads to heartbreak.
> premature abstraction leads to heartbreak Could you please elaborate on that? I'm not sure to understand.
Re: Ask HN: What is the most enlightening concept that changed how you program?
#14Re: Ask HN: What is the most enlightening concept that changed how you program?
#15Normalised tables.
Re: Ask HN: What is the most enlightening concept that changed how you program?
#16Re: Ask HN: What is the most enlightening concept that changed how you program?
#17YAGNI and WET - You Ain't Gonna Need It and Write Everything Twice - Copied code leads to simple bugs; premature abstraction leads to heartbreak.
> premature abstraction leads to heartbreak Could you please elaborate on that? I'm not sure to understand.
Start out to broad and wind up wasting resources that could be put to better use.
Start out to narrow focus without knowing where need/$$ to keep going is and wind up wasting resources. Idealy, the narrower focus permits getting to the 'wasting resources' point faster.
Hiding the details via abstraction when details are still in development/need to be viewable & readily available defeats the purpose of abstraction making things simpiler/easier.
Re: Ask HN: What is the most enlightening concept that changed how you program?
#18the most mind blowing concept was realizing everything I have learned during my 10+ years of coding will be rendered obsolete by an AI in next 2 years :)
Re: Ask HN: What is the most enlightening concept that changed how you program?
#19This is a profound insight. It totally changed how I think about the nature of multithreaded and multiprocessor based programming.
Also from Kevlin - Refactoring to immutability[2], which showed me exactly why you would want immutable "variables"
Re: Ask HN: What is the most enlightening concept that changed how you program?
#20Thinking of the stupidest way we can get it done and then ruthlessly refactoring until the resulting algorithm / system is as simple as possible.
Edit: point 1 comes from A Philosophy of Software Design. One of my fave programming books of all time.