The most important things to write a program

T

TSB

Hi everyone,

I think algorithm is very important for every computer language. But I
don't know another important things.

I am newbie to computer languages, so anyone can tell me what the most
important things are to write a program?

Thanks,
Tsetsbold
 
W

Walter Roberson

TSB said:
I think algorithm is very important for every computer language. But I
don't know another important things.
I am newbie to computer languages, so anyone can tell me what the most
important things are to write a program?

- Documentation.
- Test cases.
- A *good* reason why the problem should be solved by technology
instead of by social measures. Just because something *can* be
programmed doesn't mean that it *should* be programmed.
 
S

santosh

TSB said:
Hi everyone,

I think algorithm is very important for every computer language. But I
don't know another important things.

I am newbie to computer languages, so anyone can tell me what the most
important things are to write a program?

Brain, fingers, pencil, paper, computer, editor, compiler etc.
 
G

Guy Macon

TSB said:
Hi everyone,

I think algorithm is very important for every computer language. But I
don't know another important things.

I am newbie to computer languages, so anyone can tell me what the most
important things are to write a program?

GOTOs? (...ducks as people throw things...)

Seriously though, what is your goal? Someone like me who packs
a tiny little program into a microcontroller that costs a dime
and then has a couple of million toys made that run it has quite
different needs from someone who is developing the Linux Kernel,
and he has quite different needs from someone who is writing a
game for an Xbox/PS2/Wii or someone who is working on search
algorithms for Google. What kinds of programs are you interesed
in creating?
 
J

jaysome

Hi everyone,

I think algorithm is very important for every computer language. But I
don't know another important things.

I am newbie to computer languages, so anyone can tell me what the most
important things are to write a program?

Following are some other important things to consider. These bullets
are essential if you ever end up writing software that could
potentially end up killing people. Furthermore, many of these bullets
are arguably good things to follow regardless of the type of software
you're writing, because they improve on software quality. In other
words, your users will appreciate adherence to some if not all of
these bullets regardless of whether they're flying in a jetliner and
praying that the aircraft doesn't fly into a mountain or are simply
playing an open-source Linux game and praying that it doesn't crash
when they're on the brink of achieving their personal best score.

1. Requirements (both system and software, both validated, and
documented).
2. Design (documented).
3. Implementation (i.e., code that implements the requirements and
design, with documented coding standards in place, of course).
4. Verification (i.e., tests that verify the requirements and design,
with statement and decision coverage, as necessary or proscribed, and
preferably 100% modified condition/decision coverage (MC/DC),
regardless of what is necessary or proscribed). Documented of course.
5. Version Control (documented of course).
6. Quality Assurance (documented of course).
7. Peer reviews of all the above, as necessary (documented of course).
8. Independence applied to all of the above, as necessary.
9. Goto one of the above steps until it's correct (documented of
course).

Best regards
--
jay

A free statement and decision coverage utility that is worth
investigating:
http://gcc.gnu.org/onlinedocs/gcc/Gcov.html

The best statement and decision coverage utility (hands down) that is
worth investigating:
http://www.bullseye.com/
 
T

TSB

GOTOs? (...ducks as people throw things...)

Seriously though, what is your goal? Someone like me who packs
a tiny little program into a microcontroller that costs a dime
and then has a couple of million toys made that run it has quite
different needs from someone who is developing the Linux Kernel,
and he has quite different needs from someone who is writing a
game for an Xbox/PS2/Wii or someone who is working on search
algorithms for Google. What kinds of programs are you interesed
in creating?

I am very interested in Open Source and like using UNIX. So I guess in
future I will write some Open Source program,
 
R

Richard Heathfield

TSB said:
Hi everyone,

I think algorithm is very important for every computer language. But I
don't know another important things.

I am newbie to computer languages, so anyone can tell me what the most
important things are to write a program?

0) In C at least, array indices start with 0, because an index is not a
count but an offset. Failure to understand this is the cause of many bugs
in newbie programs.

1) Know what you're trying to achieve. Write it down. Programming then
becomes the iterative process of getting your program's actual behaviour
to match the behaviour that you've written down.

2) Anything that can go wrong *will* go wrong. Make sure it can't, or at
least that you handle it when it does.

3) All code should do something good or stop something bad happening. If
the code is neither a positive benefit or at least a safeguard, rip it
out.

4) Everything Has To Be Somewhere. Manage your storage properly.

5) Know your language. Don't assume that local assumptions work everywhere.
If your program will have to work on more than one machine (and this
eventually happens to most useful programs), make sure you understand the
difference between "the C that works on THIS computer" and "the C that
works on ALL computers".

6) Never put more than seven items on any list.
 
B

Ben Pfaff

TSB said:
I am very interested in Open Source and like using UNIX. So I guess in
future I will write some Open Source program,

That narrows the possibilities very little. Linux and other open
source software runs on wristwatches and supercomputers and
everything in between.
 
C

Charlie Gordon

Ben Pfaff said:
That narrows the possibilities very little. Linux and other open
source software runs on wristwatches and supercomputers and
everything in between.

Hands? fingers? cans of jolt cola and pizza slices?
 
C

CBFalconer

Richard said:
TSB said:
.... snip ...

.... snip ...

6) Never put more than seven items on any list.

This includes functions, but does not include lists :)

(i.e. a list is one thing)
 
J

John Bode

Hi everyone,

I think algorithm is very important for every computer language. But I
don't know another important things.

I am newbie to computer languages, so anyone can tell me what the most
important things are to write a program?

Thanks,
Tsetsbold

1. Know exactly what the program is supposed to accomplish
(requirements analysis).
2. Know exactly how the program is supposed to accomplish it
(design).
3. Know that the program is doing exactly what it's supposed to be
doing (unit and system testing).
4. Know how to tell other people 1, 2, and 3 (documentation).

Software must be, in order:

1. Correct -- it must do everything it is supposed to do, and nothing
it isn't supposed to do.

2. Robust -- it should be able to handle unexpected inputs and
exceptional conditions gracefully. If the program *must* shut down
due to a fatal error, the shutdown should be orderly, releasing
resources and leaving the system in a consistent state.

3. Maintainable -- code should be written in a manner that is easy to
understand and change. Avoid writing clever or tricky code in favor
of a style that's more straightforward.

4. Efficient -- your code should be reasonably efficient. Focus on
efficiency at the high (algorithm) level, not the low (code) level.
For example, a poorly optimized quicksort will beat the pants off of a
highly optimized bubble sort in the average case.
 
F

Flash Gordon

John Bode wrote, On 31/10/07 13:38:
1. Know exactly what the program is supposed to accomplish
(requirements analysis).
2. Know exactly how the program is supposed to accomplish it
(design).
3. Know that the program is doing exactly what it's supposed to be
doing (unit and system testing).
4. Know how to tell other people 1, 2, and 3 (documentation).

That should be:
4. Know how to tell other people 1, 2, 3 and 4 (documentation)

Part of the reason for 4 being listed in 4 is that in more complex
systems you need cross-references, documented naming conventions and the
like to enable you to navigate the documentation.

<snip>
 
T

Tor Rustad

TSB said:
I am newbie to computer languages, so anyone can tell me what the most
important things are to write a program?

deliver on time, with promised functionality, quality and price.
 
F

Flash Gordon

Richard Heathfield wrote, On 31/10/07 19:48:
Tor Rustad said:


On time; all the features; no bugs; within budget: pick any two.

Since "no bugs" is as near to impossible as makes no odds for a complex
piece of SW that only leaves three to select from.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,017
Latest member
GreenAcreCBDGummiesReview

Latest Threads

Top