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 ๐คธ๐ปโโ๏ธ
Social engineering and internet friends