Hi,
I have been learning some programming on my own for the last 2 years but I still haven't accomplished much.
I think the problem isn't the syntax of the languages I learn but rather that I still am not able to think like a programmer should be.
Most of the books (I dare say almost all of them) out there about programming focus so much on syntax but not on logical thinking like a programmer should do.
After reading a bit on google I found out that you first have to learn how to think like a programmer.
Can you guys help me out here?
I'm focusing on Java (school purposses) for GUI programming and on PHP (in my free time) for web development.
(I'd like to do both of them in OOP)
Learn to think like a programmer???
Started by Coldhearth, Nov 04 2009 02:28 PM
16 replies to this topic
#1
Posted 04 November 2009 - 02:28 PM
|
|
|
#2
Posted 04 November 2009 - 03:16 PM
Assume that you are talking to a retarded individual with no common sense and is very naive and you'll be getting close to how we think about computers... Here's a breakdown.
1. Retarded: They only know what you tell them.
2. No Common Sense: You have to tell them how to do everything
3. Naive: They take you very, very literally, no matter what you say.
That's a good place to start. But I imagine you're looking for more than that. The biggest thing is to start thinking linearly. Learning how to think "what steps to get me from here to there" is the biggest key. Remember the basic cycle of programs.... Input, Processing, Output.... Processing is the getting here to there.
1. Retarded: They only know what you tell them.
2. No Common Sense: You have to tell them how to do everything
3. Naive: They take you very, very literally, no matter what you say.
That's a good place to start. But I imagine you're looking for more than that. The biggest thing is to start thinking linearly. Learning how to think "what steps to get me from here to there" is the biggest key. Remember the basic cycle of programs.... Input, Processing, Output.... Processing is the getting here to there.
#3
Posted 04 November 2009 - 03:25 PM
Thx for your comment :) I'll keep those rules in mind...
You say start thinking linearly... but what about object orieneted programming.
I really find it hard to learn to think this way to write programs in an OO language :(
Any more tips on this? :)
You say start thinking linearly... but what about object orieneted programming.
I really find it hard to learn to think this way to write programs in an OO language :(
Any more tips on this? :)
#4
Posted 04 November 2009 - 04:23 PM
Quote
1. Retarded: They only know what you tell them.
2. No Common Sense: You have to tell them how to do everything
3. Naive: They take you very, very literally, no matter what you say.
2. No Common Sense: You have to tell them how to do everything
3. Naive: They take you very, very literally, no matter what you say.
Hahah, this is the best and most accurate description for a computer i've ever heard!
#5
Posted 04 November 2009 - 08:14 PM
Programming is a lot of problem solving. It is also a process.
I usually go like this:
1. I have a problem.
2. I get a good idea of how I would implement a solution.
3. I start making functions to automate tasks the program will do.
4. I write the program, thinking about the design goals.
5. I make sure to include comments to remind me later.
6. I test it out.
7. I fix any bugs I find.
8. I test my bug fixes.
9. I may add more features.
Maybe you should pick up books on programming methodology, theory etc. I have also heard that learning lisp may improve your overall programming skill.
I usually go like this:
1. I have a problem.
2. I get a good idea of how I would implement a solution.
3. I start making functions to automate tasks the program will do.
4. I write the program, thinking about the design goals.
5. I make sure to include comments to remind me later.
6. I test it out.
7. I fix any bugs I find.
8. I test my bug fixes.
9. I may add more features.
Maybe you should pick up books on programming methodology, theory etc. I have also heard that learning lisp may improve your overall programming skill.
Root Beer == System Administrator's Beer
Download the new operating system programming kit! (some assembly required)
Download the new operating system programming kit! (some assembly required)
#6
Posted 05 November 2009 - 02:10 AM
Oh okay :) and does anyone have some good books about programming methodology that make you help learning how to think to create OO programs?
#7
Posted 05 November 2009 - 02:53 AM
If you are focusing on java, you should try "Object-oriented programming and Java (Second edition)" by Danny Poo, Derek Kiong, Swarnalatha Ashok. It starts with setting the right mindset.
#8
Posted 05 November 2009 - 03:03 PM
You simply have to think of objects as just that.... Objects.... For instance, a car object might contain variables such as engine size, tire size, gas tank level, and it might contain functions such as StartEngine() and HonkHorn()....
For instance, a "form" object, (the name of windows, in windows. ;) ) has a string for it's title, integers for it's x/y position, it's size, etc..... Objects are used to group functions and variables together that belong together.
Another thing that's nice about objects is, once you define the object, you can declare as many of them as you like. For instance, the car object we talked about above... I can define it with those items, then use that definition to declare a car object named "WifesCar" and "MyCar" and "NeighborsCar".
Really to a large extent objects are similar to structures in C, except with objects you can place function code inside the definition.
For instance, a "form" object, (the name of windows, in windows. ;) ) has a string for it's title, integers for it's x/y position, it's size, etc..... Objects are used to group functions and variables together that belong together.
Another thing that's nice about objects is, once you define the object, you can declare as many of them as you like. For instance, the car object we talked about above... I can define it with those items, then use that definition to declare a car object named "WifesCar" and "MyCar" and "NeighborsCar".
Really to a large extent objects are similar to structures in C, except with objects you can place function code inside the definition.
#9
Posted 05 November 2009 - 03:13 PM
Hmmm thx for the response :)
I think my problem is that the "click" just hasn't come for me yet.
I have a friend that had programming in school and he said you have to have a click in you head and that you then start to understand how to think and solve a problem in an OO way...
Is it a good idea to read about java and make as much exercises as possible gradually increase the difficulty of the exercises?
I think my problem is that the "click" just hasn't come for me yet.
I have a friend that had programming in school and he said you have to have a click in you head and that you then start to understand how to think and solve a problem in an OO way...
Is it a good idea to read about java and make as much exercises as possible gradually increase the difficulty of the exercises?
#10
Posted 05 November 2009 - 03:41 PM
It is always good to practice a lot and gradually increase difficulty.
I've bee procedural programmer for many many years, and is right now taking my first java course, having cheated a little by starting to understand OOP in PHP first, but it is absolutely a different mindset.
I would say that the procedural way, you think on what needs to be done.
but in OOP way, you think what am I working with, and what can be done to it?
I've bee procedural programmer for many many years, and is right now taking my first java course, having cheated a little by starting to understand OOP in PHP first, but it is absolutely a different mindset.
I would say that the procedural way, you think on what needs to be done.
but in OOP way, you think what am I working with, and what can be done to it?
__________________________________________
I study Information Systems at Karlstad University when I'm not on CodeCall
I study Information Systems at Karlstad University when I'm not on CodeCall
#11
Posted 05 November 2009 - 03:54 PM
That's probably the best way I've heard that explained..
#12
Posted 06 November 2009 - 09:14 AM
Usually, people use very simplistic (ie: useless) examples of objects, like cat, dog, animal, etc. Ultimately, it comes down to a different way of organizing your code.


Sign In
Create Account


Back to top









