What is the ‘main thing’ in software development?

Software development is about solving problems. It’s about solving problems in an effective way that adds value. It isn’t about programming languages and writing code. Programming languages are tools. We use tools like Cloud compute to run our solutions, and we build solutions with tools like programming languages and frameworks.

It’s all about solving problems.

If you’re getting started in software development as a career and are putting all your effort into learning a programming language, remember that’s just a tool. It’s how you use it to solve problems which is the important part.

The single most valuable advice I can offer to new software developers

When starting out in software development or even learning a new language as an experienced developer, the most likely cause of most ‘I don’t know why this code isn’t working’ type questions is pretty simple:

What you think your code should be doing is often not what it’s actually doing.

This seems like an obvious observation, but it’s easy for even an experienced developer to get caught up in what they think their code is doing, and they forget to look at what it’s actually doing.

Next question: “ok, so how do I find out what my code is actually doing at runtime?”

Answer: you use a debugger. You step through your code and you compare what you think each line should be doing with what it’s actually doing. At some point you’ll find a line where you assumed the code was doing one thing but it’s actually doing something else. It could be the variable of a value that you were assuming to be a particular value but actually it’s something different and it results in a result that’s different from what you were expecting. It could be a condition you were assuming to be true is actually false. It could be a block you were assuming would always get executed but never is. There’s many reasons.

Learn how to use your debugger:

  • Practice stepping through your code
  • Learn how to set breakpoints
  • Learn how to set conditional breakpoints (break when a certain value or condition is met)
  • Learn how to inspect value of your variables
  • Learn how to change values at runtime – what happens when this value is 1 instead of 2?
  • Learn to break on an error
  • Learn how to step backwards to a previous statement (not all debuggers do this but it’s a useful feature)
  • Learn how to change code while you’re debugging

Knowing how to use a debugger is an incredibly valuable skill. It’s seems a given that as a developer you would learn to use and use a debugger as an integral part of your development, but all too often though when asked ‘why is this code not working’, if you ask ‘have you stepped through in a debugger to see why it’s not working?’ the answer is ‘no’.

Learn to use your debugger!

The Pragmatic Programmer: 1st edition vs 20th anniversary edition – what are the major changes?

I might come back and do a more thorough look at each of these differences later, but I wanted to get a rough idea of what were the main changes to each of the chapters in the recently released 20th Anniversary Edition of the classic book, The Pragmatic Programmer.

There’s probably plenty more other changes even in the sections that are common between both editions, but this is a high level overview of the major differences in each chapter, summarized as:

  • New sections added
  • Sections with major changes
  • Sections removed

Essential best practices and principals of effective software development

The software development industry is full of best practices and recommendations, many that evolve and change as our technology changes. There are some core concepts that remain beneficial even though programming languages and runtime technology platforms have changed over time.

Here’s a summary of some core principals that can help us develop software systems more effectively:

KISS – Keep it Simple, Stupid

Unnecessary complexity in code is technical debt that will to cost you at some point in the future – it’s more likely to contain unexpected and hard to find bugs, and complicated code it harder to understand, and therefore harder to maintain. Keep it simple.

DRY – Don’t Repeat Yourself

Avoid duplication in code. Duplicated blocks of code are a maintenance risk. If there is bug in a block of code that exists in multiple places, fixing the issue in only one place means that the issue still remains in those other blocks of code. When other developers are maintaining the code in the future, it may not be obvious that the same code exists elsewhere.

YAGNI – You aren’t gonna need it

The cost of maintaining a system increases in relation to the more code that is part of your product or solution. Why? Because the more code you have, these’s a higher risk for things to break, go wrong, increased effort for testing, and so on. You won’t have bugs in code you don’t have (you may have missing features but that’s a different problem). It makes sense therefore that you shouldn’t build additional features that you or your customer doesn’t need or want. The YAGNI rule is that if you don’t need it, don’t build it. Don’t make your job harder by increasing the possibility for things to break, or increasing the overhead of maintenance by building unneeded features that need to be fixed, updated, tested in the future. Don’t write code you don’t need.

Design/plan/structure your code to enable easier unit testing

Not everyone agrees whether Test Driven Development (TDD) should be followed as an absolute rule or not, but thinking about your tests first has a benefit that can be taken and used to your advantage even if you don’t subscribe 100% to the TDD approach. If you think about structuring your code in a way that makes it easier for you to test, then it’s immediately easier and takes less effort to write your unit tests, compared to code where there was no effort or thought into how the code could be tested. Simpler code is (usually) easier to test, compared to overly complex code that is usually much harder. Simpler code is easier to understand and maintain.