Click here to Skip to main content
15,919,931 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Good evening everyone,this is the problem.
I have mid-term exam next week but that's no he problem :-D .
I'm good at programming the old fasion way ,you know ... tell what you want and I'll write the code.
It's not the way it works with my proffessor.
He gives us parts of code and we should conclude the output :sigh: .
Is there any tips you can help me with ??
thanks
Posted

0) Learn to analyze code. That's what he's trying to teach you.

1) Pretty much ANYBODY can write code (just look at all the VB code out there). It takes a real programmer to be able to read someone else' code and determine where they went wrong. This is a task you OFTEN have to perform in the real world.

2) Learn to spell.

3) Learn to proofread.
 
Share this answer
 
v3
Well, I think that depends on the complexity of the code you're given. If it's a complex project with lots of code spread across dozens of files there are some tools in Visual Studio to help you(find in files, go to declaration, etc); if it's just a simple "what does this 5 line snippet print?" question then all it is is a matter of thinking like the compiler.

Of course, if you have a compiler handy then it's easiest to run it and see what it does, particularly if you step through it line by line using a debugger. Then you can see all of the variables as they change and what each line of code does to them.

Either way, being able to figure out somebody else's code is an important skill to have so don't blow it off!
 
Share this answer
 
I think reading/analyzsing code requires practice and you get better with time. For practice you could find an open source project on the internet and take a look at its source to figure out how it operates. Additonally, you may want to check out a book called "Code Reading: The Open Source Perspective" by Diomidis Spinellis
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900