Hi nerds -
I salute you from sunny Madrid, where everyone keeps talking about their upcoming vacation plans.
Today I'll do things a lil bit different and share with you some of my insights combining coding and mindfulness. Let me know what you think. π©π»βπ»
β
3 brain farts
π΅π» Legacy code: Legacy code is old code that contains no tests and quickly grows impossible to understand. It's a disease to a large codebase because it compounds in complexity and makes the entire application harder to maintain and scale.
If left unsupervised, it grows so large, organizations crash because the cost of rebuilding the software is too big and the speed to produce new features becomes too slow.
Our personal legacy code are those assumptions and building blocks we live by, which we don't test and no longer understand. It's the lil rules we follow and take for granted; the habits that no longer serve our path; the "emotional baggage" we carry everyday.
If left unsupervised, it piles up, increasing the cost of self-awareness and building an identity that is harder to maintain and scale.
β
π Binary Search: Our brains donβt have a storage problem, they have a retrieval problem. Everything weβve ever experienced, thought, or said exists somewhere within our mind, but finding it is often the harder part.
A similar thing happens in Computer Science, where databases grow so large, finding relevant information efficiently becomes complex and time-consuming.
One of the most performant algorithms we have to find information is binary search. It works as follows:
- The data pool must be sorted using some sort of logic. For ex, you can arrange your experiences by date, by feeling (happiest to saddest), alphabetically, etc.
- Once you have the information sorted, you split the list in two and ask yourself: βon which half would the information Iβm looking for be?β If youβre looking for Bobβs number, for example, youβll know itβll be on the first half of the alphabet-sorted list because it starts with a βBβ.
- Then, repeat this process splitting your data in half until you find the information youβre looking for.
This is super powerful because it means weβre cutting our possibilities by half as we traverse through the list, rather than exponentially increasing the number of operations we have to run.
-- For your reference, binary search is O(log n). O(i), meaning constant time, is the best, while Big O notation is the worst.
β
π Naming conventions: When naming variables or functions, developers may feel tempted to use short names like βaβ or βxβ.
In theory, the code will work the same, but next time we want to build a new feature on top of it, developers will have a harder time understanding what the code is meant to do, ergo a harder time providing a good solution.
A similar thing happens with our emotions. When describing thoughts and feelings, we often use words like βhappyβ or βangryβ. However, we can usually do better.
Naming feelings is key to emotional intelligence and self-awareness because we handle situations better when we understand exactly what they are. Hereβs a cool cheat sheet on naming emotions.
β
--- π If you want to learn more about writing clean code, I wrote an article about the topic here.
β
2 intellectual goodies
"There are two methods in software design:
1) One is to make the program so simple, there are obviously no errors.
2) The other is to make it so complicated, there are no obvious errors."
~ Tony Hoare
β
"It's hardware that makes a machine fast. It's software that makes a fast machine slow."
~ Craig Bruce
β
1 funky audio
βThis song is for the saxophone lovers. You know who you are. π·
β
Thanks for reading.
As always, feel free to connect by hitting reply and sharing a juicy thought π‘.
We all help the curious community grow.
β
Best,
Jules π€Έπ»ββοΈ