TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: What is the most enlightening concept that changed how you program?

23 pointsby newsoulalmost 2 years ago
Assuming that you are still learning and you learn from new experiences or concepts, what was the most mind blowing concept you learnt that totally changed how you approached programming problems?<p>Edit: Provide pointers to where others can learn about those concepts

18 comments

kkonceviciusalmost 2 years ago
Compression-oriented programming [1]. It is not something that &quot;totally changed the way I approach programming&quot;, but more like something I was doing intuitively and reading about it made a lot of sense and provided a framework for why it is appealing. Also, keep in mind that I am not a real programmer in a sense that I mostly write scripts for data analysis.<p>The gist of it: you program procedurally without thinking too much about the code and only add &quot;compressions&quot; 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.<p>[1]: <a href="https:&#x2F;&#x2F;caseymuratori.com&#x2F;blog_0015" rel="nofollow noreferrer">https:&#x2F;&#x2F;caseymuratori.com&#x2F;blog_0015</a>
ggmalmost 2 years ago
Lambda calculus. Applied functions and recursion. Everything else is syntactic sugar on imperative do.. lists.<p>Typed arguments as strong pre requirements to intent, and the cost&#x2F;benefit of typechecks.<p>What do I actually do? Boring imperative python3.<p>I wish I&#x27;d learned LISP as my first language. It was literally a left door right door choice to do Fortran on cards, and then Pascal. Two people teaching the induction classes. I went through the Fortran-&gt;Pascal door.<p>If I&#x27;d turned left, I would have entered the other cohort who started with LISP.
mejutocoalmost 2 years ago
Defining data structures first and then the rest of the program as operations between those data structures. If possible using types, and keeping as much as possible pure (no side-effects). Makes it easier to reason about, and to check for correctness.
extasiaalmost 2 years ago
Minimising complexity by reducing the number of paths (branches, nested loops etc.) through your code.<p>Thinking of the stupidest way we can get it done and then ruthlessly refactoring until the resulting algorithm &#x2F; system is as simple as possible.<p>Edit: point 1 comes from A Philosophy of Software Design. One of my fave programming books of all time.
mikewarotalmost 2 years ago
Kevlin Henney - &quot;when you introduce concurrency into a non-concurrent environment what you do is you change the laws of physics of your program, you change the nature of time&quot;[1]<p>This is a profound insight. It totally changed how I think about the nature of multithreaded and multiprocessor based programming.<p>Also from Kevlin - Refactoring to immutability[2], which showed me exactly why you would want immutable &quot;variables&quot;<p>[1] <a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=Hi6ICEVVRiw">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=Hi6ICEVVRiw</a><p>[2] <a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=APUCMSPiNh4">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=APUCMSPiNh4</a>
VoodooJuJualmost 2 years ago
Foregoing perfectionism, elitism, and fashion in favor of code that Just Works. Functional is nice, concurrent is a nice, sometimes necessary transformation, &quot;compression-oriented&quot; sounds cringe and complicated-pilled (but I&#x27;m sure it&#x27;s nice). But I&#x27;m not here for nice things, I&#x27;m here for profitable things, and profitable things need to Just Work. They don&#x27;t need to be functional, or algorithmically perfect, or nerdically sound.<p>Procedural is fine and simple and it works. You can refactor later if you have the time and money.<p>Related listening&#x2F;watching: Jonathan Blow.
评论 #36456372 未加载
joshxyzalmost 2 years ago
1. type safety from typescript avoids lots of bugs before running my code<p>2. linters like eslint forces best practices and readability in my code<p>3. security is learnable from online sources like latacora blog and owasp cheatsheets<p>4. reading latest docs and github issues helps a lot in debugging.<p>5. reading readme file and getting started guides is more reliable than watching video tutorials.<p>6. videos however are good at getting comparisons and seeig presentations of ideal use cases of particular tool software or database or framework
elamjealmost 2 years ago
Functional programming. Clojure changed how I write C#, Python, and think about storing data.<p>I now think much more about immutable, append-only data stores as a result.
crooalmost 2 years ago
Functional programming - I realised that state is one of the greatest enemy and that it is possible to write programs without it.
rganesanalmost 2 years ago
I&#x27;m a grumpy old programmer now but one of the early enlightening concepts I learnt was recursion and how it applied to so many problems. As the saying goes, &quot;To understand recursion, you have to first understand recursion&quot; :-).
idontwantthisalmost 2 years ago
YAGNI and WET - You Ain&#x27;t Gonna Need It and Write Everything Twice - Copied code leads to simple bugs; premature abstraction leads to heartbreak.
评论 #36455760 未加载
评论 #36444091 未加载
v3ss0nalmost 2 years ago
We had moved to fully typed python using mypy and ruff and using framework that highly benefit from it <a href="https:&#x2F;&#x2F;litestar.dev" rel="nofollow noreferrer">https:&#x2F;&#x2F;litestar.dev</a> . It greatly improved our code quality , our understanding of python and how python work . At first it is tedious and felt over engineering but it&#x27;s totally worth it.
TheLoafOfBreadalmost 2 years ago
Using state machines as enum + switch. Massive simplification for protocol based things and solving edge cases during communication.
hamdounialmost 2 years ago
Avoid deep nesting by testing error case first and exiting&#x2F;returning immediately.<p>Instead of :<p><pre><code> If foo then bar Else baz Endif </code></pre> Now I write:<p><pre><code> If foo then bar return Endif baz </code></pre> Exit early makes the code easier to read and understand
评论 #36468949 未加载
gitgudalmost 2 years ago
Dependency injection &amp; Inversion of control.<p>Technically 2 concepts but they’re highly related.<p>Basically, allow the consumer of a component to pass in something, rather than the component needing to contain that logic.<p>It’s great for front end systems, but also apples to backend and general systems programming… an invaluable concept
revskillalmost 2 years ago
Category theory.<p>Basically, it boils down to this: F(A . B) = F(A) + F(B)<p>(F,A,B, ., +) could be anything which you found suitable.
zhte415almost 2 years ago
Normalised tables.
评论 #36445996 未加载
iExploderalmost 2 years ago
the 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 :)
评论 #36449896 未加载