Thinking like a programmer

Started by
15 comments, last by MeshGearFox 13 years, 1 month ago
Hey guys, i have been programming for the last year and a half, I am fluent in c++ and I am almost fluent in Java. However, the problem isn't learning the syntax for these languages, its learning to think like a programmer. Does anybody have anything they can recommend me doing to start thinking like a programmer?



Advertisement
Just keep programming. Eventually it'll come.
[size="2"]I like the Walrus best.
I am not sure how someone cannot think like a programmer after becoming fluent in a programming language. I guess you could try looking at things and thinking how you could program how they would work. Like if you see something swinging think about the algorithm you would use to make something do that. Or if you see a math equation think about how you program that to work out. If you are into game development, think about how you could create something you see and what kind of methods you would use. Other than that I think it is something that would just come to you with the more time you spend programming. I can't help but think like a programmer all the time and sometimes it is annoying. The reason I say annoying is because if I see something and get an idea, I cannot stop thinking about it till I get it down on code.
Maybe reading something like code complete will help?
There's no one way to think as a programmer. One good thing to do is familiarize yourself with the different programming paradigms like object oriented and procedural programming.
Solve lots of problems, think about how to solve lots of different types of problems. Read lots of stuff about programming. Be good at math and understanding mathematical languages. Write programs and read programs. Never stop learning.
Think, program, rethink how to improve you programed, program again to improve, rethink again, an endless loop and you will grow endlessly.
During that endless loop, reading some kind of good books on design patterns and refactoring may help you too.

https://www.kbasm.com -- My personal website

https://github.com/wqking/eventpp  eventpp -- C++ library for event dispatcher and callback list

https://github.com/cpgf/cpgf  cpgf library -- free C++ open source library for reflection, serialization, script binding, callbacks, and meta data for OpenGL Box2D, SFML and Irrlicht.


I am not sure how someone cannot think like a programmer after becoming fluent in a programming language. I guess you could try looking at things and thinking how you could program how they would work. Like if you see something swinging think about the algorithm you would use to make something do that. Or if you see a math equation think about how you program that to work out. If you are into game development, think about how you could create something you see and what kind of methods you would use. Other than that I think it is something that would just come to you with the more time you spend programming. I can't help but think like a programmer all the time and sometimes it is annoying. The reason I say annoying is because if I see something and get an idea, I cannot stop thinking about it till I get it down on code.



im talking about how to go about doing something. I wanna write a game:
so i first think ok the game needs :
graphics,
sound,
physics,
user input
etc.

after that its a blur, on how to do go about putting everything together



I tend to think one thing a lot of formal methods of teaching technical skills (the programming aspects of CS or engineering in large part) lacks is any instruction in creativity/design thinking. I am myself educated as a computer engineer, and there's something we tend to say from time to time and that is that one "thinks like an engineer" or doesn't. Perhaps its something that isn't really teachable, I don't know. I think the same basic way of thinking applies to programming. This is not to say you can't be a good programmer without this, but it works through a different mechanism.

A lot of people, including myself, describe thinking "like an engineer" or "like a programmer" as being able to sort of "feel" a problem and visualize its parts as well as possible solutions instead of the mathematical approach they tend to teach which is very paper-oriented and manual -- focused largely on canonical forms for things and "rules" rather than organic and creative design and problem solving. Its a peculiar ability, to be able to sense the scope and details of a project as if it were a physical object with parts which can be removed and moved around. Honestly, I don't think it is related to the knowledge of any language or method in any direct way. This is also why I tend to think that design based technical fields are not so mathematical and structured as many believe or would teach you -- rather there is plenty of room for creativity and organic development though it manifests differently than painting a picture or writing a book. Sorry for rambling, just my quick $0.02
There was a saying we had in college: Those who walk into the engineering building are never quite the same when they walk out.

im talking about how to go about doing something. I wanna write a game:
[...]

after that its a blur, on how to do go about putting everything together

Unfortunately, that is something you'll really only get a good handle on through experience. Choose an approachable game idea -- if this is your first game I would recommend something reasonably simple such as Pong or Tetris -- and set about trying to make it. Make sure you create a complete game, including the actual gameplay, menus, high-scores, pause screens, etc. Along the way you'll be forced to come up with ways to approach putting the whole thing together, and can ask for help or feedback on the areas that you can't figure out or where your own solutions seem sub-optimal.

Learn by doing. Hope that helps! smile.gif

- Jason Astle-Adams

This topic is closed to new replies.

Advertisement