
Summary (TL;DR): It depends – a well structured programming project will actually have less lines and assets, and thinking that more lines means a more complex game or IT product of any kind is a misconception.
Recommended music to listen to while reading: America – You Can Do Magic
We’re mainly using GameMaker for our work, which is an object oriented game development engine environment. It is excellent for making 2D games, and has everything prepared and designed for – you guessed it – OOP (Object Oriented Programming).
Why does this matter for explaining the answer to the question? Well, OOP can exacerbate the difference a programmer makes by using OOP to his advantage and actually simplify the project he’s working on – making a well-thought project and its mechanics almost a necessity when thinking about speeding up production.
Let’s try and think a bit about why less code lines might be helpful while programming an IT product. I’ll be mostly thinking about videogames, GameMaker and OOP, but most of the things mentioned apply to any kind of software product.
Well… As you grow older, the more you’re aware there is no pure black & white. Everything has a pro and a con. Additionally, you appreciate more the things that are simpler – pure black and pure white 🙂
Although you could intentionally write more code lines to prevent somebody else from actually working on the same project, as that somebody would have to waste lots of time on getting into it, there is one (f)actual reason why having more code lines is sometimes beneficial.
Speed of development! Thinking about how to structure the code, mechanics and everything else in the project just takes time. Time to sit down and think (+ sometimes sketch on paper). This is time you could be spending writing code. So here comes the caveat – writing code is never just ‘writing code’. It is not the same as talking or writing a letter or a book (or a blog post). Speaking is easiest – you talk about what comes to mind and the process is fast. Writing a letter/email/post is slower – you need to think what you wanted to say, how to bring emotion into words (as there are no facial expressions and body language). And programming is even more thought-intensive! You need to think and think about how to first solve the problem, but then also how to write down and structure the solution, so you don’t break other things. Plus, so it is readable and is somewhat optimized, and people (including you) doesn’t waste a lot of time reading it later when you need to change it.
See what I did here? I’m trying to come up with a good reason to have more lines of code, and I’ve navigated around it. Well, it is actually simple – if mechanics you’re developing are light and the project is small – don’t overthink it! Just making it work sometimes beats having crystal-clear code which is short and nicely written. So if it will take you a few hours to complete the whole game (which is very unlikely and something I’ll talk about in another post probably) – don’t spend time making it small in terms of code lines. Just make it work. The bigger the project – the more you’ll HAVE to worry about keeping the code line count in check. Please don’t even think about working on a project which will take several months or more without spending time on thinking how to organize the code base. Just don’t!
Heh.