Exercises for Programmers - 57 Challenges to Develop Your Coding Skills
Author: Brian P. Hogan
Review created: 2018-07-23
Exercises for Programmers - 57 Challenges to Develop Your Coding Skills is a book that, well, contains 57 programming exercises for developers. Why should he/she chose to invest time in doing them then? For a number of reasons:
- To learn a new programming language.
- To rehearse a programming language that he/she knows, but that needs a small refresher.
- Just to get something to program. Maybe the programmer has gotten a promotion and does not have time to do much programming at work. Using the exercises in this book can alleviate the coding abstinence.
- Because it is fun :)
The book is divided into 10 chapters. Each chapter starts with a short explanation about what the chapter is about and why it is important to know how to create programs that the exercises of the chapter practices. Each exercise then also start with a short problem description, then there is a section, Example Output, that shows how the output from the program should look like when finished. Following this is a set of constraints that the program must adhere to an last is a part describing some additional challenges that could be implemented if one feels like it.
Each chapter ends with a section describing what you've learned by working through the exercises in the chapter.
These are the names of the chapters:
- Turning Problems into Code
- Input, Processing, Output
- Calculations
- Making decisions
- Functions
- Repetition
- Data Structures
- Working with Files
- Working with External Services
- Full Programs
Many of the exercises are quite simple, like for example the first one where you are told to write a program that asks for your name and writes a greeting using the inputted name. The overall difficulty level increases a bit as the book progresses. What increases more than the difficulty level, however, it the time it takes to implement each exercises. The ones in the last chapter takes much longer time to implement that the ones in the first chapter.
Often the challenges takes more time to implement than the original problem. In the second exercise for example, the main task is to implement a program the asks the user to supply a string and display the number of charaters in that string. Such a program does not take a very long time to implement. In one of the challenges, however, one is asked to implement a GUI version of this program. The GUI version should update a counter every time a button is pressed. Such a program takes a significantly longer time to implement than the main program.
I found many of the exercises to be quite easy to implement. Some of the exercises requires you to use an external API, e.g. the Flickr API. Those were a little more challenging.
My main goal for implementing the exercises was to keep up my Python coding skills and learn more about writing Python3 programs. I think I fulfilled both of those goals nicely :)
I implemented all exercises but one and most of the challenges. The exercise that I did not implement was number 50, which required me to apply for an account by a company called Rotten Tomatoes. For every other exercise such an account registration could be done automatically via the web, but for the Rotten Tomatoes account one would have to be contacted by a sales representatives from the company to get an account. This was not something that I wished to do, so I skipped that exercise.
The challenges that I skipped was the ones involving either to implement an app or to use a functional programming language to solve the exercise. I'm far too lazy to do either of those things :)
Summary: Exercises for Programmers is an interesting book if you want to learn a new programming language or want to refresh the knowledge of a current one and have trouble comming up with ideas for programs to write. Most of the exercises are fairly simple, so don't expect any extreme challenge. That the exercises are not too difficult is good I think. This means that you can work through more exercises, meaning more language constructs, in a given time. As I said above, I used Python3 for implementing the exercises. Now that I'm trying to learn Go, I'll start over from exercise 1 using that language. We'll see how it goes. I'm sure it will be fun and that I will learn a lot of Go in any case :)