2 Replies - 1416 Views - Last Post: 26 April 2014 - 09:15 AM
Where would I start?
Posted 26 April 2014 - 06:55 AM
I've been experimenting with small very simple codes for which there can be no practical use. And it's not too bad. I can think of what I need and know how to execute it. But what about larger programmes that could require hundreds of even thousands of lines. Where would I even begin to understand how to put that down? What do i need to think of first? And in what order should I write things?
I don't really have a specific code in mind at the moment, this is more of a general question than a specific one.
Replies To: Where would I start?
Re: Where would I start?
Posted 26 April 2014 - 08:47 AM
You write a really simple function that does xyz. Generally a function is as simple as possible' no more than can be seen on the monitor without scrolling. And the function should only do 1 thing.
When you have a massive application, you link your class that does xyz to that application. It is normal to have hundreds of classes in a single (large) program.
Does that help or am I on the wrong track?
Re: Where would I start?
Posted 26 April 2014 - 09:15 AM
A: One little bite at a time.
Same with huge coding projects. But realize that coding is last. Planning is first. It can't be stressed enough... Plan... Plan... Plan... Walk away for a week... Plan some more.
Small modular bits of code that serve one and one one purpose in life with no side effects. A side effect would be something like... A method that calculates a result also displays it. That's bad. Calculate is calculate and display is display. If your calculate also does the display, then how would you *just* get the result for some other purpose like a report without having that single calculation also display?
You also have to accept that you learn as go. Nobody starts architecture school by designing the Taj Mahal. You build a bird house, then a dog house, then an out house, then a set of steps, then a porch... working up to a single level single family home. Eventually you will have learned enough about people and how they use things and what they expect and how materials really work in the real world to build a small apartment building. And so on. Code is exactly the same thing. You start with "Hello World". You work up to a pocket calculator application, then a mortgage repayment program.... Small client/server chat program... Eventually you get into bigger and bigger projects as you learn what to watch out for and how to design with more and more forward thinking, modularity and expandability.
If you want, I've got a couple tutorials on planing and modularity that might you thinking.
This post has been edited by tlhIn`toq: 26 April 2014 - 09:17 AM