Join Simon Allardice for an in-depth discussion in this video What you should know, part of Programming Foundations: Code Efficiency.
This is a course for programmers. If I'm going to talk about efficient memory usage, I'll be discussing data times, variables, arrays, and objects. If I'm going to talk through the optimal use of iteration, well you need to understand a loop when you see one. But if you've watched any of my other foundations or programming courses past the fundamentals one, you'll have a good idea of what to expect here. I will be as generic as I can be, often using pseudocode or simple readable examples from common languages because I want you to get to the end of this course and think, that was incredibly useful whether you're working on desktop applications in Java, Objective-C mobile applications, Python web applications, C# class libraries or anything else.
So what I expect from you is general development skills. You're comfortable developing in a general purpose programming language, you understand the common vocabulary and concepts of modern software development and you're not freaked out if you see a different language from your personal favorite. Because of the nature of this course, I will not be getting into the very specific techniques for optimization that only apply to a particular point release of a specific operating system running on a certain kind of CPU with a distinct kind of ssd drive.
This is a general course on efficiency. Now there are efficiency improvements you can focus on that are unique to your particular language and environment and version of the operating system. Of course there are, but those kind of improvements are usually not the first place you need to be looking. Now, sure, in this course I will talk about language and environment differences as they affect efficiency. There are impacts of using a compiled language over interpreted language. There are consequences when using a garbage collected language as opposed to one with manual memory management.
And likewise, the kind of application you're working on also has repercussions. Not all the choices you'd make for optimizing a server-based web application are exactly the same that you'd make for improving a browser-based mobile application. And we will cover those. But for the moment, forget about all that. Because if I were teaching this content to an audience of experienced developers with 100 different backgrounds and I ask them to discuss their biggest efficiency wins. They would be able to have that conversation regardless of language, because the most significant improvements won't come from tiny choices unique to your environment.
They will come from much more general ideas. Fixes you could recognize, use, and apply across many different kinds of applications in many languages and environments. And in the first section of this course, we will explore those general ideas. And some basic principles, and as you'll see in a moment, I'll begin this course by trying to discourage you from doing anything at all.
Learn to choose the right data types, understand the pitfalls of using high-level languages, and decide where to spend your time. Plus, see how the underlying memory management model may have more of an impact than you realize, and what performance issues you can expect working with databases and web services.
- Identifying problems in the code
- Embracing constraints
- Using code analysis tools to measure performance
- Managing memory
- Managing disk-based and network resources