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
zarock
17
Years of Service
User Offline
Joined: 1st Jan 2008
Location: lost in space
Posted: 9th May 2009 21:49
Ok well im not sure if this is the right fourm to post in or not, so here it goes....

I being my crazy self decided i thought it would be fun to learn how to program. i know there is C C++ java script dark basic and about a million other things you can program with, so i just picked C++.

ok so now i am wondering? Is it hard to learn? do i need to buy anything for it? and so on and so on. I know I need a compiler (no clue what that is) but what else would i need?

Just simple stuff like that. Thanks in advance for any help, and helping this poor little noob on his way.

Proud lead creator of the 18 and in spare time maker of crappy MP maps
NeX the Fairly Fast Ferret
20
Years of Service
User Offline
Joined: 10th Apr 2005
Location: The Fifth Plane of Oblivion
Posted: 9th May 2009 22:03
Go get a copy of Microsoft Visual C++ if you are interested in the Microsoft side of things (DirectX, etc.) or a copy of Code::Blocks if you want to develop in the Linux way for Windows, Linux, Mac OS X and pretty much everything UNIX. (Using OpenGL, etc.) It is NOT an easy language to learn.

Yodaman Jer
User Banned
Posted: 9th May 2009 22:05
Start with BASIC. Then, once you've gotten the hang of it, progress towards more advanced languages like C++. It will take you several months to get the hang of programming in any language, but if you persevere you'll do well.

"If you want lots of people to play your game make it simple; lots of people are simple." -Obese87
NeX the Fairly Fast Ferret
20
Years of Service
User Offline
Joined: 10th Apr 2005
Location: The Fifth Plane of Oblivion
Posted: 9th May 2009 22:07
If you learn BASIC heavily, though, adjusting to C/++ is very difficult. It's taken me a year and a half to adjust to C from eight years of BASIC because I couldn't grasp the concepts.

David R
21
Years of Service
User Offline
Joined: 9th Sep 2003
Location: 3.14
Posted: 9th May 2009 22:09 Edited at: 9th May 2009 22:11
If you do not learn BASIC beforehand, and you're OK to leave your comfort zone in order to progress, learning the foundations of C++ and becoming competent is a piece of cake.

I knew/used DBC and DBP for a long while, and switching to C++ is OK - but I had to disregard practically everything I knew about programming from BASIC etc. and fallback to languages I had learnt beforehand. BASIC is a big choke point if you're trying to learn C/C++ because they are explicitly designed to be completely different from each other

09-f9-11-02-9d-74-e3-5b-d8-41-56-c5-63-56-88-c0
Benjamin
22
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 9th May 2009 22:15 Edited at: 9th May 2009 22:15
I'd also advise just going straight to C++. You can download Visual C++ 2008 Express from here (it's free).

Yodaman Jer
User Banned
Posted: 9th May 2009 22:45
Yeah, I agree with the others actually. I kind of started learning C, and it's a lot different than BASIC. Therefore it will probably be easier for you to just start out in C++, but keep in mind it will take a lot of work and concentration from you. You have to keep persevering, and be patient. I learned that the hard way.

"If you want lots of people to play your game make it simple; lots of people are simple." -Obese87
NeX the Fairly Fast Ferret
20
Years of Service
User Offline
Joined: 10th Apr 2005
Location: The Fifth Plane of Oblivion
Posted: 9th May 2009 22:47
The most difficult things switching from BASIC to C++ are:

Changing from procedural to Object Orientated programming
Learning how ALL of the symbols can be used to their full advantage
Not making mistakes with pointers and causing crashes no debugger will catch
(if using C rather than C++) Manually managing strings using pointers, malloc, memcpy and free

zarock
17
Years of Service
User Offline
Joined: 1st Jan 2008
Location: lost in space
Posted: 9th May 2009 23:22
Wow ok thanks everyone for the help.
so let me get this stright, basic is easier (spelling?) than C++ but if i wanted to change to C++ i would have a hard time? And really my friend told me that in basic you could in turn write an editor or what not, kind of like FPSC. that was my overall goal of what i wanted to do with programming.

So do i use C++ or basic/pro For programming?

sorry for the late reply i was at the new skate park in town.

Proud lead creator of the 18 and in spare time maker of crappy MP maps
NeX the Fairly Fast Ferret
20
Years of Service
User Offline
Joined: 10th Apr 2005
Location: The Fifth Plane of Oblivion
Posted: 9th May 2009 23:29
You could write an editor with either. There's little limit to what you can do with BASIC or any dialect of C/C++; they all have their uses (owing to speed, ease of use, debugging capability and limitations) and at the end of the day it's all about choosing the right tool for the job.

Yodaman Jer
User Banned
Posted: 9th May 2009 23:30
BASIC is easier to grasp at first, but changing to C/C++ is hard after you've learned BASIC. I know my first post said 'learn BASIC first', but after reading other comments I realized that I was kind of wrong. Yeah, it's what I started with, but I wish I had started with a more advanced language. I don't regret my decision though, despite my having a hard time moving on to another language.

Quote: "my friend told me that in basic you could in turn write an editor or what not, kind of like FPSC."


You can do that in any language really. File in-out (I/O) is kind of tricky though, and if that's what you think your first program is going to be... I recommend starting out with something simple. You can do some really simple file I/O programs, like just writing string variables to a .txt document and then loading it again, but don't expect to be able to write your own level editor/graphics application anytime soon. That takes a lot of work and dedication. Starting out small and simple is the way to go; trust me.

Quote: "So do i use C++ or basic/pro For programming?"


Whatever you want. If you think you can use C++, go for it. But if you want to learn the basics, go with BASIC.

"If you want lots of people to play your game make it simple; lots of people are simple." -Obese87
zarock
17
Years of Service
User Offline
Joined: 1st Jan 2008
Location: lost in space
Posted: 9th May 2009 23:47
ha ha ha i know its not going to be easy i just wanted that to be my long term goal. Ok one more question.

How hard do you think it would be to work with both basic and C++ at the same time? like would it be harder or would it help get the grasp of it quicker?

Proud lead creator of the 18 and in spare time maker of crappy MP maps
Aaron Miller
19
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 9th May 2009 23:56 Edited at: 9th May 2009 23:58
@Zarock
Is that you zack? If it's not, sorry, you sound a lot like someone I know.

Anyways, my advice would be to look at C++ and BASIC (DBPro is by far the easiest BASIC I've seen out there -- not the best, just the easiest.)

If your overall goal is to make an editor, like FPSC's, or a game creation tool, like FPSC, then use DarkGDK + MSVC++ -- both are free (unless you want to sell what you make, in which case you have to pay for a license ofr DarkGDK.)

Look, here's a simple example of using DBPro to output the sum of two variables:


In DarkGDK, the easiest way I know of would be:


Although you have to do more to get C++ to work, the advanced features in C++ that are pretty much essential for any large project, such as an editor, are much harder to replicate in a BASIC language -- at least efficiently.

In addition, whenever you write code in C++ it is almost ALWAYS faster and smaller (in assembly output) than the same code you write in BASIC.

EDIT: It wouldn't necessarilly be difficult to learn both at the same time. It'd probably make it easier to evaluate which one you'd prefer to use. Just give each language an equal chance.

Cheers,

-naota

Check out my OS
[href=Dragon OS]http://code.google.com/p/dragon-os/[/href]
zarock
17
Years of Service
User Offline
Joined: 1st Jan 2008
Location: lost in space
Posted: 10th May 2009 00:13
Ummm zack? nope im bob the builder.... ha ha but really no im Chris sorry. Anyway thanks i'll look into MSVC++ if it works for my long term goal.

Proud lead creator of the 18 and in spare time maker of crappy MP maps
DB PROgrammer
18
Years of Service
User Offline
Joined: 9th Feb 2007
Location: Nowhere But Everywhere
Posted: 10th May 2009 00:19
Am I the only one who found switching from DarkBasic to C++ simple? Although, I had tried other things before sticking with DBPro so maybe that's why?

I would go with Basic. It sounds like it will do everything you need and will be easier to learn.


DBPro, limited by the programmer.
Michael P
19
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 10th May 2009 00:20
There are alot of similarities between all languages, the core principals are the same. In my opinion it isn't THAT difficult to switch from BASIC to C++ for this reason.

To begin with you can write code in a similar way to how you would in DBP. After a while you pick up new techniques such as pointers, dynamic memory and object orientated programming. In your own time you can begin using these techniques.

I would start with C++ because DBP lets you do lots of sloppy things that C++ does not. C++ taught me how to debug complex problems, and has taught me to write efficient and easy to read code. An example of sloppiness in DBP is how you don't have to define variables. If you miss spell a variable, it will initialize it for you with no warning! That can be painful to debug in large applications.

Aaron Miller
19
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 10th May 2009 00:29 Edited at: 10th May 2009 01:35
Oh yeah, btw:

compiler - The compiler turns source code, such as C++ or DBPro source code, into an executable file (in Windows, this is a .exe or .dll -- DBPro doesn't allow the creation of .DLLs)
IDE (integrated development environment) - This is a special text editor intended to be used for one or more programming languages. You use it to write your source code, manage your project(s), and compile your project(s). It will also usually provide debugging facilities.
debugger - Special software used to help you look at your variables, functions, etc. Most debuggers allow you to set breakpoints (which causes code to stop running momentarilly so you can see what's going on) and allow step by step execution -- which executes only one command at a time -- again for debugging purposes. This is used to help you find bugs. At first I didn't use debuggers, but eventually I found them extremely useful.

Cheers,
-naota

dab
20
Years of Service
User Offline
Joined: 22nd Sep 2004
Location: Your Temp Folder!
Posted: 10th May 2009 00:54
I personally learned PHP before moving on to C(++). I mean, I learned Basic to understand how programming languages work (how to use if statements etc). Then I went on to PHP to get to grasps of another language. Now I'm on to C++ where I'm learning to be efficient and stuff. :+

It's all about how you want to learn.

Need a new hideout for all your conversations? Join dab-Media IRC. irc.dab-media.com:6667
Need PHP coding done? Contact me. Jobs done for as little as $15/hour! Email me for more information.
JoelJ
21
Years of Service
User Offline
Joined: 8th Sep 2003
Location: UTAH
Posted: 10th May 2009 03:32
I would download Eclipse or Netbeans for C++ development. Visual Studio is amazing for C#, but I haven't been too impressed with it for C++. I like Eclipse a lot more for my C++ development. I used Netbeans a bit at first, and I really liked it as well.

Your mother has been erased by a mod because it's larger than 600x120
Jeku
Moderator
21
Years of Service
User Offline
Joined: 4th Jul 2003
Location: Vancouver, British Columbia, Canada
Posted: 10th May 2009 08:56 Edited at: 10th May 2009 08:56
@Aaron Miller - Your code example is just outlining semantics-- differences in syntax, really. The real power of C++ lies in its ability to use objects, inheritance, polymorphism, and other advanced, cool things like pointers. You can't really even make a valid side-by-side comparison without having two completely different looking code examples.

Mr Z
17
Years of Service
User Offline
Joined: 27th Oct 2007
Location:
Posted: 10th May 2009 15:22
Depends. You could take another rout, and go C# or Java, and then when you learned that switch to C++. Anyway, C++ if often regarded as one of the most powerful languages. It does not put on restrictions on the programmer, and you can do pretty much anything in it, including, say, create an own operating system, something you can´t do in BASIC. But because of this, it is also more complicated. You need to learn to work with pointers and such, and manage memory yourself.

There is no greater virtue, then the ability to face oneself.
mamaji4
22
Years of Service
User Offline
Joined: 24th Nov 2002
Location:
Posted: 10th May 2009 16:44
Quotes by Edsger Dijkstra, one of the founding fathers of Computing

"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."

"Object-oriented programming is an exceptionally bad idea which could only have originated in California."

That should help you decide whether to learn Basic or C++ or both, and which one you should learn first, if at all.

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: 10th May 2009 17:15
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."

"Object-oriented programming is an exceptionally bad idea which could only have originated in California.""


Well, both of those statements don't hold true in my experience

Firstly, not all BASIC dialects are procedural, secondly, I learnt BASIC long before C++, and found C++ easy to switch to once I had learnt what headers you need for standard things, etc, and you need to just learn that whatever dialect you start with.

All programming languages are essentially the same thing. They all get compiled to a similar set of ASM instructions (If not at compile time, at runtime) and all software that runs on Windows/Mac/Linux all have the concept of the stack and the heap, etc. OOP can be emulated in a procedural language, and all OOP languages can be used procedurally. Once you have learnt one programming language, whatever it is, the others will just follow naturally with much less effort than learning from scratch

mamaji4
22
Years of Service
User Offline
Joined: 24th Nov 2002
Location:
Posted: 10th May 2009 17:39 Edited at: 10th May 2009 18:03
Some more quotes from Djikstra
"Computer science is no more about computers than astronomy is about telescopes."

"Program testing can be used to show the presence of bugs, but never to show their absence!"

Functional programming is something else to look at. The Japanese think that formal techniques are more important than Object Oriented ones.

Quote: "and all OOP languages can be used procedurally. "

Smalltalk might beg to differ

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: 10th May 2009 18:52
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."

"Object-oriented programming is an exceptionally bad idea which could only have originated in California.""

I disagree with both, especially the last one. I love object orientated programming, I have found it extremely useful.

Aaron Miller
19
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 12th May 2009 00:59
Quote: "Your code example is just outlining semantics-- differences in syntax, really."

That was the point.

Quote: "Object-oriented programming is an exceptionally bad idea which could only have originated in California."

That's a bunch of BS.


Okay, here's one good example of the differences between DBPro and C++ -- as far as I know DBPro doesn't let you inherit from other types, so, look at this DBPro code:


Notice how I had to use tBasicObject above to add to tPlayer -- I could have also copied the fields from tBasicObject. This is fairly inefficient. Now, look at the following C++ code that uses inheritence.


Much easier. In DBPro, I would've had to access the data like this:
plr as tPlayer
plr.baseObj.FIELD = DATA

In C++ I could just do this:
sPlayer plr;
plr.FIELD = DATA;

Much easier, and quicker.


NOT the best example, but a good example IMO.

Cheers,

-naota

Jeku
Moderator
21
Years of Service
User Offline
Joined: 4th Jul 2003
Location: Vancouver, British Columbia, Canada
Posted: 12th May 2009 05:49 Edited at: 12th May 2009 05:50
Ouch, if you're going to use C++ you might as well use classes, not C structs Does anyone here know if a C++ class is just a special kind of struct at the API level?

dark coder
22
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 12th May 2009 08:38
Quote: "Ouch, if you're going to use C++ you might as well use classes, not C structs"


But he was comparing it to DBPro UDTs whose contents are always public, so if he used a class he'd have to waste an extra line to change the access level with otherwise no difference.

Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 12th May 2009 19:58
For me switching from darkbasic to c++ was easy. i'm not great at c++ yet but i do have a handle on things and am learning. and really it's how you look at things. When i started c++ i looked at things that were similar to darkbasic and i understood it. Pointers and things are really easy in my oppinion. they are just what the name implys. pointers to memory. as for everything else i stick with my above statement it's how you look at it. if you go in thinking "This is gunna be hard!" then ya it's guna be hard but if you go in thinking "Oh wow thats cool. wow didn't know that!" it's fun and therefore easy lol

New Site! Check it out \/
Aaron Miller
19
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 12th May 2009 21:13
Quote: "But he was comparing it to DBPro UDTs whose contents are always public, so if he used a class he'd have to waste an extra line to change the access level with otherwise no difference."

Exactly.

Quote: "Ouch, if you're going to use C++ you might as well use classes"

Why? Just because you use C++ doesn't mean you have to use a class. There are other worth-while features in C++ -- function overloading, for example. Although I do use classes quite often, sometimes it can be best to not overdo the classes.

Besides, a class implies "has functions other components of code use" and, "it is its own program" (or module.) Where as a structure implies "just a type."

Cheers,

-naota

David R
21
Years of Service
User Offline
Joined: 9th Sep 2003
Location: 3.14
Posted: 12th May 2009 22:20
Quote: "Although I do use classes quite often, sometimes it can be best to not overdo the classes"


But the point was, why use C++ at all if you're using pure structs? Even the additional features you mention (like overloading) are fairly shoddily implemented any way (and are arguable poor practice in terms of long term maintainability / discoverability)

Quote: "Does anyone here know if a C++ class is just a special kind of struct at the API level?
"


Yeah - classes are implemented using structs, because they are pretty much identical. I think the only thing structs don't understand is inheritance (which is the class-specific part of it)

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 01:18 Edited at: 13th May 2009 01:19
Quote: "Why? Just because you use C++ doesn't mean you have to use a class. There are other worth-while features in C++ -- function overloading, for example."


Function overloading is a part of C as well.

But there are many differences between classes and structs. For example a member of a class is by default private, while in a struct it's public. Also there are benefits with having inheritance using virtual functions, which are not part of C. Myself I would only consider using a struct for a basic type, but I would think it's not good engineering to have structs with functions when you have C++ at your disposal. Also what about constructors and destructors?

Quote: "Yeah - classes are implemented using structs"


That's what I thought, but it would have to be heavily modified with extra layers of functionality.

David R
21
Years of Service
User Offline
Joined: 9th Sep 2003
Location: 3.14
Posted: 13th May 2009 01:21
Quote: "Also what about constructors and destructors?"


I'm 99% certain structs support constructors - I'm not entirely sure about destructors though, but it's probably very likely they do

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 01:23
But does that include copy constructors? And could someone implement a singleton using a struct? I just don't see the point in using a struct as a class, when you can just use a class.

Jeff032
17
Years of Service
User Offline
Joined: 13th Aug 2007
Location:
Posted: 13th May 2009 01:55
Quote: "I think the only thing structs don't understand is inheritance (which is the class-specific part of it)"


As Aaron has already demonstrated, structs can use inheritance.

As far as I know, the only difference between classes and structs in C++ is the default visibility modifier. Obviously it is private for classes and public for structs.

Diggsey
19
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 13th May 2009 02:01 Edited at: 13th May 2009 02:02
Quote: "Quote: "and all OOP languages can be used procedurally. "
Smalltalk might beg to differ"


No, it doesn't... Either you don't know what 'procedurally' means, or you don't actually know anything about Smalltalk.

Coding procedurally means that instead of creating objects to do sub tasks, you use a piece of inline code, or function calls. If you want to write a large program in Smalltalk, you don't have to divide it up into objects with message receivers, etc. You can code the whole thing in one long list.

Quote: "I think the only thing structs don't understand is inheritance (which is the class-specific part of it)"


No... Structs support inheritance as well as classes.

Quote: "Also what about constructors and destructors?"


Quote: "But does that include copy constructors? And could someone implement a singleton using a struct? I just don't see the point in using a struct as a class, when you can just use a class"


No offence, but I would have thought that having worked as a professional programmer for some years, you might know that currently the only difference between C++ structs and C++ classes is the member protection level...
Apart from that they are identical in functionality.

David R
21
Years of Service
User Offline
Joined: 9th Sep 2003
Location: 3.14
Posted: 13th May 2009 02:07 Edited at: 13th May 2009 02:26
Quote: "As Aaron has already demonstrated, structs can use inheritance."

Quote: "No... Structs support inheritance as well as classes."


Under a C++ compiler, yeah. But it's completely pointless, considering structs and classes are practically identical (and that's the only reason that syntax is understood/works). Try that in a vanilla C compiler, and watch it crash and burn. That's why things like OOPC exist.

Although you can do a weird pseudo-inheritance in plain C (by declaring the name of an existent struct inside the declaration of another) but it uses completely different syntax

Quote: "you don't actually know anything about Smalltalk."


Obviously you don't either, because Smalltalk is, by definition, a strictly non-procedural language. It isn't a hybrid either. It's a 'pure' OOP language, which is the entire point of it

Quote: "You can code the whole thing in one long list."


Where do you draw the line with this definition? In SM, and a few other languages, the procedural list you're talking about would have to be part of an object in the first place. Unlike C/C++ where the entry point is a procedural 'blob' which can do whatever, most of these languages use an OOPed entry point of some form (so the entry point is a class, or the main function for the entry point is some kind of thin OOP interface) which means whether you're procedurally branching from it, or constructing new objects, you're using OOP at some point any way (particularly in the case of the .NET languages, where most of the primitives etc. are classes too)

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 03:59 Edited at: 13th May 2009 04:00
Quote: "No offence, but I would have thought that having worked as a professional programmer for some years, you might know that currently the only difference between C++ structs and C++ classes is the member protection level...
Apart from that they are identical in functionality."


No offense but you really don't have to be a prick about this, we're just having a friendly discussion are we not? And no, I didn't do ANY C programming at my last job, just C++ and a proprietary C-based language. The only structs I used or made on a professional level were just for basic data types, and the rest of the objects were using classes with inheritance, polymorphism, advanced data structures, C++ design patterns, etc. etc.

And no, my mind is not a vault where every single piece of information I have read about C is permanently stored.

Please go be elitist somewhere else.

Mnemonix
22
Years of Service
User Offline
Joined: 2nd Dec 2002
Location: Skaro
Posted: 13th May 2009 04:19
Structures are great if you are building something.
Classes are great if you want to learn something.

Whut is all the arguing about ?

Mnemonix
ionstream
20
Years of Service
User Offline
Joined: 4th Jul 2004
Location: Overweb
Posted: 13th May 2009 05:32
Quote: "Function overloading is a part of C as well."


Nah you can't overload functions in C because it doesn't mangle the names when it compiles, so you won't get weirdly exported names like CopyString@YAX@Z. But yeah structs are the same as classes except for the default public, and the keyword is really only there to maintain compatibility with C. In C++ they are compiled the exact same way.

Quote: "No offence, but I would have thought that having worked as a professional programmer for some years, you might know that currently the only difference between C++ structs and C++ classes is the member protection level..."


Really Diggsey? Someone can be a fantastic programmer without knowing how it all works underneath.

Jeku
Moderator
21
Years of Service
User Offline
Joined: 4th Jul 2003
Location: Vancouver, British Columbia, Canada
Posted: 13th May 2009 06:43
Quote: "Nah you can't overload functions in C because it doesn't mangle the names when it compiles"


Oh damn, I just tried and you're right. Looks like I'm just a fraud after all, right Diggsey?

mamaji4
22
Years of Service
User Offline
Joined: 24th Nov 2002
Location:
Posted: 13th May 2009 16:22
Quote: "
No, it doesn't... Either you don't know what 'procedurally' means, or you don't actually know anything about Smalltalk.

Coding procedurally means that instead of creating objects to do sub tasks, you use a piece of inline code, or function calls. If you want to write a large program in Smalltalk, you don't have to divide it up into objects with message receivers, etc. You can code the whole thing in one long list."


You're missing the point about the reason that a purely object-oriented langauage like Smalltalk was developed in the first place. Its to make sure you don't use procedural methods, or at most use them only if ABSOLUTELY necessary. If you want to code the whole thing as one long list use another diluted OO language like C++

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 16:35 Edited at: 13th May 2009 16:45
@Jeku
Yes, maybe I was a little over the top

@mamaji4
Quote: "You're missing the point about the reason that a purely object-oriented langauage like Smalltalk was developed in the first place."


No, you're missing the point about the whole discussion. It's not about whether you SHOULD program procedurally, it's about whether you CAN program procedurally. YOU CAN! I said that you can use OOP languages procedurally, and then you proceeded to say that you can't use Smalltalk procedurally, and then I proved you wrong...

@David R
The difference between coding procedurally and using OOP (IMO) is the technique you use to solve problems, not the syntax of the language. Arguable, a C++ program is an object itself, not just a random 'blob' thing (not really sure what the blob thing is about) For example, suppose you are writing code to control an enemy in a game. If you create an object for that person, which acts as a self-contained unit, and will update itself without you having to do more than an update call or something, that is definitely OOP programming. If however, you keep the bulk of the code outside the object, and store the data inside the object, that is programming procedurally.

Benjamin
22
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 13th May 2009 16:38
I don't think Diggsey meant to offend...

David R
21
Years of Service
User Offline
Joined: 9th Sep 2003
Location: 3.14
Posted: 13th May 2009 16:46 Edited at: 13th May 2009 16:48
Quote: "and then you proceeded to say that you can't use Smalltalk procedurally, and then I proved you wrong..."


You can't program Smalltalk procedurally (i.e. without OOP). The whole point of it is that it's a pure OOP language. Sure, you could have an object method which just does a bunch of stuff in procedural manner, but it's still an object, and you're still using OOP.

Quote: "The difference between coding procedurally and using OOP (IMO) is the technique you use to solve problems, not the syntax of the language."


This isn't about opinion, procedural and object oriented are strictly defined programming paradigms

09-f9-11-02-9d-74-e3-5b-d8-41-56-c5-63-56-88-c0
Diggsey
19
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 13th May 2009 16:48
@David R
Read my edited post

By your argument, programming in BASIC is OOP, because even though you are not creating objects yourself, all the built in commands will call underlying methods that may use OOP themselves.

mamaji4
22
Years of Service
User Offline
Joined: 24th Nov 2002
Location:
Posted: 13th May 2009 16:49 Edited at: 13th May 2009 16:52
Quote: "No, you're missing the point about the whole discussion. It's not about whether you SHOULD program procedurally, it's about whether you CAN program procedurally."


I had no idea that was the point of the discussion. I thuoght we were trying to determine something else, as the title of this thread reads.

Have you ever programmed a mission critical system? Something that is required for instance to keep a Nuclear Reactor running. Using real-time concepts and Requirements Gathering before the design phase. Or do you only know the fine distinction between a C++ struct and a C++ class?

If at first you don't succeed, relax. You're like the rest of us.
David R
21
Years of Service
User Offline
Joined: 9th Sep 2003
Location: 3.14
Posted: 13th May 2009 16:50 Edited at: 13th May 2009 16:53
Quote: "By your argument, programming in BASIC is OOP, because even though you are not creating objects yourself, all the built in commands will call underlying methods that may use OOP themselves."


No that's not a suitable comparison, because in SM and other languages, the object is still 'visible' in your code (it's not hidden a la the BASIC example). You're just choosing to put a bunch of procedures into it and ignore the object's capabilities. It's still OOP.

An example would be a singleton with one method. You just call the single method and that's it. But the singleton is still an object (even though you're calling only a single procedure inside of it, and it causes no object-like behavior) and whilst you're only using a single procedure inside of it, it's still OOP.

09-f9-11-02-9d-74-e3-5b-d8-41-56-c5-63-56-88-c0
Diggsey
19
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 13th May 2009 16:51 Edited at: 13th May 2009 16:53
@mamaji4
I truly haven't a clue what you're on about now...

@David R
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.

David R
21
Years of Service
User Offline
Joined: 9th Sep 2003
Location: 3.14
Posted: 13th May 2009 16:56
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."


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

09-f9-11-02-9d-74-e3-5b-d8-41-56-c5-63-56-88-c0

Login to post a reply

Server time is: 2025-06-06 12:46:09
Your offset time is: 2025-06-06 12:46:09