Understand Coding
Because they are not things we already know, we have to learn them, they are skills in coding .
Writing software is an intensively cognitive task, it requires a lot of experience, experience that you ONLY obtain from working in the industry, the longer you work in the industry, the more experience you gain, and the more experience you gain the easier it becomes.
In software engineering, coding is no sooner do you learn one skill, but something new comes along that you now need to know about, then something else a few months later. The industry innovates at such a rapid pace that you actually have NO CHOICE but to keep learning and studying while you work in the industry.
Myself personally, when I’m not working on something I’m reading, Coding when I’m not reading, I’m writing blog posts to help solidify my thinking and help others learn, In my spare time, while I’m in the bath, before I go to sleep at night… you name it, and when I’m not reading, I’m thinking about things, I’m running through scenarios in my head and working out what kinds of things will help me solve them Coding problems.
If that sounds like fun to you, if you enjoy playing long thinking games like chess, and spending a long time working things out, and your prepared to put in long hours of study, then this is a good job for you to do.
If it sounds boring and you just want to jump in feet first and get the high wages we all supposedly earn in this Coding industry, then forget it, your going to hate it, and if you do manage to land a position all your going to be doing is code monkey style typing work for as low a wage as someone can get away with paying you.
Focus on achievement milestones in coding
- Learned CS1 level programming and problem-solving. Imperative and object-oriented programming.
- Learned CS2 level. Functional, protocol-oriented, and logic programming.
- Tackled DSA (Data structures and algorithms).
- Built your first dynamic web app.
- Wrote your first mobile app.
Focus on making achievements, instead of hours spent.
Next, the problem of difficulty cannot be mitigated. It’s just how it is, and thinking is hard. Specifically, you need to:
- know enough computer science to be technically literate
- know your programming language’s syntax
- apply the syntax to solve problems
This is harder than it seems.
Point 1 anyone can do.
Point 2, some people achieve this.
Most people get stuck on point 3.
What to do?
A good solution is to think hard until thinking becomes almost effortless. Finding solutions becomes easier the more you attempt to solve.
There’s a method to this. Find materials where problem difficulty progresses evenly and smoothly, and is not too steep all of a sudden.
For instance, consider this little snippet:
- attempts = 0
- while True:
- code = input(“Your PIN please: “)
- attempts += 1
- # …
Which I’ve left incomplete. Now, the PIN is 11045. Can you complete the rest of it? The difficulty is just right, it’s something you can do but you need to think a bit.
Suppose you get stuck here
Your program should work but doesn’t. When you finally enter 11045, it still fails:
The kind of thinking needed for programming is actually the fun type. It’s not the thinking of a man who has to decide whether the Cartel boss should cut his toes or his fingers…. It’s the thinking needed to play a computer game. This is the good news.
Have you seen the problem in Coding yet? Problems are proofs you don’t know something yet. Here, you probably didn’t know input()
only takes in strings. Type-casting it on line 2, we notice:
That it still runs the loop:
Now, the task is to try and figure out how to stop the loop once the correct pin has been entered.
Again, to know how to break out of a while loop is a problem of knowledge, we just add a break
under the if
clause, after the two print statements:
It works:
Notice how when the user enters the correct pin on first try, the sentence reads: “it took you 1 tries!” ? That’s not good English. Fix the program such that it says:
- it took you 1 try.
but
- it took you n tries
if n > 1.
You see how we progressed smoothly from small problem to small coding problem? That’s the way to do it. Don’t attempt impossible problems when you lack foundations.
For instance, don’t attempt to print:
- it took you one try.
and
if n > 1:
- it took you n tries
where n is a word number. That’s quite hard for a learner at this level. To bring the problem back to your level, you can make some assumptions. One such is, n should not exceed 10. That is, a user should not be allowed to make more than ten tries.
If so, our problem becomes solvable if you know how to use dictionaries. Remember that bit about problems being proof of lack of knowledge?