Jekyll2023-11-14T15:21:55+00:00https://hadalin.me/feed.xmlPrimož HadalinPrimož Hadalin's homepageQuotes by Martin Fowler2023-11-14T00:00:00+00:002023-11-14T00:00:00+00:00https://hadalin.me/essays/quotes-by-martin-fowler<p>Martin Fowler is the author of <a href="https://martinfowler.com/books/refactoring.html">Refactoring</a>. I like this book because Martin is good with words. Here are some of my favorite quotes of his.</p>
<blockquote>
<p>Whenever I have to think to understand what the code is doing, I ask myself if I can refactor the code to make that understanding more immediately apparent.</p>
</blockquote>
<blockquote>
<p>If you can get today’s work done today, but you do it in such a way that you can’t possibly get tomorrow’s work done tomorrow, then you lose.</p>
</blockquote>
<blockquote>
<p>When you find you have to add a feature to a program, and the program’s code is not structured in a convenient way to add the feature, first refactor the program to make it easy to add the feature, then add the feature.</p>
</blockquote>
<blockquote>
<p>Other than when you are very close to a deadline, however, you should not put off refactoring because you haven’t got time. Experience with several projects has shown that a bout of refactoring results in increased productivity. Not having enough time usually is a sign that you need to do some refactoring.</p>
</blockquote>
<blockquote>
<p>In almost all cases, I’m opposed to setting aside time for refactoring. In my view refactoring is not an activity you set aside time to do. Refactoring is something you do all the time in little bursts.</p>
</blockquote>
<blockquote>
<p>A statement Kent Beck often makes about himself, “I’m not a great programmer; I’m just a good programmer with great habits”.</p>
</blockquote>Martin Fowler is the author of Refactoring. I like this book because Martin is good with words. Here are some of my favorite quotes of his.A letter to a junior developer2023-03-12T00:00:00+00:002023-03-12T00:00:00+00:00https://hadalin.me/essays/a-letter-to-a-junior-developer<p>First, congratulations and welcome. You’re in for a fun ride. Many opportunities to explore your potential are waiting for you. Yes, there are terrible bosses in this domain too, but the demand for competent programmers is high enough for you to pick and choose.</p>
<p>Your first job will unlikely be joining your dream company, but you must start somewhere. Whatever your first job, be a sponge, listen more, talk less, and don’t outshine your coworkers. You’re there to reach a common goal, not to gain praise. If you do things right, the praise will be a side effect.</p>
<p>If you’re fresh out of college, know that computer science differs from software engineering. I recommend two books to advance your software engineering craft — <a href="https://www.amazon.com/Pragmatic-Programmer-Journeyman-Master/dp/020161622X">The Pragmatic Programmer</a> and <a href="https://www.amazon.com/Refactoring-Improving-Existing-Addison-Wesley-Signature/dp/0134757599/">Refactoring</a>.</p>
<p>Find something that will be challenging but not too challenging. You should know what value you bring and your realistic hourly rate. When you reach a point where you feel your compensation doesn’t match your abilities, ask for a raise or switch companies. No point in staying somewhere you don’t like. You’ll start to feel resentful, which is not good for you or the company.</p>
<p>The job interview is not a formality. It’s a two-way negotiation, so only settle on things you’re ok with. Being too indulgent is not a virtue. How can you defend the company’s interests if you cannot defend yourself? Recommended reading — <a href="https://www.kalzumeus.com/2012/01/23/salary-negotiation/">Salary Negotiation</a> and <a href="https://github.com/viraptor/reverse-interview">a list of questions to ask on a job interview</a>.</p>
<p>Try connecting with a local developers’ community. Python, JavaScript, etc., meetups are employment fairs, basically.</p>
<p>Almost every company is looking for great people, even if they’re not actively hiring. Reach out; you have nothing to lose. As most people do, don’t write a generic cover letter with your CV attached. Put some effort into it. Visit their website, and get familiar with what they do, what problems they’re trying to solve, their goals, and how you will help achieve them. Rather than saying what they can do for you, say what you can do for them. Give reasonable justifications for what a waste it would be for them not to have you.</p>
<p>Think of yourself as not a software developer but a problem solver. When you reach a certain level of expertise, your responsibilities include mentoring, interviewing job candidates, planning, designing APIs, researching technologies that fit requirements, and many more. Thinking of yourself as a problem solver, you can fit any role.</p>
<p>Asking stupid questions is ok. Nobody expects you to be perfect. We all screw up. If you make a mistake, say you made a mistake, what you learned, and how you will fix it. People don’t get fired for making mistakes; they get fired for making mistakes and being quiet about them.</p>
<p>Be bold and ask questions, but don’t go the easy route by outsourcing the thinking part to your teammates. If you get stuck (which you will), isolate the problem, describe it, what you tried, the possible reasons, and potential solutions in as few words as possible while still being understandable. Own your mistakes.</p>
<p>There’s going to be a lot of communication. A lot. Learn how to write. If you’re able to write well, you’re able to think well. Also, know that not all people communicate the same. Some people prefer to be direct, while others don’t mind you asking them how their day is. <a href="https://nohello.net">Oh, and don’t just say “hello” when contacting someone and then putting them on hold</a>.</p>
<p>Having the title of senior developer means nothing. Nobody believes you’re a senior developer just by having “senior” written in the title of your LinkedIn profile. You’ll have to prove it at each interview.</p>
<p>Usually, for junior developers, a senior developer is someone coding for, say, five years. Time is a factor but not the only one. Senior developer has excellent technical skills, owns their shit, adds to the conversation when they have something meaningful to say, is not afraid to challenge ideas, is aware of how their part fits into the big picture, knows there are mundane tasks to do as well, and thinks about improving things beyond their scope of work. If you have these qualities, you won’t have to ask for more responsibilities; responsibilities will come to you.</p>
<p>Best of luck! 💪</p>First, congratulations and welcome. You’re in for a fun ride. Many opportunities to explore your potential are waiting for you. Yes, there are terrible bosses in this domain too, but the demand for competent programmers is high enough for you to pick and choose.One-liner &num;12023-01-28T00:00:00+00:002023-01-28T00:00:00+00:00https://hadalin.me/essays/one-liner-1<p>Your code is so ugly it could be a private key.</p>Your code is so ugly it could be a private key.The present moment is not enough2021-11-14T00:00:00+00:002021-11-14T00:00:00+00:00https://hadalin.me/essays/the-present-moment-is-not-enough<p>Or where Eckhart Tolle’s teachings (and mindfulness) fall short. This essay is a follow-up to <a href="/essays/cure-for-imposter-syndrome">Cure for Imposter Syndrome</a>.</p>
<p>I’ll be forever grateful for Eckhart Tolle’s <a href="https://www.amazon.com/dp/1577314808">The Power of Now</a> and <a href="https://www.amazon.com/dp/B002RI97IY/">New Earth</a>. It put me on an intense journey inward—a journey into knowing and understanding my complicated, imperfect, and messy self.</p>
<p>The main takeaway was, roughly speaking, that you are not your thoughts, meaning thoughts are just thoughts—you don’t have to take them at face value. Taking them too seriously can harm your mental health, given that our thoughts (particularly negative thoughts) are often distorted. Having said that, I still think it’s wise to visit a doctor if prolonged negative thoughts impact your daily life. I also learned that the outcome of increased self-awareness is having a greater distance between thinking and acting. You become less impulsive, which has many benefits in itself, e.g., not snapping immediately when you disagree with someone or exploring more options before providing an argument.</p>
<p>The second takeaway was that the present moment is where you want to spend most of your time. It’s where things happen, and it’s where experience comes into being. Spending too much time in the past or the future robs you of experiencing what is right in front of you, which is something beautiful for the most part.</p>
<p>These ideas are not new. They’ve been around for thousands of years, but Eckhart’s way of presenting them is pretty powerful.</p>
<p>BUT.</p>
<p>Imagine watching Star Wars, and all that ever happens is Luke Skywalker enjoying the present moment. It wouldn’t be that interesting, would it? I’m not saying that Eckhart suggests being idle your whole life, but something is missing. He doesn’t provide guidance on orienting yourself toward something meaningful. The present moment without context has no meaning. Yes, even if you’re out in the woods admiring nature doing “nothing”. It’s not nothing; it’s something.</p>
<p>People have free will (or so most of us believe), and we act in a manner that will put us a step closer to our goals. Thinking about the future is essential. We need to know where we are, where we want to be, and how we’re going to get there. It’s all about the journey, as they say.</p>
<p>If you’ve read the books mentioned above, you’ll probably agree that <em>thinking</em> has a bit of a bad rap in Eckhart’s eyes. According to him, thinking equals ego doing its thing, and everything that ego does is for its own selfish purposes. There is truth in this. People not yet “awakened”, i.e., people so entangled in their learned way of thinking that they can’t fathom doing anything wrong, are prone to stumbling into the same set of problems again and again. Such <em>thinking</em> leads to frustration and general dissatisfaction with one’s own life.</p>
<p>BUT.</p>
<p>Thinking does not necessarily mean identifying with some part of your flawed self. If you’re going to plan for the future, you need to think. If you want to get Eckhart’s teachings, you need to think. I think (pun intended) that labeling your cognitive ability as being nothing but ego is not healthy. Of course, there are moments when thoughts get in the way, like when listening to a concert, admiring a piece of art, or when trying to fall asleep, but rejecting thoughts to the level Eckhart suggests is a bit much IMHO.</p>
<p>If you enjoyed Eckhart’s books—good, but consider enhancing your studies in philosophy, theology, psychology, and where these intersect. Here are some book recommendations:</p>
<ul>
<li><a href="https://www.amazon.com/dp/1587316501/">The Platonic Tradition</a></li>
<li><a href="https://www.amazon.com/dp/0374528373/">The Brothers Karamazov</a></li>
<li><a href="https://www.amazon.com/dp/B002BD2UR0/">Mere Christianity</a></li>
<li><a href="https://www.amazon.com/dp/B07K6S9SJ8/">Maps of Meaning: The Architecture of Belief</a></li>
<li><a href="https://www.amazon.com/dp/B009U9S6FI">Man’s Search for Meaning</a></li>
<li><a href="https://www.amazon.com/dp/0062506064">King, Warrior, Magician, Lover: Rediscovering the Archetypes of the Mature Masculine</a></li>
<li><a href="https://www.amazon.com/dp/B07S33YGJZ">Slaying Your Fear: A guide for people who grapple with insecurity</a></li>
<li><a href="https://www.amazon.com/dp/0140280197">The 48 Laws of Power</a></li>
</ul>
<p>Have a nice day!</p>Or where Eckhart Tolle’s teachings (and mindfulness) fall short. This essay is a follow-up to Cure for Imposter Syndrome.Cure for imposter syndrome2021-01-07T00:00:00+00:002021-01-07T00:00:00+00:00https://hadalin.me/essays/cure-for-imposter-syndrome<p>Most likely, it’s only you who thinks you’re not good enough. Your “operating system” has a bug that raises too many instances of <code>NotGoodEnoughException</code>.</p>
<p>Even if someone else thinks you’re not good enough, it’s probably because they have this bug too. People climb many hierarchies—power, money, popularity, etc., and in doing so, they advertently, but more often than not, inadvertently put other people down to lift themselves. Have this in mind when someone is rude to you.</p>
<p>How to fix this bug? The solution is not that hard, but it requires time + effort. What you have to do is first install the <code><a href="https://duckduckgo.com/?q=eckhart+tolle">mindfulness</a></code>* module. This module interrupts the cognitive module each time NotGoodEnoughException is raised and puts the handling of this exception at the top of the priority queue. In a sense, good mindfulness could be compared to having decent server logs—situational awareness for the self.</p>
<p>If you think the above paragraph is written poorly, your “OS” probably raised NotGoodEnoughException just now ;)</p>
<p>You handle the exception as follows. Get familiar with the <code>/self/v2/mind</code> API endpoint and make a POST request with the following body each time NotGoodEnoughException is raised:</p>
<pre>
{
"youAreEnough": true
}
</pre>
<p>It might take weeks, months, or even years before the number of exceptions starts to drop, but it <em>does</em> drop. The reason this works is that it’s the real you, the one who experiences pain, joy, and life, the one above thoughts, emotions, and sensations, who decides to “program” your “kernel”. The key is within you.</p>
<p>To supercharge, consider running <code>install patience –save-dev</code> and opening an issue at the <code>friend/talk</code> repository.</p>
<p>Take care!</p>
<p>Update: This essay has a follow-up post called <a href="/essays/the-present-moment-is-not-enough">The present moment is not enough</a>.</p>
<p class="footnotes">
* Eckhart Tolle, who I referenced, teaches about awareness and presence. He <a href="https://www.youtube.com/watch?v=ZIsl6_SuEYY">does not use the term <em>mindfulness</em></a>, but I used it anyway because it's popular.
</p>Most likely, it’s only you who thinks you’re not good enough. Your “operating system” has a bug that raises too many instances of NotGoodEnoughException.I quit social media and now I want a cigarette2019-09-24T00:00:00+00:002019-09-24T00:00:00+00:00https://hadalin.me/essays/i-quit-social-media-and-now-i-want-a-cigarette<p>Social media is like smoking. It takes a while to get addicted. You do it because everyone is doing it.
It gives you a dopamine kick and pretty soon you develop a habit. Once you quit, you’re relieved,
but you also miss it when you’re sitting on a toilet.</p>
<p>Nine months ago I deleted my Facebook and Twitter accounts. The online suicide had to do with the
bad ratio between time spent scrolling and finding something worth the attention.
For every “good” post I had to consume thirty “bad” ones. 30/1 is just not that good of a ratio.</p>
<p>I also have a problem with populated to-do lists. If there’s a box of cookies next to the computer,
I’ll continue working once the box is empty. Same thing with unread notifications.
I absolutely cannot understand people who have 153 unread notifications. They’re probably
the same people who sleep with a blanket turned the other way around — zipper facing the head.</p>
<p>On top of that, there’s an
<a href="https://coolmaterial.com/media/why-you-should-quit-social-media/">abundance</a>
<a href="https://www.inc.com/quora/14-remarkable-ways-my-life-changed-when-i-quit-soc.html">of</a>
<a href="https://www.pcmag.com/article/331288/how-to-quit-social-media-and-why-you-should">articles</a>
<a href="https://www.thejournal.ie/readme/opinion-life-as-an-analogue-millennial-means-time-to-write-poetry-attend-yoga-and-focus-on-your-real-friends-4679314-Jun2019">urging</a>
<a href="https://www.businessinsider.com/i-quit-social-media-for-one-month-it-changed-my-life-facebook-instagram-snapchat-twitter-millennial-2018-1">people</a>
<a href="https://www.dazeddigital.com/life-culture/article/42859/1/how-to-quit-social-media-in-2019">to</a>
<a href="https://www.thehealthy.com/mental-health/quit-social-media/">quit</a>
<a href="https://medium.com/swlh/why-we-should-quit-social-media-but-definitely-wont-fc93b03ae3ea">social</a>
<a href="https://www.ted.com/talks/cal_newport_why_you_should_quit_social_media/transcript">media</a>,
promising it will improve their lives, and thus I proceeded with the e-harakiri.</p>
<p>Years of giving in to instant gratification showed its face right away.
I continued to routinely grab the phone whenever I passed it by, but since there
were no notifications to clear, I checked my email so much more often.</p>
<p>The urge eventually faded away without any significant improvement on the mental wellbeing front.
It’s not that I was in a bad place mentally, but any bump in that department doesn’t hurt.
<a href="https://youtu.be/FG6HbWw2RF4?t=4702">Teenagers might be more susceptible though</a>.</p>
<p>I upgraded my quest to tranquility by removing work email accounts and Slack from the phone
and revoking it bedroom access. Still, not much of a difference. Maybe it just takes more time, I don’t know.</p>
<p>Articles urging you to quit social media list several benefits.</p>
<p><em>You’ll stop feeling inferior to others.</em> That’s true. I used to mind my own business when riding a train.
Now I judge people for being glued to their phones.</p>
<p><em>Having an abundance of free time on your hands.</em> Not an abundance, but bits and pieces of extra
free time do compound over a longer period. I did manage to spend more time
<a href="https://www.amazon.com/dp/0525561358">reading</a> and building
<a href="https://hackernews-exploded.hadalin.me">side projects</a>.</p>
<p><em>Being happy, motivated and in a good shape.</em> I’ll admit, it does feel great to not use any
product associated with <a href="https://www.youtube.com/watch?v=q2LIXcbDiZA">Mark Zuckerberg</a>.
Whenever there’s news about some data leakage, I smile a little knowing it doesn’t concern me.
<a href="https://duckduckgo.com/?q=facebook+shadow+profile">Or does it</a>? It also feels great sneaking
out of the Twitter “where everything’s refutable and arguments don’t matter” party.</p>
<p><em>You spend more time with your real friends.</em> No, I miss some of my virtual friends and their witty posts.
I also miss staying in touch.</p>
<p>I don’t regret quitting and I don’t regret ever being on it. I would pay a monthly
subscription for an ad-free version of Facebook. The kind that doesn’t
<a href="https://www.nytimes.com/2019/07/17/opinion/google-facebook-sex-websites.html">track what porn you’re watching</a>
and doesn’t run
<a href="https://www.theguardian.com/technology/2014/jul/02/facebook-apologises-psychological-experiments-on-users">psychological experiments on its users</a>.</p>
<p>I kept my LinkedIn account. I keep lying to myself I need it for work. Maybe it’s just
hard to say the <a href="https://www.youtube.com/watch?v=3MMXjunSx80">last goodbye</a>.</p>Social media is like smoking. It takes a while to get addicted. You do it because everyone is doing it. It gives you a dopamine kick and pretty soon you develop a habit. Once you quit, you’re relieved, but you also miss it when you’re sitting on a toilet.Engaging new hires2019-04-09T00:00:00+00:002019-04-09T00:00:00+00:00https://hadalin.me/essays/engaging-new-hires<p>There’s a lot of talk on how to hire people, but we mustn’t lose sight that properly engaging new hires
is just as important. I think I wouldn’t be far-off to describe a new hire’s experience something like this:
Early on, there’s excitement because you’re about to meet new people, learn new things and solve
interesting problems. Every day presents an interesting if not overwhelming set of new
stimuli and challenges. Not long after, however, you realize you’re at the bottom of the food chain,
so to speak. You become one of many, not yet really contributing and yet to prove your competence.
The honeymoon period is all too short. If not properly managed, a new employee’s morale can flag
before she ever hits her stride.</p>
<p>But there’s a hack– and team leads, managers or even the CTO should strive to ensure a quicker
and more consistent phase of fitting in. The trick is to assign the new hire a meaningful task that
gives her a bit of authority over team members, thereby mitigating the “bottom of the food chain” feeling.
An example might be giving them responsibility for the current sprint. Or the opportunity to lead
daily stand-ups and check on the progress of tasks. Nothing serious enough to imperil delivery,
but just enough to make them a significant part of the team right out of the gate.
No doubt they get to learn coworkers’ names more quickly, what each team member is working
on and all the lingo. But above all, such granting of trust helps to make sure the power
dynamics start, and stay, in balance.</p>There’s a lot of talk on how to hire people, but we mustn’t lose sight that properly engaging new hires is just as important. I think I wouldn’t be far-off to describe a new hire’s experience something like this: Early on, there’s excitement because you’re about to meet new people, learn new things and solve interesting problems. Every day presents an interesting if not overwhelming set of new stimuli and challenges. Not long after, however, you realize you’re at the bottom of the food chain, so to speak. You become one of many, not yet really contributing and yet to prove your competence. The honeymoon period is all too short. If not properly managed, a new employee’s morale can flag before she ever hits her stride.Difference between debounce and throttle2017-10-02T00:00:00+00:002017-10-02T00:00:00+00:00https://hadalin.me/essays/difference-between-debounce-and-throttle<p><a href="https://lodash.com/docs/4.17.11#debounce">Debounce</a> is like hitting the snooze button on your alarm clock. You are trying to wake up,
but you’re just not there yet. Debounce is you saying not yet, not yet,
not yet—and this could go on forever. Theoretically you might never wake up.
A real world example might be preventing a chart from being redrawn while the window
is resized by some maniac who has nothing better to do than expand and shrink his
browser incessantly for five minutes.
Only when the activity stops for, say, two seconds will the chart be redrawn.</p>
<p>With <a href="https://lodash.com/docs/4.17.11#throttle">throttling</a>, on the other hand,
something <em>will</em> happen every so often.
Let’s say the maniac above decides to click a button that reloads the chart
over and over again putting a strain on your backend.
With throttle, the data would be fetched from the backend, but only every ten seconds.</p>Debounce is like hitting the snooze button on your alarm clock. You are trying to wake up, but you’re just not there yet. Debounce is you saying not yet, not yet, not yet—and this could go on forever. Theoretically you might never wake up. A real world example might be preventing a chart from being redrawn while the window is resized by some maniac who has nothing better to do than expand and shrink his browser incessantly for five minutes. Only when the activity stops for, say, two seconds will the chart be redrawn.How to become a better programmer2017-09-28T00:00:00+00:002017-09-28T00:00:00+00:00https://hadalin.me/essays/how-to-become-a-better-programmer<p>Primarily you should <em>come up</em> with a solution, rather than <em>search</em> for a solution,
but junior developers tend to do it the other way around or leave the first part altogether.</p>
<p>Copy/pasting from Stack Overflow is just so quick and easy, isn’t it?
You scroll down to the first answer, it has a green check, many upvotes, the code works,
case closed. Do you really think trusting a green check to put something
into your codebase is called software developing? Maybe.
Do you think Linus Torvalds does it this way? Highly doubt it.
As long as the code is working it doesn’t matter where it came from. Or does it?</p>
<p>When you’re using Stack Overflow or code snippets from some blog post,
you’re one or many steps away from the primary source of information,
it being official documentation. How many steps away depends on the code snippet author.
If they used official docs, you’re one step away.
If they used a Stack Overflow answer which used official docs,
you’re two steps away and so on. It’s like playing telephone,
but you don’t know how many people lie in between and how much noise they make.
It’s, therefore, safer to not play this game and start at step 0.</p>
<p>But who wants to open official documentation and read that wall of text.
Well, people who want to get to the bottom of things.
They’ll also go under the hood and debug source code of whatever library they’re using,
trying really hard to figure out how things work. The outcome of such an approach is very
few surprises when running the code because the code behaves how you think it should behave.
When you’re reading source code of some amazing framework,
in a way you’re hanging out with some pretty talented people.
You’re touching their work. And you thought you had to be cool to hang out with cool people.</p>
<p>Back to that copy/pasting thing. You don’t know who wrote that
code and what their agenda is, but you can and should trust <strong>yourself</strong>,
so go with that first, always. After a while, people will notice your
confidence and quite possibly start calling you senior developer.</p>Primarily you should come up with a solution, rather than search for a solution, but junior developers tend to do it the other way around or leave the first part altogether.