good programming

22
1

Upload: bilal-zaka

Post on 18-Jul-2015

35 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: GOOD PROGRAMMING

1

Page 2: GOOD PROGRAMMING

WHAT IS PROGRAMMING

? Process of writing computer programs

Creative process that instruct a

computer on how to do task

2

Page 3: GOOD PROGRAMMING

3

Page 4: GOOD PROGRAMMING

FEAR AND SELF DOUBT

Think you're not good enough, not smart

enough: that you have the wrong type of

brain, and you'll just never get it.

4

Page 5: GOOD PROGRAMMING

MESSY CODE

FORMATING Didn’t indent your code

Inconsistent use of new lines and white

space

5

Page 6: GOOD PROGRAMMING

Inconsistent use of upper and

lower case letters

Uses both cases of letters

6

Page 7: GOOD PROGRAMMING

Bad variable and function name

Single name variables

No relation between variable and its

function

7

Page 8: GOOD PROGRAMMING

Over-commenting

Commenting on every step

Uses useless comments

8

Page 9: GOOD PROGRAMMING

Not knowing the full expressive

power of your language

Don’t have the knowledge of operators

Confusing between syntax of two

languages

9

Page 10: GOOD PROGRAMMING

Thinking u know it all

Thinking yourself a professional

Forgot that you are learning

10

Page 11: GOOD PROGRAMMING

11

Page 12: GOOD PROGRAMMING

Patiently read the full question or listen

the instructions

Make a rough sketch

12

Page 13: GOOD PROGRAMMING

Think about the logic of program and

then think about the method you are

going to use

13

Page 14: GOOD PROGRAMMING

Take the time to write down what goals

the end product needs to achieve, and

who your user base will be. Clarity of

thought at this stage will save a lot of

time down the line.

14

Page 15: GOOD PROGRAMMING

Go to modular approach that is divide

your task into small fragments

15

Page 16: GOOD PROGRAMMING

If you think that your code might need

explanation, comment it. Remember to

update the comments when you update

your code!

16

Page 17: GOOD PROGRAMMING

Indent your code

17

Page 18: GOOD PROGRAMMING

Start by testing each module on it's own,

using inputs and values that you would

typically expect. Then try inputs that

are possible but less common.

Incorrect values. Use zero for a value

that will be used in division, or a

negative number when positive is

expected or when a square root will be

calculated.

18

Page 19: GOOD PROGRAMMING

Programming is not a stagnant

discipline. There's always something

new to learn, and - perhaps more

importantly - always something old to

relearn.

19

Page 20: GOOD PROGRAMMING

Take responsibility for your own career

Q/A yourself

20

Page 21: GOOD PROGRAMMING

When programming something complex, it helps to get the simpler building blocks in place and working properly first.

This approach naturally lends itself to modular code writing, where each component is in its own self-contained block. This is very useful for code reuse and makes for much easier debugging and maintenance.

21

Page 22: GOOD PROGRAMMING

Read books, magazines, blogs, Twitter

feeds, and websites. If you want to go

deeper into a subject, consider joining a

mailing list or newsgroup.

If you really want to get immersed in a

technology, get hands on—write some

code.

22