5 years and 3 days later ...
Wow, how time flies by !
My last blog post (before this one that is) dates from 5 years and 3 days ago.
5 years and 2 days later, here I am creating a new post to say that I’m reviving this blog after this long hiatus.
I thought long & hard about why I didn’t write a single post in all these years, and it all boils down to: Blogging is hard.
Why blogging is hard
Writing is hard and takes time
Blogging takes time: thinking about the subject,the article structure, the wording, …
Then there is the writing, the reading-what-you-just-wrote, the not-liking-it, rewording-and-tweaking-it-three-or-ten-times, the typo-fixing, the rinse-and-repeat, …
I guess what I’m saying is: writing in natural languages is hard, compared to say writing in a programming language (Go, even Java, …).
Such language have a very restricted vocabulary and grammar (notice how I didn’t include C++ or Scala in the examples I cited earlier). Also, the compiler or interpreter is there to yell at me if it detects any mistakes.
In comparison, writing in English (or French) is a completely different proposition: millions of words to choose from, and an organically-grown and highly irregular grammar and idioms to follow.
Self-Imposed high bar
I know that I speak for a lot of us when I say: One of the reasons I don’t blog often or hardly ever is: almost nothing I’m going to write is going to be ground-breaking or unique & original.
To give you an idea of the extent of this problem: look at this particular post of mine (dating from 2015): Parsing command line arguments using a finite state machine and backtracking.
In that post, besides the huge wall of text and the never-ending graphviz diagrams, I went full tryhard mode and coded a whole interactive graph animation system, using dagre and d3.js and lots of custom code.
I can’t remember how long it took me to finish that article, but it must have been too much. I can’t do that for every single post.
Yet, I will try to blog again
For 2 main reasons:
Writing is an invaluable skill
Writing is an invaluable skill.
Enough said.
The content is useful
Back to the self-imposed high bar:
I consider myself to be a decent programmer. I my career, I worked on large/complex code bases, implemented non trivial features and fixed hairy bugs.
Yet, I often turn to google for some very basic, downright embarrassing questions.
Admit it: you too dear reader asked Google something so trivial that you did it in the private browsing mode, feeling judged by Larry & Sergey.
Sometimes, late a t night, I have 1 or 2 hours to work on a side project before hitting the bed. I need to bang some quick throw-away code to accomplish something in an unfamiliar language/framework. As an experienced & pragmatic programmer, but also a “I am too pressed for time, sleep-deprived , I decide that I do not need to spend lots of time trying to learn/understand this particular subject in depth. It’s a throw-away code snippet, and I have other more urgent matters to attend to.
So I google it as it is, e.g. (those are real searches I’ve done recently):
javascript try catch async func
: I know I need to take the time to learn and really grokasync/await
, but I didn’t have the time when I searched thatpuppeteer pass parameter to evaluate
node iterate over object keys
: yep …nodejs write json to file
golang exec process
: I have been programming in Go almost daily for the last couple yearsgolang read file line by line
: yep …mac os mp4 to vlc default player
: I was sleep deprived at 4am, my brain blanked out on how to change file associations in Mac OS- and thousands of searches in the same vein
I almost all of those cases, the answer could be found directly in the concerned tool/language/framework documentation.
But those docs are too much.
What I’m really looking for when searching for those are exactly the kind of posts I feel beneath me: someone somewhere decided it was worth it to write a post showing how to “iterate over object keys” in javascript, and it was exactly what I needed at that moment. Not a language specification. Not a fully exhaustive & well structured documentation. Just a one page long post with the snippet I needed.
I will think about this whenever I’m hesitating to write about a subject because I find it “too trivial, it won’t help anyone”.
Oh, one more thing
I’m convinced by now that I will never change: I am a master at yak shaving & wheel reinventing.
When I decided to start blogging again, I didn’t do the the first thing a normal person would do, i.e. write an effing new post.
Instead, I spent the last 7 or 8 days:
- porting my blog from Pelican to Hugo
- since I have lots of Graphviz dot graphs, and since hugo does not provide an
exec
shortcode, I spent hours playing with mermaid.js, Gravizo, and even flirted with the idea of writing my own library using dagre and d3.js - then I ended up writing a program in Go which parses the markdown files, extracts the graphs content, passes it to the Graphviz’
dot
CLI, copy the generated svg to theimages
directory of my hugo site, and patches the markdown document to embed the images - Oh, I also created my own theme. It went brilliantly:
- I spent hours testing out almost all the existing themes in the Hugo gallery.
- But no, those are not good enough for me…
- So I went scouring the web for “top blog designs”, then generalizing to “top web designs”
- I got tired of going through list after list, opening countless tabs, screenshotting the nice designs
- That’s when I hacked together a script using puppeteer to:
- go through those lists for me
- open the linked websites
- scroll down for a bit, then scroll up again (I was also interested of techniques for collapsing/snapping navbars on scroll)
- all the while capturing screenshots
- then invoke ffmpeg with those screenshots to generate a video
- do the same process again, but simulating an iPhone this time, because I also wanted to see how those sites handled responsive design
- After a couple hours running, this produced a couple hundred videos
- That’s when I got bored and couldn’t get myself to sit through and watch all those videos
- So I fired up Figma and spent a couple of days hacking away find the perfect color palette, font pairings and visual layout
- Then again hours and hours writing the required HTML and CSS to implement his grand vision
- I also bought Affinity Design and spent hours watching tutorials on Youtube to create the ugly favicon you see in the browser tab above
- You get the idea. My life is a nightmare.
Classic Jawher 🤦♂️1
So where were we ?
Ah right:
Just blog dammit.
It doesn't need to be Nobel-prize worthy material.
Somebody somewhere will find it useful.
Thoughts ?
Disqus went to shit. So I got rid of it in this reincarnation.
I’m looking into other options (utteranc.es, commeto.io, remark42, …)
In the meantime, please feel free to yell at me in twitter for example:
Waking my blog from its deep slumber, and why I’m planning to blog more ! https://t.co/w3SbmsJkKt
— Jawher Moussa (@jawher) May 28, 2020
-
While it may seem that all these roundabouts were a waste of time, I am glad I got to test-drive puppeteer which I’m sure will come in handy in other projects. I’m also a convert of Figma: never going to design anything directly in HTML/CSS again. ↩︎