3 ms·
You need to design first - on paper, white-board, etc. You wouldn't build a house without blueprints, so why try to write a big program without sketching stuff
by CyberFonic 16y ago
You need to design first - on paper, white-board, etc. You wouldn't build a house without blueprints, so why try to write a big program without sketching stuff out so that you can break down into manageable chunks.
If that doesn't help, then maybe you need to take a good CS course. If you have only programmed in C++, then it doesn't sound like a comprehensive background in CS.
- jff 16y agoExactly this. The image of the lone hacker sitting down and pouring out a bunch of code straight from his brain is a romantic one, but if you haven't spent a little time deciding what your data structures are going to look like and how you're going to pass stuff around, etc., your code will be crap. "Just coding it" leads to both frustration as you sit wondering what you should be writing and why programming is so hard, and poor code. The poor code comes in when you start throwing in stuff like one-use elements in your structs to keep track of something you hadn't forseen, when a little bit of planning could have alleviated that. I'm certainly not saying you should go write up a design document complete with UML and everything. That would be ridiculous, damn it I'm an engineer not a bureaucrat! Just sit down and think (on paper) about how some of the important stuff needs to look. It'll help a lot. As for the second point, C++ does seem like a weird place to start. Go learn assembly or C. Learning to write assembly is a process of continually solving tiny programming puzzles, as you figure out how to hand-roll a loop and such.