3 ms·
I liked a lot of Johnathan's ideas about writing simple code. One idea that I don't think fits for the type of system I develop is the idea of preferring huge
by kelly5 15y ago
I liked a lot of Johnathan's ideas about writing simple code.
One idea that I don't think fits for the type of system I develop is the idea of preferring huge blocks code over function calls (around 30:00). He counters the benefit that the function name documents the chunk of code it encloses, but an even bigger benefit, in my opinion, is that the function signature documents the function's inputs and outputs. If you avoid global variables then you know when you modify a function exactly what information you have access to and exactly what information the function produces. This makes changing the function much easier.
He says he's talking about thousands of lines of code that always get executed in serial, so it doesn't sound like my code is very similar to the code he's talking about. I also expect that code I write gets read and modified much more often than the code he's talking about.
- felipemnoa 15y agoI think he was talking on the extreme.
- chipsy 15y agoA lot of game code is actually "data" code, so the large functions come about naturally because so many assumptions and special-cases are made that you don't have anything resembling a CS-style algorithm, just a blob of "integrated assets" - and so the only route for further progress is a new syntax tailored towards the particular methods of integration being addressed. That said, a new syntax can work, if it's the right one.