Building personal projects to grow your software development skills

When you are first starting out to learn a programming language and software development, it’s easy to get stuck in a rut with tutorials and watching videos etc. While it’s essential that you learn the basic constructs of any programming language, the real learning comes from trying it out and actually building something.

What should you build? This is a common question online, you often see new devs asking ‘what are some good ideas for building a personal project?’. It doesn’t matter what it is or what it does, just build something. As you build an app (e.g. a web app with a backend db), you’ll run into areas that you don’t know how to do yet, so use that as a jumping off point to grow skills in that area. Rinse and repeat.

Starting out you’ll find it will be slow going because there’s too many things you haven’t had to do yet (how do you package and deploy your app, if you need to deploy your app to a server, how do you install and configure the server, or how do you deploy to the cloud?), but you’ll work it out and grow your skills in the process.

As you get more experienced, you can pick projects to work with a specific skill or technology area to grow skills in that area, for example to grow skills working with a specific nosql database or anything new tech that you want to gain some experience with.

In the process of actually building something, you’ll find you’ll learn far more that just watching an online tutorial. Try it and see!

Write code for humans first, computers second

When first learning to develop software, it’s natural to focus on getting your code to work as your first priority. As development is an incremental process, between multiple changes and attempts to get your code working, it’s natural that your first working version of your code is probably, to put it bluntly, a mess.

As you progress in your career, you realize the importance of developing code that is easy to read and understand, because at the end of the day, any software developed or maintained by a team has to be read and understood by other developers, not just the original developer. If no-one else on your team and understand your code then it’s unmaintainable and that poses a long term risk; if it breaks who is going to be able to fix it?

I commonly see posts online by new developers who are first starting out questioning the point and importance of spending time to refactor code, ensuring code is clear and readable, in essence, all attributes of maintainable code. The first time you come across code that you struggle to understand and you’re faced with making updates or fixing an issue, you’ll quickly realize the importance of developing code that is easy for other humans to understand.

This is not a new concept, it’s summarized clearly by the famous quote from Donald Knuth:

“Programs are meant to be read by humans and only incidentally for computers to execute.”

Creating a static website with GitHub Pages

I have a bunch of note as html files and want to easily host them somewhere. I’m looking into using GitHub Pages. GitHub pages provide themes, but for html files you need to add a header to the start of each file in markup format using Jekyll Front Matter.

---
layout: default
---

Add a sample test page with a couple of headers and you end up with a page rendered with your selected theme:

Access your site with the url: https://[your-github-user-id].github.io/[repo-name]

Using sed to filter a file, outputting matching patterns only

I’m parsing a dictionary file from Princeton University’s WordNet, but the only part I’m interested in extracting from the file is the word itself. grep won’t work for this since you can only output a matching line, but not a single matching word or pattern from a file.

The file structure looks like:

{ Bigfoot, Sasquatch, legendary_creature,@i (large hairy humanoid creature said to live in wilderness areas of the United States and Canada) }
{ Demogorgon, deity,@i noun.group:Greek_mythology,;c ((Greek mythology) a mysterious and terrifying deity of the underworld) }
{ doppelganger, legendary_creature,@ (a ghostly double of a living person that haunts its living counterpart) }
{ Loch_Ness_monster, Nessie, legendary_creature,@i noun.object:Loch_Ness,#p (a large aquatic animal supposed to resemble a serpent or plesiosaur of Loch Ness in Scotland) }
{ sea_serpent, legendary_creature,@ (huge creature of the sea resembling a snake or dragon) }

The second word in the file is what I’m looking for, so the output should be:

Bigfoot
Demogorgon
Loch_Ness_monster
sea_serpent

Let’s start with a simpler example first. Given a string “apple potato tomato”, let’s filter to print only words starting with “po”

$ echo "apple potato tomato" | sed -E -n "s/.*(po[[:alpha:]]+).*/\1/p"
potato

Breaking it down:

-E : used extended regex
-n : surpress outputting each line of the input
.*(po[[:alpha:]]+).*
- match any characters, then as a capture group () starting with po then 1 or more other alpha characters, followed by any other characters
\1 - replace match with capture group 1
/p - print only matches

Now that’s use the same approach to match just the first word on each of the dictionary file lines:

sed -E -n "s/{[[:space:]]([[:alpha:]]+\_*[[:alpha:]]*).*/\1/p" ./dict/dbfiles/noun.person >> noun.person.parsed.txt