Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,163,355 members, 7,853,574 topics. Date: Friday, 07 June 2024 at 07:24 PM

Criticism Of Object Oriented Programming - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Criticism Of Object Oriented Programming (6877 Views)

A Beginners Guide To Object-oriented Programming (OOP) In PHP 5+ / Fundamentals Of All Object Oriented Programming(oop) Languages / Please What Really Is Object Oriented Programming. (2) (3) (4)

(1) (2) (Reply) (Go Down)

Criticism Of Object Oriented Programming by Seun(m): 4:50pm On Nov 28, 2008
Object Oriented Programming is mostly hype.  I recommend procedural programming and python. cool
Re: Criticism Of Object Oriented Programming by Ghenghis(m): 6:47pm On Nov 28, 2008
Seun:

Object Oriented Programming is mostly hype.  I recommend procedural programming and python. cool

tongue

Mr. controversy ,

Python is object oriented.

@seun
So you think feature/ideas are false or hype


loose coupling
inheritance and aggregation
programming by contract and interfaces
design patterns
encapsulation
data hiding
polymorphism

When you develop large applications and the likes that businesses today demand, maybe you'd appreciate these things more. For some people OO is not just an academic exercise or do it 'cause i said so, its a proven technique for managing the chaos that can be a result of poorly designed software.

We'll , that's my opinion, I'm sure you have some sort of advanced knowledge why its all hype cheesy

@donkoleone
Codegear winner!!
It was a lot of effort for me to read his code(I thought he was just showing of the scanner class), he later described what it was supposed to do.
You might not always be around to explain what your code does, try to write code that speaks for itself

Cheers
Re: Criticism Of Object Oriented Programming by Seun(m): 11:32pm On Dec 05, 2008
Python is object oriented
No. There's a difference between using objects and being object oriented. Python uses objects.

My problem is with a style of programming that languages like Java encourage. Where you cannot write a basic program without defining a class and inheriting something. I hate libraries that require inheritance. I believe in code modularity, but I only define new classes when I absolutely have to. In languages like Python, you tend to use lists, dictionaries, tuples, and modules where you would have had to define new classes in languages like Java.

So, yes, I use classes. I use objects. Inheritance. But only when the problem actually requires them.

When you develop large applications and the likes that businesses today demand,
maybe you'd appreciate these things more.
You don't need OOP for complex business applications. You need a well designed database. wink

1 Like

Re: Criticism Of Object Oriented Programming by dammytosh: 5:54am On Dec 06, 2008
Seun:

No.  There's a difference between using objects and being object oriented.  Python uses objects.

@Seun Python is OBJECT ORIENTED no doubt about that.

Seun:

So, yes, I use classes. I use objects. Inheritance. But only when the problem actually requires them.
You don't need OOP for complex business applications.  You need a well designed database. wink
@Seun , i am afraid u do. For Complex business applications, u even need an OBJECT ORIENTED DATABASE DESIGN if you are not planning to crash land when the application domain explodes (The complexity of the application increases at a geometric rate),The OOP design makes it easy for you to do a one on one mapping 2 ur business objects.

Programming has really gone beyond just writing code that works and sucks, but writing codes that are well structured. It is a bad programming practice to just keep writing code without clear separation of concerns. Your BUSINESS LOGIC LAYER must be separated from you BUSINESS OBJECTS and from your DATA ACCESS LAYER. This improves clarity and your Infrastructure codes can be generated using a custom program built by u.

Object oriented language apart from the theoretical advantages has actually improved my delivery time and the time it takes to clear bug mess in the code.

NOTE: For this post, i am not talking about program dt calculates, area of a circle or factorial. grin
A typical example is a program i am working on presently that has more than 30 tables in the database and i am still in the second normal form stage in my table design.
Re: Criticism Of Object Oriented Programming by jacob05(m): 2:45pm On Dec 06, 2008
Hmmmmm,


i reserve my words ;-)
Re: Criticism Of Object Oriented Programming by candylips(m): 11:13am On Dec 08, 2008
@seun

Python is a dynamic langugue and it offers features that are common to most dynamic langugues.

There is no point comparing its features with a static typed lang like java because they are built for solving two different types of problems.

OOP is all about defining classes , inheriting behaviour from other classes etc. If you have a lang that provides you a "Psuedo" way to acheiving this, then thats fine but to practice true OOP these concepts have to be strictly followed in some sense.

Also there was a reason why procedural programming is bad, Maintenance !!. It can be a nightmare maintaning a procedural codebase to if it was OOP. OOP offers a better way of modeling problems in a way that can be more understandable to the person who has to maintan the codebase.
Re: Criticism Of Object Oriented Programming by dammytosh: 12:07pm On Dec 08, 2008
Another typical advantage of object Oriented Programming is CODE REUSE ABILITY.

When u write a class that performs a major task, you dont need to re-write it (Re-Invent The Wheel).

I cant remember re-writing the code that will login a user whenever i am writing a system that requires authentication in any project.
Because i av written a class that takes user name and password, encrypt the password and authenticates the user against any table specified in my project.

what i simply do is to reference the class library shikena in the new project.

For procedural programming, u have 2 copy and paste ur Old codes into ur new project. (Taaaa that sucks embarassed ) and program maintainability becomes difficult.

e.g If i have a cleaner way of handling my authentication, What i simply do is to implement it once in that class and replace the class library file in all existing projects.

but if i had used procedural programming , shocked I no fit shout
Re: Criticism Of Object Oriented Programming by Seun(m): 4:06pm On Dec 08, 2008
Python is a dynamic language and it offers features that are common to most dynamic languages.

There is no point comparing its features with a static typed lang like Java because they are built for solving two different types of problems.
You make a good point.  The flexibility of Python is probably one of the reasons I am hardly tempted to create classes and such.  I can create ad-hoc tuples, lists and dictionaries to hold my data instead of defining classes.  I can return multiple values from a function instead of having to create a new class to contain them.  But this is still in line with my first comment on this topic:  "I recommend procedural programming and python". 

But:
OOP is all about defining classes , inheriting behaviour from other classes etc. If you have a lang that provides you a "Psuedo" way to acheiving this, then thats fine but to practice true OOP these concepts have to be strictly followed in some sense.
This is what I'm unhappy about.  Why do we assume OOP must be "strictly followed"?  Is it a religion?  If OOP isn't boosting your productivity in a particular project, why should it not be swept aside?

Another typical advantage of object Oriented Programming is CODE REUSE ABILITY.
When u write a class that performs a major task, you don't need to re-write it (Re-Invent The Wheel).
Code reusability is good, but it predates OOP.  Even a prehistoric language like C supports code reuse - hello, standard libraries!  In Python you can organize procedural code into modules, and import them elsewhere.

I can't remember re-writing the code that will login a user whenever i am writing a system that requires authentication in any project.
Because i av written a class that takes user name and password, encrypt the password and authenticates the user against any table specified in my project.

what i simply do is to reference the class library shikena in the new project.
Really? Even if the database schema changes completely? Even if columns are renamed and added? Nah.

All I'm saying is that classes and objects are just another programming construct.  Like variables.  And operators.  You don't see anyone talking about operator oriented programming do you?   And classes are not needed in every situation:

- A maths library doesn't have to contain a "sine" object, a "cosine" object, or even a "MathsWizard" object with a sin method.  It can just contain the mathematical functions you need.

- A user authentication library doesn't have to contain a User object.  All it needs are three functions: "register", "login", and "verifycookie".  OOP doesn't really fit database programming, because it's redundant (and wrong) to define the same business entities in two different places.

- A program to print the numbers one to ten does not need a "NumberPrinter" class.  Thanks.
Re: Criticism Of Object Oriented Programming by candylips(m): 5:45pm On Dec 08, 2008
Very valid points

OOP concepts can be validly replicated in procedural

Methods ==> Functions

Objects ==> Modules



But what i think OOP gives you is the ability to do this more easily. It was developed to make it easier to structure your code properly.
I know you might not really need inheritance, polymorphism and other OOP concepts all the time.

But hey it is there for your use anytime an app outgrow the basic constructs.  Also sometimes after a couple of projects you might start to notice patterns developing in your code.
I haven't seen any research on procedural programming patterns but there are a couple of well know patterns in OOP which makes it very easy to build your apps for extensibility.

I agree with you about the need to always create objects in a languague like Java. Coming from a C background i enjoyed using "Struct" and i often wondered why it wasn't included in Java.


Tuples and list are just Lists in java but i have a problem with the fact that you can have mixed data type in them.  It will be very hard to find bugs that are based on you putting a wrong type in a tuple. i.e ur app expects a String but you have somehow added a number into the tuple

Dicts are just Maps or hashtables in java so nothing new here

What i think are really cool are Closures, dynamic objects and metaprogramming
Re: Criticism Of Object Oriented Programming by tomX1(m): 6:24pm On Dec 08, 2008
Procedural programming is fine for some small programs but you will quickly beging to appreciate the rationale behind OOP when you are faced with some very complex programs.

As to the issue of returning multiple values from a function I still don't think that is theoreticaly possible because a function terminates when it returns. You could however return an array containing multiple values, or use pointers/references seed vairous variable from within a function. (I'm not even sure procedural programs work with pointer/refrences).

Some things which I doubt you will be able to handle easily using procedural programing (especialy is you hate using libraries) are:
1). Imagine writing a program where several values have to be stored in an array of undefined size. That is the size of the array will be decided at run time such that the array can grow dynamicaly.

2). Consider a gaming program where you have vairous characters all having numerous body parts with vairous xtics and states which continualy vary and react to vairous stimulus as the game progresses. You will quickly run into trouble using procedural programing.

I think anything you can do with a procedural language you can do with an OOP language but the converse is not the case.
Re: Criticism Of Object Oriented Programming by candylips(m): 6:42pm On Dec 08, 2008
@atomX

You can still do all this in a procedural langugue if you structure your app into modules and you have functions here and there but my point is that you can do it more easily in OOP especially when you want to inherit behaviour from other modules or classes or you want to build some kind of patterns for specific areas of your code
Re: Criticism Of Object Oriented Programming by Nobody: 8:25am On Dec 10, 2008
cc
Re: Criticism Of Object Oriented Programming by dammytosh: 9:47am On Dec 10, 2008
Seun:

But:This is what I'm unhappy about.  Why do we assume OOP must be "strictly followed"?  Is it a religion?  If OOP isn't boosting your productivity in a particular project, why should it not be swept aside?
Nobody says it should be strictly followed. I said it earlier that it has boosted my productivity and if u want 2 know au ? send a personal message . smiley

Seun:

Code reusability is good, but it predates OOP.  Even a prehistoric language like C supports code reuse - hello, standard libraries!  In Python you can organize procedural code into modules, and import them elsewhere.
@Seun: good point but u can not extend the hello, standard library without the source code if need be or can u ?.

Seun:

Really? Even if the database schema changes completely? Even if columns are renamed and added? Nah.
@Seun: Guess u still have a lot to learn about OOP in the real sense. Inheritance solves that problem neatly and it works fine for me sha.

Seun:

OOP doesn't really fit database programming, because it's redundant (and wrong) to define the same business entities in two different places.

@Seun: I am hearing that for the first time in my life ?. What holds a Student's table in your programme logic ?
"redundant and wrong" what authority are you quoting. .
Redundancy is not an excuse if you are a smart programmer. (All you need to do is to write an app that builds your classes straight from your database)
read up "OBJECT ORIENTED DATABASE DESIGN".

Seun:

- A maths library doesn't have to contain a "sine" object, a "cosine" object, or even a "MathsWizard" object with a sin method. It can just contain the mathematical functions you need.


Seun:

- A program to print the numbers one to ten does not need a "NumberPrinter" class.  Thanks.
@Seun: That is the problem . I am not talking about such "Hello World Programs" grin
Re: Criticism Of Object Oriented Programming by dammytosh: 10:14am On Dec 10, 2008
@tomX:

Procedural programming is fine for some small programs but you will quickly begin to appreciate the rationale behind OOP when you are faced with some very complex programs.
I agree. It works just fine for small programs. I still wrote pascal this morning to solve a simple assignment (A very simple program) for my students. It will be mad for me to write a class to solve such simple problem.

program ComputerAided (input,output)
var Num1,Num2:integer;
      answer:integer;

BEGIN
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
END.

grin

@tomX:

I think anything you can do with a procedural language you can do with an OOP language but the converse is not the case.
That is a very good point.
Re: Criticism Of Object Oriented Programming by logica(m): 11:34am On Dec 10, 2008
OOP makes sense because reality (as in things we see around us) is most easily modeled using this paradigm, as opposed 2 procedural. in real life we observe objects, not procedures. the argument against the superiority of OOP is like the buffoon trying to stop Obama from being sworn in as president claiming he's not a citizen.
Re: Criticism Of Object Oriented Programming by Seun(m): 11:51am On Dec 10, 2008
OOP sure does help in ActionScript,   with inheritance and creating classes
u'd want 2 reuse l8r on etc,  sure makes things a lot easier for us graphic developers
This reminds me of something i wanted to point out.  GUI development is one of those areas where OOP seems to work really well.  Another area is gama development, or any program that involves virtual simulations.  I would absolutely use OOP if I was creating anything like that, because OOP is a natural fit for those problems.

But it's a mistake to force OOP into every 'complicated' problem.  The Linux kernel and GNU linux are not OOP.   Apache is not OOP.  PHP became successful without supporting OOP.  Yahoo used PHP exclusively before it supported objects.  Is Yahoo not a complex website?  It's a myth that OOP is better for every complex problem.  OOP is just one possible approach and it fits certain problems better than others: games, simulations, graphics.

You can still do all this in a procedural language if you structure your app into modules and you have functions here and there but my point is that you can do it more easily in OOP
You think it's easier in OOP is probably because that's what you're used to.  But it's not the only way, and it's not always the best or most user-friendly way.  Let's use the right tool for every job.

Very valid points
OOP concepts can be validly replicated in procedural
Methods ==> Functions
Objects ==> Modules
Thanks. smiley  But: those concepts originally came from procedural programming and OOP simply stole them. wink


Tuples and list are just Lists in java but i have a problem with the fact that you can have mixed data type in them.  It will be very hard to find bugs that are based on you putting a wrong type in a tuple. i.e ur app expects a String but you have somehow added a number into the tuple
Python is strongly typed.  If you try to perform numeric operations on a string, you'll get a TypeError.  So that's not a problem.  (but you have to run your program to catch the error).

The advantage is that I can group any arbitrary objects together without defining a class or struct.  Instead of being forced to define a User class, I can create a tuple (iduser, username, emailaddress).  And I can take 50 such tuples and add them to a list, and send the list to a PromoteThemAll() function.  Unlike a class, I can include only the fields needed by the PromoteThemAll() function.

@Seun: good point but u can not extend the hello, standard library without the source code if need be or can u ?.
Yes, you can.  You can create new functions that depend on the functions in the standard library.  That is equivalent to overriding a class method with a new method that calls the parent method.  You can create new data structures that contain data structures in the standard library.  This is equivalent to adding new variables in a child class.

@Seun: Guess u still have a lot to learn about OOP in the real sense. Inheritance solves that problem neatly and it works fine for me sha.
No, it does not.  Unless your database supports inheritance, you have to rewrite the database queries, which is the same as what you'll need to do in a procedural program.  Inheritance is a fancy name for "writing new functions that depend on provided functions".  The amount of code you have to write is the same, the only difference is the way you write it.

@Seun: I am hearing that for the first time in my life ?. What holds a Student's table in your programme logic ?
The database holds my students table.  My program logic retrieves rows based on SQL queries and stores them in tuples, which contain just the fields that are needed in the current function.

"redundant and wrong" what authority are you quoting.  Huh
The [url=http://en.wikipedia.org/wiki/Don%27t_repeat_yourself]don't repeat yourself[/url] principle (DRY)

All you need to do is to write an app that builds your classes straight from your database.

What happens to your classes when your database changes?  That's why the DRY principle exists. wink  

read up  "OBJECT ORIENTED DATABASE DESIGN".
I have and it's mostly hype too.  It's meant to appeal to people who are afraid of SQL.  
Don't be: SQL is just another programming language that you can master very easily.

I think anything you can do with a procedural language you can do with an OOP language but the converse is not the case.
There is no modern procedural language that doesn't support OOP, and there is no OOP language that doesn't support procedural programming.  The point is to use the right tools for the right job.  When you use OOP for appropriate problems like GUI work, simulations, and graphics, it helps a lot.  When you use it inappropriately in text/html processing programs, data access libraries, etc, it just makes your program harder to read.   Anything you put in a program that doesn't need to be there makes the program harder to read and maintain (except comments, of course).

OOP makes sense because reality (as in things we see around us) is most easily modeled using this paradigm
Programming is not about modelling reality.  It's about solving problems.  Sometimes, the problem involves modeling virtual objects e.g. game characters and GUI widgets, and that is where OOP is really useful.  But when you're executing complex mathematical calculations, doing complex text/html processing, or manipulating a complex corporate database, OOP can be more of an obstacle.

What I'm proposing is a multi-paradigm approach: let us understand the best practices in OOP and procedural programming, and use the most appropriate mix for each project.  Don't define classes or use inheritance unless that is the clearest way to solve the problem.  In fact, there are many useful programming paradigms beyond OOP and Procedural.  E.g. functional. Let's learn them all, and use them all, where appropriate. wink

1 Like

Re: Criticism Of Object Oriented Programming by logica(m): 11:57am On Dec 10, 2008
lol. u are apparently not aware that problem solving is an instance of modeling reality. all those mathematical models exist as real-life problems. your view of programming is not up-to-date. OOP works by mirroring or modeling systems as closely to the real thing as possible. this goes without saying though.
Re: Criticism Of Object Oriented Programming by candylips(m): 1:05pm On Dec 10, 2008
You think it's easier in OOP is probably because that's what you're used to.  But it's not the only way, and it's not always the best or most user-friendly way.  Let's use the right tool for every job.

You are right. Using the right tool for the right job is the key to RAD. However from my experience procedural constructs are good only for the more trivial apps. The benefits of OOP begin to show when u start working on more complex problems(i.e could be an app with a web front end but the processes behind do not work with db tables. could be some type of workflow simulation or business rules execution).

Well most websites are not really that complex. you are just working with some type of data in a db in some way. So u might not neccessarily need to use OOP although it will help structure ur code neater if you do.

Thats why PHP wes invented. just hack away the code like mad and get the damn website working as fast as possible  smiley
Re: Criticism Of Object Oriented Programming by dammytosh: 2:36pm On Dec 10, 2008
Seun:

No, it does not.  Unless your database supports inheritance, you have to rewrite the database queries
"Database supports inheritance" ke  . We are talking about architectural design at one of my Logic Layers.
"I advice you read up on N Tier Architectural Design." and learn au to build application that can work with any DBMS(Oracle,MY SQL , MS SQL) without re-writing the business logic.  smiley   grin
wetin concern agbero with overload, wetin concern SQL concern OOP or procedural   grin

Seun:

   I have and it's mostly hype too.  It's meant to appeal to people who are afraid of SQL.  
Don't be: SQL is just another programming language that you can master very easily.

     That Object Oriented Database Design  is a means of appealing 2 people who are afraid of SQL sounds extremely ridiculous.
   There is a difference between database design and writing SQL statements to query records from that database.
Your database design has nothing to do with writing sql. U can just model a database on a sheet of paper without a single line of SQL and implement in ORACLE, MSSQL or MY SQL using the predefined SQL in each DBMS.

  grin "Master SQL Easily"  grin what do we use 2 query records from all our existing projects ? Is it OOP SQL ? LOL  grin

What we are saying is about good programming practice and using the right architecture for the right problem.

that yahoo, facebook and co uses PHP does not mean that they are not using OBJECT ORIENTED DESIGN APPROACH their systems kept improving and it was not like they started it. Even PHP now supports Object Oriented Paradigm and i guess the designers of that language are much more knowledgeable than us that they will not know that OOP  is all about hyping before including it in latest version of PHP.

And another misconception of Object Oriented Programming Paradigm with GUI programming sounds very funny though.  grin

Lest I forget, I agree that Object Oriented Programming Design could be very scary and difficult to comprehend (besides knowing definitions and some theories), but that can't kill the potency of the paradigm. A lot of programmers FLED Java simply because of that concept. (Be truthful to yourself na ,  LOL  grin)
Re: Criticism Of Object Oriented Programming by tomX1(m): 2:07pm On Dec 11, 2008
Seun:

Programming is not about modelling reality.  It's about solving problems.  Sometimes, the problem involves modeling virtual objects e.g. game characters and GUI widgets, and that is where OOP is really useful.  But when you're executing complex mathematical calculations, doing complex text/html processing, or manipulating a complex corporate database, OOP can be more of an obstacle.
One of the best and recomended aproach to working with ADO database in C++ is to create a class modelled after each the table or result set to be returned by your sql query. You need to try out that method to know how powerful it can be.
Besides even mathimatical calculations are not to be viewed as abstract symbols that are conjoured up from some magical realm, they are models of real world problems. OOP is not restricted to games and GUIs and stuffs. If you look for an object in a problem space you will quite easily find one.

Seun:

What happens to your classes when your database changes?
If and when your database changes, certainly a lot of the codes in your program that interfaces with the database are bound to change (weather you declare classes for tables in the database or not) so simply update your class as well. In working with database you ussualy have to properly plan your database before you start coding away that way you don't easily run into such troubles.
Using classes to manipulate your database does not shield you from sql querries, you will still use them extensively. But what happens when the values returned from the sql querries have to go through some turturous manipulations to which sql is ill suited before being written back to the database or displayed to the viewers? In procedural programming models you will have to work with variants and it will qiuckly become cumbersome for all but the simplest applications.

Seun:

, There is no modern procedural language that doesn't support OOP, and there is no OOP language that doesn't support procedural programming.  The point is to use the right tools for the right job,
Lets hold you to those words. Then critisising OOP is like a typist who is used to using an IBM electronic type-writer saying the computer with it's word processor is an over-kill.
Only a misuse of the OOP paradigm will create problems for a programmer. The concept of OOP itself is wonderful. If you are uncomfortable with OOP then stick to using the procedural method of programming that you are used to. Leave the playing field of OOP for those who have a stomach for it. As long as you solve your problems in a manner that gives you result and joy then it doesn't matter much to me if you killed your Goliath with a sling or a balistic missile.
Re: Criticism Of Object Oriented Programming by dammytosh: 9:37am On Dec 12, 2008
@tomX:

Then critisising OOP is like a typist who is used to using an IBM electronic type-writer saying the computer with it's word processor is an over-kill.

@tomX grin i am with u , ride on. I will always quote that statement in my OOP classes to my students (LOL). grin
Re: Criticism Of Object Oriented Programming by logica(m): 10:32am On Dec 12, 2008
u don't have 2 always create a class. in some cases, an interface will do wink. besides how much different is a struct definition in c/c++ from a Java class?

and again, why complain because u need an object even 4 a trivial program such as printing the numbers 1-10 to the console? the "System" class (which is a singleton) is simply a representation of the real world System i.e your computer. you computer has input and output and other properties, which the "System" class perfectly emulates. thinking in terms of objects is a realistic approach 2 solving problems.
Re: Criticism Of Object Oriented Programming by AbidemiA: 12:30pm On Dec 12, 2008
@Logical, tomX

You guys are too much. Do you code with C#?

I am very sure that Seun posted this topic to attract traffic.
Re: Criticism Of Object Oriented Programming by scottN(m): 12:50pm On Dec 12, 2008
OOP is the best thing that has happened to application development in recent times, (although AOP is strongly challenging that). It is rather the misuse and abuse (cos it could b pervasive) that has led to such criticisms. For instance as stated above why create a class when all u really need is an interface? I would suggest that any one that wants to embark on OOP should master and understand the applications of the following concepts
1. Data Encapsulation
2.Inheritance
3.Polymorphism
4.Composition

Yeah u may be saying that u r seeing this points 4 d umpteenth time but Do You Really Understand Their Benefits,Usage and Practical Applications?
Re: Criticism Of Object Oriented Programming by Ghenghis(m): 3:27pm On Dec 12, 2008
Hmm Long post ,

Ok let me get some things of my chest

@seun
python is object oriented
python is very good for rapid prototyping because its object oriented
python uses higher level data structures like tuples, lists etc because its object oriented
do you do garbage collection in python ? no , because its , all objects tuples included descend form a single object hierarchy -- so you might not like oo but Guido does, and he built python on it


on classes

creating a class or interface is not supposed to be a matter of whim or mood

the needs of the domain model determine if you create
a class
an abstract class
an interface
delegate (in C#) or inner class(java)

you can also inherit although its almost always better to use aggregation

I recommend every developer java or otherwise read
Effective java by Joshua Bloch

it'll clear up many of the confusing areas regarding OO.

OO is not the language, its the way one goes about developing applications, but some languages make it easier by having OO friendly syntax
I've seen some solid OO in C (but it'll make you dizzy)

OO is well suited to business apps, it keeps data and behavior very close together
so if we take @Atomx ADO db example, you model tables with objects , an ADO object is both the row contents and the things(operations) you can perform on a row.

A school of thought is promoting OO databases, well there are ways of having inheritance like behavior in a DB.
These things are not just theory, but best practices people have used to deliver robust world class solutions

Nice discussion though smiley
Re: Criticism Of Object Oriented Programming by Seun(m): 3:37pm On Dec 12, 2008
@seun
python is object oriented
python is very good for rapid prototyping because its object oriented
python uses higher level data structures like tuples, lists etc because its object oriented
do you do garbage collection in python ? no , because its , all objects tuples included descend form a single object hierarchy -- so you might not like oo but Guido does, and he built python on it
As someone who uses Python everyday, I can assure you that you don't know what you're saying.
Python is a multi-paradigm language. It supports OOP, procedural, functional, etc. Anyone you like.
(Unlike Java which forces OOP on you by forcing you to declare classes in every single program.)
Your post is quite insightful, even though I don't fully agree with you, but please leave Python alone. wink
Re: Criticism Of Object Oriented Programming by logica(m): 5:42pm On Dec 12, 2008
in that respect, c++ also allows you to code non-OOP or OOP but that's mostly 4 backward compatibility with c.

even though I have hardly done any Python programming, I believe u may not be familiar with the internals of the language (translation/compilation). when u write a procedure which to u appears to be non-OOP, what I believe happens is the translator sort of regenerates the code in OOP form. I believe this is what is referred to when the issue of verbosity is mentioned. in other words, u can make tacit references.

e.g. in Java u have:

public HellWorld {
   public static void main (String args[]) {
      System.out.println("Hello World!"wink;
   }
}


but it's quite possible to make Java work such that if u do this:

main() {
  println("Hello World!"wink;
}


the compiler will take this for a short-hand of the previous piece of code, and appropriately generate the above code transparently. but this does not mean the language is not object oriented. it just means it can be non-verbose (or tacit, however u want to call it). same goes for declaration of variables, referenced classes (in import statements), etc.

1 Like

Re: Criticism Of Object Oriented Programming by tomX1(m): 11:28pm On Dec 12, 2008
Ghenghis:

. . . @seun
python is object oriented. . .

Seun:

As someone who uses Python everyday, I can assure you that you don't know what you're saying.
Python is a multi-paradigm language. It supports OOP, procedural, functional, etc. Anyone you like.
(Unlike Java which forces OOP on you by forcing you to declare classes in every single program.). . .

From Python Programming Language -- Official Website
" Python is a dynamic object-oriented programming language that can be used for many kinds of software development."
- see http://www.python.org/

I do agree that it's (in my opinion) not very nice the way evry thing must be in the context of a class in Java. Most OOP languages give you the choice of creating and declearing objects of your class as and when needed.

OOP paradigm is a solid one though. No contset there.
Re: Criticism Of Object Oriented Programming by Seun(m): 11:57am On Dec 13, 2008
Let me put it this way: Python is object oriented.  It is also procedural.  And functional.  And module-oriented. The website emphasizes the OOP aspect to keep people like you interested, that's all.

I think we can all agree that the misuse of OOP constructs is a bad thing.  What we don't agree upon is what constitutes misuse and what constitutes acceptable use.  To discuss this we have to discuss various specific problems and explore the ways of solving them with each approach.

1 Like

Re: Criticism Of Object Oriented Programming by dammytosh: 12:05pm On Dec 13, 2008
That a language forces you to use OOP is a fallacy.  shocked

OOP is not only about the
 "public class HelloWorld" first java line of code.

That is simply a java syntax. Implementing OOP is a matter of your problem domain.

like the simple "Hello World" program in java can be written by any newbie who have never heard about inheritance, polymorphism, aggregation and other OOP buzzes before.

u can write a complex program in your main class. without any knowledge of OOP, use methods without any knowledge of OOP but assuming that is au it is done in Java.

You can simply import your bad VB6.0 style of programming into VB.NET and yet VB.NET is FULLY OBJECT ORIENTED
Re: Criticism Of Object Oriented Programming by logica(m): 1:50pm On Dec 13, 2008
I believe the reason many of these languages (C++, Python, Object Pascal) included older paradigms in their design was because they didn't want to leave programmers who weren't willing to learn OOP behind, and not that they were included to allow you chose paradigms in the year 2008 (going to 2009!). The decision was made years ago (for instance Python went public in 1991, so you can imagine that the design and development work on the language started @ least 2 years previous).

Now, Java was introduced in 1995, and by this time there was a huge cache of programmers/developers with sound OOP knowledge. by 1995, it was clear the procedural paradigm was due for retirement (deprecation if you want to use programming terminology grin), and the idea was to discourage new (and upcoming) programmers/developers from keeping the procedure mind-set.

@Seun,
The good thing is you have agreed that Python is OOP as opposed to "using Objects" as you previously asserted grin

@Mr Dammytosh,
You are wrong. That piece of code would look weird especially to a new student who is used to the procedure paradigm. "Encapsulation", which is one of the 3 (or some say 4) is what that code stands on. And how do you explain that InputStreamReader extends Reader (or is a Reader), and so does BufferedReader, meaning both InputStreamReader and BufferedReader are related (siblings or cousins) without mentioning "Inheritance"?
Re: Criticism Of Object Oriented Programming by dammytosh: 2:02pm On Dec 13, 2008
@logica
  It depends on au good u are as a teacher. The first 4 Lines of code is simply "readln (LastDigit);" in pascal programming language.
My students have a pascal background and that statement was explained to them as readln.

I started explaining the details of OOP about 3 classes after we did that.

If u av read good Java text books for newbies, the OOP Buzz is usually ignored till u get a good grasp of the fundamentals of the language.


From experience,the problem people have when learning JAVA PROGRAMMING is the OOP aspect and that is y a lot of newbies run away from the language and go for less stressful languages like python.

What i was just trying to say is that u don't av to know A-Z of OOP before u can solve problems in JAVA. as opposed to some blifs

(1) (2) (Reply)

Php/mysql Help:how To Run Sql Query From A Link / Pls Help With Python Problem / I Want To Start A Career In Software Development

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 142
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.