Newsletter # 24 - Migrating an old JavaScript codebase to modern JavaScript May 21 2020
Hello, and welcome to issue #24!
I wonder why we always seek novelty. Maybe it is because there is the illusion that this new thing might finally be the perfect solution without tradeoffs. I began many years ago to explore Linux because it might be different than MS Windows. Then I changed to macOS because it was the solution over both. And now, I'm exploring more about FreeBSD because it's more integrated. In any case, it is fun to explore different topics and learn about different technologies. And who knows, maybe after exploring enough we can help make our options better and finally get us closer to a "perfect solution".
Talking about technology, I have a few recommendations for you. As you might already know, I enjoy audiobooks and podcasts. So this week I'll share with you two new podcast recommendations, I find them fun and informative. I hope you like them too:
- 2.5 Admins - It's a new podcasts (3 episodes) on general technology but with 3(2.5) knowledgable system administrators. They talk about current tech news, and they also answer listener questions with the right amount of detail.
- Unsupervised Learning - short episodes(around 20mins) that talk about tech/security/human news and latest articles that the host has read.
Check them out, and if you have any recommendations, I'll be glad to hear them. I'm always on the lookout for new interesting podcasts (and books).
Talking about books, and if you are interested in iOS development. The Big Nerd Ranch, just published (May 5th 2020) the 7th edition of their iOS development book. I've enjoyed their books in the past, and I'm looking forward to reading this one. So if you want to learn more about iOS development here is my recommendation:
iOS Programming: The Big Nerd Ranch Guide, 7th Edition
We probably agree that software development is fun, and as I was mentioning before we tend to get more excited about new projects. But normally what we do most of the time is maintain code. Lately, I've been working on old JavaScript codebases, and I want to bring it back to the modern age of JavaScript. While working on it, I took some notes and posted them in my notes section. I cover general tasks/changes that you'll have to do to bring an old JavaScript code to modern JavaScript techniques. If you are interested, have a look here:
https://rderik.com/notes/migrating-an-old-javascript-codebase-to-modern-javascript/
Ok, that's it for the week. Have a good rest of the week.
Derik
Tip of the day
Have you ever wanted to test a command in your shell but you don't want to create a file only for that test. Maybe you are tweaking a regular expression. Wouldn't it be cool to create an inline file that will be discarded after the command is executed? Good news, "in place" files on bash are here to help.
1
2
3
4
5
6
$ cat <<ENDOFMYTEMFILE | sed -e 's/^ *"\(.*\)"$/+ \1/g'
"var"
"assign"
"this"
"window"
ENDOFMYTEMFILE
We would get:
1
2
3
4
+ var
+ assign
+ this
+ window
Bash will take the content of the next line after your command until it finds a line with that has the terminator as the content of your file. I used the terminator ENDOFMYTEMFILE
, but you can use anything you like (e.g. EOF
, END
, etc.).