2 Replies - 1261 Views - Last Post: 26 April 2014 - 09:15 AM

#1 Atharron  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 49
  • Joined: 23-April 14

Where would I start?

Posted 26 April 2014 - 06:55 AM

First, please forgive me if this is in the wrong place, but I thought it would be appropriate for this kind of question.

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.

Thanks :-)

Is This A Good Question/Topic? 0
  • +

Replies To: Where would I start?

#2 astonecipher  Icon User is offline

  • Major DIC Head
  • member icon

Reputation: 621
  • View blog
  • Posts: 2,787
  • Joined: 03-December 12

Re: Where would I start?

Posted 26 April 2014 - 08:47 AM

Think in terms of class methods.

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?
Was This Post Helpful? 1
  • +
  • -

#3 tlhIn`toq  Icon User is offline

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5480
  • View blog
  • Posts: 11,762
  • Joined: 02-June 10

Re: Where would I start?

Posted 26 April 2014 - 09:15 AM

Q: How do you eat an Elephant?
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.
http://www.dreaminco...ister-part-one/

This post has been edited by tlhIn`toq: 26 April 2014 - 09:17 AM

Was This Post Helpful? 3
  • +
  • -

Page 1 of 1