Hi guys... i'm new to this site, and i really wanted to learn even deeper. I'm confused if how to identify a beginner or not.. But anyways, I wanted to ask if is it ok to use several goto statements, because I created a simple game but I noticed there were many goto statements, is this ok? or never been ok? please help! :(
Even to use only one goto statement is very bad and that says about the programmer that he is of very low qualification!
C/C++ programmer shall forget that there is the goto statement in C/C++.
oh.... thanks! that's better... :D one more thing... I used the procedural way of programing and never been yet too familiar on OOP... Is it ok? or do I really need to learn OOP?
procedural: learn a BASIC like language or go with strict C
OOP: go with C++ and use object oriented concepts. Just a few parts of your code should be procedural outside an object oriented scope.
OOP is not a set of some syntactical constructions as someone can think. It is the mode of thought. You can write OOP programs even in C where there is no such a set of syntactical constructions.:)
Then I just have to remove all gotos and revise it... Thanks guys! Now I know why... I had this teacher who uses several gotos in his/her program, and I read an article about gotos that it's never been cool using it and I became confused... now I know. :D
Many teachers who have to teach you/us programming aren't experienced enough to do it the right way. They have learned programming in the 80's/90's with languages like GWBasic or something like that. And this is not the current state of technology ;o)
You will find that people say avoid it at all costs. I would say don't look to it as your first solution, there are often better ways, but don't fear it.
Your exposure to OOP will really depend on where you are in programming right now.
If you've not come across classes and the like yet, then you'll have had little much do to with it. When you start playing with classes and, in turn, utilise principles such as encapsulation, inheritance and polymorphism you'll then start to understand the benefits of OOP.