Practice 10:sort
Exercise 10: Sort
Translator: Flying Dragon
Protocol: CC BY-NC-SA 4.0
Proudly using Google Translate
You are slowly building what I call a personal process practice (3P), which is not a new idea at all. The purpose of a 3P is to gain objective insight into how to do things without killing your creativity and productivity. By simply tracking small metrics and creating running charts to guide improvements, you can revolutionize your work. However, the risk is that this will prevent you from hacking quickly or completing tasks, or your threesome will be more work than you actually do.
I’ve been doing this for about four years in my programming career, and it’s given me a good insight into who I am and how I work. It also cuts through many of the lies that process advocates push. I have an easy way to actually test whether some expert opinion on programming improves my personal productivity. I would say that the only mistake I made was taking it too seriously and killing my creativity for four years.
That’s why you want to build concepts of your startup process and work environment in small, quick hacks. With only 45 minutes, you don’t have time to gather complex metrics and worry about how you’re going to do things. Later we will focus on practices that require concentration, where you will spend more time and gather slightly better metrics. As you work, try not to let these metrics stifle your creativity, flow, or happiness. If you hate collecting things, don’t do it. Find a way to automate, or come up with another metric instead.
For this exercise, you are making running charts of the percentage of completed features. This means that before you can work, you must list all the functions in the sort command, which can be found on its standard man page, and then mark the completed functions. Remember to sort them so that you can get enough functionality done and that the tool actually works. For tools that don’t actually work to sort text, getting a score of 90% means you’re actually done 0%.
When you’re done, you should chart the percentage of completed features for each project so we can analyze them in the next exercise.
Challenge to practice
In this exercise, you are implementing the sort command, which is a very simple command. It takes lines of text and sorts them in order. It has quite a few interesting options, so you should read man’s Sort page to find out what it can do. Most of the time, people just use sort to sort lists of names:
ls | sort
Copy the code
You can also sort backwards:
ls | sort -r
Copy the code
You can also control how the order is sorted, such as ignoring case:
ls | sort -f
Copy the code
Or, you can even perform numerical sorting:
ls | sort -g
Copy the code
This may not be useful for the output of ls unless they are all numbers.
Your job is to implement these features as much as possible and keep track of every feature you accomplish. These should be in your lab notes for later analysis.
Inquiry learning
- Have you done something to improve now? Try searching and finding other people’s process suggestions.
- We are programmers and coders. Are you trying to find code that will make you more productive? My friends Audrey and Danny have a project called cookie-Cutter that you should check out.
- You should now study how to average a set of numbers. You will use it to calculate the middle line of the running diagram in Python.
Learn more
If you really want a correct running chart, you also need to calculate the standard deviation of your values. Not necessary now, but if you want to be extremely accurate, then this is helpful.