How would make this tutorial code print points incorrect order
sonar87 - Nov 03 2018 07:42 PM
set property with HTML content as string in from include not possible
LDDbyD - Oct 01 2018 06:33 AM
Recent Blog Entries
Recent Status Updates
- Managed C++
- Visual Basic 4 / 5 / 6
- linked list
- hello world
Learn to think like a programmer???
Posted 07 November 2009 - 10:24 AM
1. Figure out what the problem is.
2. Write a plan or pseudocode (sometimes mental) for how the program is going to solve the problem.
3. Break the pseudocode into modules.
4. Break the modules into even smaller modules.
6. Write the program one module at a time.
7. Test the program and find out that it doesn't work.
8. Go back and fix errors. This is the most frustrating part, and also the part I spend 90% of my time on.
9. Repeat steps 6, 7, and 8 as long as necessary.
10. Find that the program works, and then do my "happy dance" for about five minutes.
I've used this method for writing sorting algorithms, recursive algorithms, Unix file utilities, and just about everything else.
For reading and modifying programs:
1. Look at the code and be totally mystified by it.
2. Mark all of the modules in Vim (my text editor).
3. Write mini-programs mimicking each of the modules to see what it does.
4. Figure out how to fix the code.
Posted 07 November 2009 - 10:30 AM
Really to a large extent objects are similar to structures in C, except with objects you can place function code inside the definition.
I've always thought of objects as temporary records that can be created from templates. I never really got that far in C though.
Posted 07 November 2009 - 11:02 AM
Templates are a good way to think of objects, to a certain extent. You have to remember that we are thinking in terms of real world objects though.
Well, I think objects can be more abstract than that. For instance, in Java, classes are used to contain modules of code, not necessarily representing a real world object. They also have a lot of other uses, such as protecting variables by making them private.
That said, the way I see it, the main difference between OOP and procedural programming is that in OOP the modules are nouns while in procedural programming the modules are verbs. Then again, I'm not an experienced programmer and have minimal knowledge of abstract computer science, so my views may be somewhat naive.
Posted 07 November 2009 - 12:07 PM
My MineCraft server site: http://banishedwings.enjin.com/