LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-19-2008, 09:51 AM   #16
resetreset
Senior Member
 
Registered: Mar 2008
Location: Cyberspace
Distribution: Dynebolic, Ubuntu 10.10
Posts: 1,340

Rep: Reputation: 62

Quote:
Originally Posted by pgroover View Post
True, in the *basic* sense that is what it can mean when you are provided a library from an external source, but there's more to it than that. Using OOP, it's much simpler to model actual events, items, etc. within code, and in effect making something a lot simpler to implement.

It sounds like you're actually using it without knowing it if you are already linking against others' object files.



No I'm not, I just was explaining


In a nutshell, OOP allows you to create an instance of an object and to perform actions against it or use it to perform actions against other objects.

What exactly is an "object" and why is it called that? Don't the words "SOFTware" and "object" mean the opposite?


Software engineering is so much easier that way. If you're using classes, or objects in any way then you are using OOP to some extent without knowing it.
?? why would i be using classes?
 
Old 07-19-2008, 10:03 AM   #17
pgroover
Member
 
Registered: Sep 2005
Location: Colorado
Distribution: Ubuntu
Posts: 56

Rep: Reputation: 16
Quote:
Originally Posted by resetreset View Post
What exactly is an "object" and why is it called that? Don't the words "SOFTware" and "object" mean the opposite?
Within OOP code, an object is essentially an the replication of a thing in the "real" world. Each part of an item can be broken down into individual components to simplify the coding process and the combined into a larger item (class) that is a composite of the smaller ones.

i.e.: A car has an engine, a body, and wheels (keeping it simple). Each part would then be created as separate classes to depict the characteristics of each. Another item (vehicle) would then be created containing all the other three (engine, body, wheels) to create a car that can have a customized engine, body, or wheels simply by modifying the requested object. Does that help to clarify things a bit?

Quote:
Originally Posted by resetreset View Post
?? why would i be using classes?
As I said earlier, it's just much easier maintenance-wise when using classes. Find the offending object and modify/correct it once (possibly) instead of multiple modifications/corrections within procedural code.

Also, as Nylex said, you don't have to use OOP to write in C++.
 
Old 07-19-2008, 10:56 PM   #18
graemef
Senior Member
 
Registered: Nov 2005
Location: Hanoi
Distribution: Fedora 13, Ubuntu 10.04
Posts: 2,379

Rep: Reputation: 148Reputation: 148
Quote:
Originally Posted by resetreset View Post
well - i just don't understand what it IS
Quote:
Originally Posted by resetreset View Post
but *i'm* not using it.
Surely you shouldn't just write an idea off because you don't understand it?

As has already been said OO programming is essentially a tool to add some structure to the design of a program. You don't need it, but it can help.

It also helps when the inevitable maintenance of a program comes along by providing structure to the code and protection against doing something inappropriate with the data.
 
Old 07-19-2008, 11:46 PM   #19
Amdx2_x64
Member
 
Registered: Jun 2008
Distribution: Left LQ. Mods are too Rude!
Posts: 598

Original Poster
Rep: Reputation: 50
Never mind this one reply, got it.

Last edited by Amdx2_x64; 07-20-2008 at 12:03 AM.
 
Old 07-20-2008, 12:52 AM   #20
Amdx2_x64
Member
 
Registered: Jun 2008
Distribution: Left LQ. Mods are too Rude!
Posts: 598

Original Poster
Rep: Reputation: 50
Crap I am tired. Long day. I put this in the wrong c++ thread.............

Last edited by Amdx2_x64; 07-20-2008 at 01:09 AM.
 
Old 07-20-2008, 04:32 AM   #21
resetreset
Senior Member
 
Registered: Mar 2008
Location: Cyberspace
Distribution: Dynebolic, Ubuntu 10.10
Posts: 1,340

Rep: Reputation: 62
Quote:
Originally Posted by pgroover View Post
Within OOP code, an object is essentially an the replication of a thing in the "real" world. Each part of an item can be broken down into individual components to simplify the coding process and the combined into a larger item (class) that is a composite of the smaller ones.

i.e.: A car has an engine, a body, and wheels (keeping it simple). Each part would then be created as separate classes to depict the characteristics of each. Another item (vehicle) would then be created containing all the other three (engine, body, wheels) to create a car that can have a customized engine, body, or wheels simply by modifying the requested object. Does that help to clarify things a bit?


I've heard things along these lines hundreds of times, no, I don't get it, like I said.
OOP isn't necessary to express an algorithm from what I can see, which is what a language is for.



As I said earlier, it's just much easier maintenance-wise when using classes. Find the offending object and modify/correct it once (possibly) instead of multiple modifications/corrections within procedural code.

Also, as Nylex said, you don't have to use OOP to write in C++.
I personally don't.
 
Old 07-20-2008, 04:49 AM   #22
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
You personally don't what?
 
Old 07-20-2008, 04:49 AM   #23
resetreset
Senior Member
 
Registered: Mar 2008
Location: Cyberspace
Distribution: Dynebolic, Ubuntu 10.10
Posts: 1,340

Rep: Reputation: 62
Quote:
Originally Posted by graemef View Post
Surely you shouldn't just write an idea off because you don't understand it?


I talked about Max..?
Yes, *I* should definitely write an idea off because I dont understand it, others are welcome to do as *they* please. But unfortunately this live-and-let-live policy isnt working when eg. to program in Flash when I just want to concentrate on making the page that I have an idea for, the *only* option is to use actionscript which has those bloody dots everywhere, then maybe I have to do something..?


As has already been said OO programming is essentially a tool to add some structure to the design of a program. You don't need it, but it can help.


In Java the line to PRINT a bloody string has dots in it, I think around 3 or 4 of them - can you please tell me what "structure" this is providing?
I greatly dislike structure. It's essential reason, the reason you're saying the things you are is because as I said, you can't get 10 people to work on the same program if one of them is a little "unstructured". I often wondered how these internet collaboration things like cvs etc. work - if you and programmer B halfway around the world both have the same variable, wht does it do? does it tell you? does it (my god!) CHANGE it to something not colliding?
And just out of curiosity, how much of the stuff on your nice install DVD is OOP?



It also helps when the inevitable maintenance of a program comes along by providing structure to the code and protection against doing something inappropriate with the data.

The best software in the world were the games of the 80s (you really *were* expecting a "IMHO" weren't you? ), like Pacman. All that going on on hardware that todays people can't even *imagine*, without OOP, without HLLs - just ASM. It was Structured enough to run, and that's all that I'll ever need.
 
Old 07-20-2008, 04:53 AM   #24
resetreset
Senior Member
 
Registered: Mar 2008
Location: Cyberspace
Distribution: Dynebolic, Ubuntu 10.10
Posts: 1,340

Rep: Reputation: 62
Quote:
Originally Posted by Nylex View Post
You personally don't what?
write in c++.
 
Old 07-20-2008, 05:02 AM   #25
easuter
Member
 
Registered: Dec 2005
Location: Portugal
Distribution: Slackware64 13.0, Slackware64 13.1
Posts: 538

Rep: Reputation: 62
resetreset, you dont like C, you dont like OOP, so what language do you use?

I mean, OOP is a novel concept if you have never done any real programming or only worked with Basic, but after you get the hang of it the whole concept makes a lot of sense, code is a lot easier to maintain, and a lot of the time easier to understand when you come back to it later.

The only OOP language I've used so far is Java, and IMO its a VERY easy language to learn. Maybe you could start there...
 
Old 07-20-2008, 05:55 AM   #26
graemef
Senior Member
 
Registered: Nov 2005
Location: Hanoi
Distribution: Fedora 13, Ubuntu 10.04
Posts: 2,379

Rep: Reputation: 148Reputation: 148
you're confusing syntax (dots) with a paradigm (OOP). Certainly it is true that applications don't have to be coded using OOP but for many programs and many programmers it certainly helps. Also it has received a lot of hype the trick is to find the right balance.
 
Old 07-21-2008, 03:22 AM   #27
resetreset
Senior Member
 
Registered: Mar 2008
Location: Cyberspace
Distribution: Dynebolic, Ubuntu 10.10
Posts: 1,340

Rep: Reputation: 62
Quote:
Originally Posted by easuter View Post
resetreset, you dont like C, you dont like OOP, so what language do you use?

I currently have ended up not programming because of this. I think I wouldn't mind C without pointers -I've looked into this: www.processing.org and I think that's what I'll haeve to end up using, it's somewhere in the middle but even IT has oop.

Last edited by resetreset; 07-21-2008 at 03:24 AM.
 
Old 07-21-2008, 12:39 PM   #28
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 116Reputation: 116
C without pointers...is absolutely nothing.

OOP is absolutely great, in its place. I have seen it abused to the point that the program was incomprehensible. I have also seen it employed correctly so that a large project was both comprehensible and maintainable.
 
Old 07-21-2008, 01:08 PM   #29
b0uncer
LQ Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
Check if you can find any universities (or similar) sites where they have their course material freely available. There are some, and the material is usually pretty good; if you can find a site where there are small "tasks" you should do, instructions on how you should start solving them and then the ready source code for the final app (an example code, there's no need to do things exactly like it), you're good to go. I think programming is easiest/best learned by doing it, not just reading a book (I usually use books as a reference, not as the "main source" of knowledge) -- try, fail, retry, succeed and you'll learn a lot better than by just trying to memorize everything. Start with simple enough tasks, then add some personal curiosity into the programs and so on.

A course I attended last spring started off the classic hello world program using std::cout, and though the course wasn't very long, in the end I was able to create (as my last course exercise) a small IRC-resembling server-multiclient communication program (actually programs; server and client were two different things). The best thing was that it actually worked
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Teaching Linux for the beginners... tenzan Linux - General 4 09-16-2005 12:37 PM
Word teaching mindspin Linux - Software 3 09-27-2004 05:22 AM
Teaching Linux madunix Linux - Networking 4 05-12-2004 01:53 PM
teaching active directory w/o teaching network concept (possible???) Tafta General 4 01-21-2004 06:12 PM
Teaching Linux evilmrhenry Linux - General 5 11-14-2003 06:38 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:41 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration