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
Compression-oriented programming [1]. It is not something that "totally changed the way I approach programming", 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 "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.<p>[1]: <a href="https://caseymuratori.com/blog_0015" rel="nofollow noreferrer">https://caseymuratori.com/blog_0015</a>
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/benefit of typechecks.<p>What do I actually do? Boring imperative python3.<p>I wish I'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->Pascal door.<p>If I'd turned left, I would have entered the other cohort who started with LISP.
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.
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 / 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.
Kevlin Henney - "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"[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 "variables"<p>[1] <a href="https://www.youtube.com/watch?v=Hi6ICEVVRiw">https://www.youtube.com/watch?v=Hi6ICEVVRiw</a><p>[2] <a href="https://www.youtube.com/watch?v=APUCMSPiNh4">https://www.youtube.com/watch?v=APUCMSPiNh4</a>
Foregoing perfectionism, elitism, and fashion in favor of code that Just Works. Functional is nice, concurrent is a nice, sometimes necessary transformation, "compression-oriented" sounds cringe and complicated-pilled (but I'm sure it's nice). But I'm not here for nice things, I'm here for profitable things, and profitable things need to Just Work. They don'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/watching: Jonathan Blow.
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
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.
I'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, "To understand recursion, you have to first understand recursion" :-).
We had moved to fully typed python using mypy and ruff and using framework that highly benefit from it <a href="https://litestar.dev" rel="nofollow noreferrer">https://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's totally worth it.
Avoid deep nesting by testing error case first and exiting/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
Dependency injection & 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
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 :)