Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Geek Culture / Few things about c++?

Author
Message
Diggsey
19
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 13th May 2009 17:01 Edited at: 13th May 2009 17:01
That article is contradictory, since in the programming methodology article linked to, it then says that "Object-oriented programming (OOP) has been developed since the early 1960s, and developed as the dominant programming methodology during the mid-1990s"

You obviously agree with the first article, I agree with the second, that OOP is a programming methodology, not fixed with the language.

mamaji4
22
Years of Service
User Offline
Joined: 24th Nov 2002
Location:
Posted: 13th May 2009 17:03 Edited at: 13th May 2009 17:09
Quote: "I truly haven't a clue what you're on about now..."


You start system design with the process of Requirements Analysis, followed by the design of an abstract model that meets those requirements. The choice of language(the implementation phase) is the last of these. I was trying to impress that people give too little importance to anysis and dsign and too much importance to the language of implementation, as the title of this thread indicates.

If you're doing mission critcal stuff where testing is an after-thought and the ABSENCE of bugs is tantamount you don't even use procedural or OO but formal methods found in functional programming, where program correctness is proved before implementation.

If at first you don't succeed, relax. You're like the rest of us.
Diggsey
19
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 13th May 2009 17:20
Right...
Not really sure what this has to do with anything, but still, I'd like to see an example of something that is not procedural OR OOP...

David R
21
Years of Service
User Offline
Joined: 9th Sep 2003
Location: 3.14
Posted: 13th May 2009 17:35 Edited at: 13th May 2009 17:49
Quote: "ou obviously agree with the first article, I agree with the second, that OOP is a programming methodology, not fixed with the language."


There is no contradiction in the article. You can adopt an OOP-like methodology (i.e style) with non-OOP languages if it is possible within the language. It doesn't change the paradigm of the language (which is still going to 'ground' the code to one side - i.e. you can adopt a procedural methodology with a purely OOP language. You're still using OOP whether you like it or not, regardless of the methodology). The whole point is, SmallTalk is a purely OOP language. That's the paradigm its in, and that's what it does. Your opinion on what OOP is/isn't is irrelevant.

Quote: "I'd like to see an example of something that is not procedural OR OOP..."


You've never used logic programming before? After blasting Jeku on the previous page, it seems the tables have turned on who needs to broaden their horizons

09-f9-11-02-9d-74-e3-5b-d8-41-56-c5-63-56-88-c0
Jeku
Moderator
21
Years of Service
User Offline
Joined: 4th Jul 2003
Location: Vancouver, British Columbia, Canada
Posted: 13th May 2009 17:51
Quote: "Well, if that's your opinion of what Object Oriented Programming is, then OK, but IMO, just because you are using build in objects, doesn't mean that your code itself is OO."


If you had, say, a Math object with a bunch of static functions for various calculations (i.e. dotProduct, crossProduct, normalizeVector, etc.), would you consider that OOP or procedural? You're merely calling a bunch of static functions in a class, of an object that isn't instantiated. Technically you could just as well have local functions that perform the same functionality, but you have them in a class to separate them out.

mamaji4
22
Years of Service
User Offline
Joined: 24th Nov 2002
Location:
Posted: 13th May 2009 17:53 Edited at: 13th May 2009 18:06
Quote: "
Right...
Not really sure what this has to do with anything, but still, I'd like to see an example of something that is not procedural OR OOP...
"


http://en.wikipedia.org/wiki/List_of_programming_languages_by_category

It all depends on what level you're talking about. At the modelling level there are a multiplicity of paradigms. At the machine instruction level everything is purely procedural.

If at first you don't succeed, relax. You're like the rest of us.
Michael P
19
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 13th May 2009 18:01
By definition, if you write a program that contains one class with several static methods (and nothing else), you are programming procedurally. It doesn't matter if the language is purely object orientated, you can still program procedurally so long as static methods are supported. If the class is never used to create an object then you are programming procedurally. Its only when you create non static members that you are doing anything object orientated.

Jeku
Moderator
21
Years of Service
User Offline
Joined: 4th Jul 2003
Location: Vancouver, British Columbia, Canada
Posted: 13th May 2009 18:02 Edited at: 13th May 2009 18:05
^^ Agreed, although I'd venture to guess most of the Dark GDK.NET games are programmed procedurally, merely using the (I assume) static methods of the API. Old procedural BASIC habits die hard.

NeX the Fairly Fast Ferret
20
Years of Service
User Offline
Joined: 10th Apr 2005
Location: The Fifth Plane of Oblivion
Posted: 13th May 2009 18:09 Edited at: 13th May 2009 18:10
Indeed. I can't work in OO. It just gives me a right banging headache thanks to four years of QBasic, two years of DBC and two years of DBP...

Especially debugging. With procedural I find it easy to follow where the code went. My sloppy objects and classes make it hard to find the faults.

mamaji4
22
Years of Service
User Offline
Joined: 24th Nov 2002
Location:
Posted: 13th May 2009 18:17
Quote: "Old procedural BASIC habits die hard."


And that's the point I was trying to make when I quoted Djikstra
"It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration."

If you want to break the procedural mindset and move to OO concepts its tough. But Smalltalk can help, much more than other "impure" OO languages.

If at first you don't succeed, relax. You're like the rest of us.
Mr Z
17
Years of Service
User Offline
Joined: 27th Oct 2007
Location:
Posted: 13th May 2009 18:43
Quote: "
"It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration.""


Actually it has become the oposite for me, started with BASIC, now in Java and have hard to think of larger complexities without using objects . Simple programs is one thing, but the habit of OOP is built into my spine.

There is no greater virtue, then the ability to face oneself.
mamaji4
22
Years of Service
User Offline
Joined: 24th Nov 2002
Location:
Posted: 13th May 2009 18:54
To answer the original question posed by the thread. Scheme is an alternative to BASIC or C++ as an initial language.

If at first you don't succeed, relax. You're like the rest of us.
ionstream
20
Years of Service
User Offline
Joined: 4th Jul 2004
Location: Overweb
Posted: 13th May 2009 22:28
I remember I went on the GameDev IRC room just for the heck of it, and they were yelling at some guy because they claimed that because he wasn't using Liskov's Substitution Principle (which they abbreviated LSP to make it as unclear and elitist as possible) he wasn't really programming in an object oriented way. I hadn't heard of Liskov or his principle beforehand, and I don't care if I follow his principle in my program. The truth is that OOP is so loosely defined that it can be done in procedural languages; you don't have to follow any one guideline. LSP might be nice, along with inheritance and polymorphism and all of the other designs that come along with traditionally object oriented languages, but they are in no way required in OOP.

Anyways, I'm gonna say that Python is a really good language to start with, because the syntax is clear, can be object oriented when the learner is ready, and it doesn't take much to set it up. Also there's a lot of documentation on it. I'm using Python now to prototype a new design scheme that I want to port over to my C++ game projects.

Jeku
Moderator
21
Years of Service
User Offline
Joined: 4th Jul 2003
Location: Vancouver, British Columbia, Canada
Posted: 14th May 2009 02:17
I have a question: Is there any point in learning a computer language if you're only planning on using its full power "when you're ready"? I mean, if you're going to learn C++, you might as well dive headfirst into OOP. Why start with pure procedural programming and wait for some arbitrary date "when you're ready" before you jump in? It will be almost as confusing going from procedural C++ to OOP C++ as it would be to move from DBP to OOP C++.

In other words, if you're just planning on scratching the surface with C++ and you still have a huge main function and goto's everywhere, you might as well not even be using the language.

Lazlazlaz 1
19
Years of Service
User Offline
Joined: 18th Sep 2005
Location: England
Posted: 14th May 2009 03:22
Quote: "In other words, if you're just planning on scratching the surface with C++ and you still have a huge main function and goto's everywhere, you might as well not even be using the language."


You would still need to learn the basics of syntax and semantics first though, it would ridiculous to make objects the first thing you look at. "When you're ready" is the point when you have a grasp of how to order statements and perform the generic functions of all programming languages.

DarkGDK is good
zarock
17
Years of Service
User Offline
Joined: 1st Jan 2008
Location: lost in space
Posted: 14th May 2009 04:09
HA HA HA HA wow were is this topic going? i thought it was going to die down then boom 65 post wow i feel special now
lol

Proud lead creator of the 18 and in spare time maker of crappy MP maps
Kevin Picone
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 14th May 2009 06:03
Quote: "Is there any point in learning a computer language if you're only planning on using its full power "when you're ready"? "


People learn progressively, Bread crumb by bread crumb..

Jeku
Moderator
21
Years of Service
User Offline
Joined: 4th Jul 2003
Location: Vancouver, British Columbia, Canada
Posted: 14th May 2009 07:47
Well ok maybe I should reword my question. What's the point of moving from one language to another and just learning how to do procedural programming in the new language? An example would be moving from DBP to Dark GDK.NET and just using a big main function. You can't really say you have "learned" the new language, and you are bringing your bad habits with you. Of course, if this is just a hobby, it doesn't matter in the end

Michael P
19
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 14th May 2009 10:17
Initially the basics need to be learned, because without the basics it is near impossible to make progress. After learning the basics, then other things should be learned. Moving from DBP to C++ is not straightforward; even if object orientated programming is avoided there are still difficult things to deal with such as C strings. There's a reason why babies crawl before they walk, because they first have to master the basics of movement

Also, it isn't right to say that object orientated programming is inherently superior to procedural programming. Although I and most people find it very useful, there are still situations where procedural programming is better.

Login to post a reply

Server time is: 2025-06-05 02:22:12
Your offset time is: 2025-06-05 02:22:12