Actually when i thought to write such an article i thought of me I am a junior developer and when I see the books I found a lots of books talking about from expert to expert and from developer to developer and i thought that if we begun to write an article cause I'm not qualified to write a book it will be great for all the people who r new in the programing and developing first i will not start from zero because i think my audience is good at that and i 'll not be talking about languages because there are too many on that what i 'll be talking about is how to think in a big problem not in size but also in its degree
to think in a problem first thing u get to do is to divide it into small problems
and solve it with paper not with computer and see what you are doing with your mind and make the computer think the way you are thinking
example
if u asked to make a program to convert from decimal to binary system using the c programing language
i know that it is very hard to juniors
first what I'm gonna to do I'm gonna to do it with paper
what u gonna to do on the paper u gonna to do that let x = 8
8 | 2 0
4 | 2 0
2 | 2 0
1 | 2 1
0 // and here the problem is over u get it back and it is represented in 1000
do the same on c
int x ;
scanf("%d",&x);
//if see above u will find that you have terminated the program when u find zero tell the computer to //terminate to when it finds zero Like this
while (x != 0)
{// what u did on paper was is to divide and then u get the remainder but in programing u must
// u must think how will u make the program know the answer first so u must take the mod //first and then make the devision like this
y = x % 2;
x /= 2;
printf("%d",y);
}
now the problem didn't solved yet so u have to think how to solve it the now the numbers is written in reverse how to make it written in the right way
walid bakr
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment