Learning by Problem Solving
Building something that solves a problem is often more useful and compelling than simply reading about a tool and working through tutorials.
When I need to learn a new programming language or framework, building something that solves a problem is often more useful and compelling than simply reading and working through tutorials. A real problem often leads me to interesting technical challenges and motivates me to learn what I need to. The problem need not be complex to be a valuable learning experience; it just needs to be something you want to solve.
The Problem
When our school system switched from paper report cards to using Power School as a grading portal, there were many advantages, but we lost the ability to get a concise end-of-year summary with grades and comments. Since there was the ability to export your data, I wondered how hard it would be to create a printable view of the data.
The First Iteration
A few years ago, I was looking to refresh my knowledge of Python. So, I built a Python command line tool that took an XML file as input and generated an HTML file that one could view in a browser and print. This worked well for me, and I considered sharing it with the wider community, but I realized that, even with clear instructions, running a Python script was probably limited to techies, so I left this project as an exercise in applying some basic OO design, testing, and HTML/CSS generation in the context of the Python Language.
A New Opportunity
While my backend engineering and team management skills are valuable, I thought I would benefit from becoming more fluent in front-end development. As I started to learn a bit about React from the lead front-end dev at my last company, I decided to write a version of the Powerschool Reporter tool in Typescript using React. Along the way, I cleaned up the CSS code to replace the simple but non-ideal table layout with one using a CSS Grid Layout.
As I was working on it, I realized that as an added benefit, this would also result in something that I could share with the local community since:
I could deploy it easily to Github pages (so no end-user set up),
It had a UI (no instructions) and
It worked entirely in the browser (no data privacy concerns).
Application Advantages
Starting with a real problem helps you to explore how to build a real system and adds some motivation to make the system better. If you can build something that others might use, that also adds motivation to do things well. (There is nothing like the prospect of users to make you want to test just a bit more!) It’s also satisfying to have the chance to help others, as I discovered from comments from those who used the web version of the report card tool.
A simple problem can make for a good learning exercise, as you still need to:
Do some basic design.
Attempt to code idiomatically.
Write some tests using an accepted framework.
Find your way around common errors everyone makes when using a new tool.
It’s hard to become an expert in technology working in isolation, so if you have a friend or colleague you can get feedback from, that can be helpful. I benefitted greatly from my colleague’s comments about my first attempt at a React App.
Extension Points
Building a well-designed, useful application is a great way to learn a new toolset, but it would seem that some technologies are more than you need for your problem. While it’s true that a well-designed system is often a simple one, as a learning exercise, there is no reason not to use your problem as a base for larger system problems. The report card problem didn’t need a web service, microservices, or persistence, but if I wanted to get familiar with a new database or web framework, I could add those elements.
Of course, as you “enhance” your application, remember that simpler is often better. In the case of the report card system, adding a server and persistence layer wouldn’t simply be overkill; it would break the requirement that the data be kept local, so I wouldn’t want to deploy and share that version. But I could use it as a learning laboratory.
Real problems can be great opportunities for learning as they add motivation, real challenges, and perhaps a chance to contribute to a community.