Years of slow improvements, I learned to code before AI so I knew the fundamentals first. Then AI came out. But AI has major limitations, so you can’t fully rely on it. I feel like I design my code base, using those fundamentals, then ask AI to deal with syntax. I find that AI is great at turning pseudocode into working code, but smart pseudo code makes a big difference. AI usually doesn’t have the context to understand how you want data organized. If you let it, you get really bad drift in —-
—- data structures. To give an example I have this STRING variable with values “one”, “two”, “three” baked into an early version of my code, because AI doesn’t know to use a double for that. But, that aside, if you know exactly what you want to build and how to test it, it’s fantastic. I still write all my code in pseudocode, I just don’t deal with syntax
A few principles: DRY - don’t repeat yourself. It’s preferable to have one centralized function that gets called multiple times to do the same task, as to have many functions that do the same thing Single responsibility terminal functions and MVC format - first, I should mention that there are reasonable times to code in an object oriented manner, and others that are best in a procedural manner. You let the needs of your app define that. But, in either case, you break each task into single —
I use “Nested MVC”, which i feel is better suited for MatLab than traditional MVC. That means I have a lot of controllers that coordinate sub controllers and sub sub controllers… but eventually we reach either terminal “model” functions… like 50 lines of code that do one task only. Or a terminal view function that does that one task. Then your controllers are so easy to read and follow. That’s what’s in the Original image
Pink highlights are data accumulator functions. I also create data array maps like this. So I know the exact data structure I need, and I know when AI didn’t follow my directions. AI is really good at making something that works in the moment but isn’t compatible downstream, so you need to check every single data structure for deviation from the plan