Criticism Of Object Oriented Programming

Welcome. Please Login, Register, Or Activate! 
type your username and password to login
Date: November 23, 2009, 01:38 AM
431028 members and 298101 Topics
Latest Member: texzy
Nairaland [Nigerian Forum] Home Help Search Who is currently online? Login Register
Nairaland Forum  |  Technology  |  Programming  |  Criticism Of Object Oriented Programming
Pages: (1) (2) Go Down Send this topic Notify of replies
Author Topic: Criticism Of Object Oriented Programming  (Read 1076 views)
logica
Re: Criticism Of Object Oriented Programming
« #32 on: December 13, 2008, 02:24 PM »

What will result is you will have a bunch of "cut-and-paste" students who have no real idea how the code works or why the syntax is different from Pascal. The point I am trying to make is, you do need to teach students of Java, OOP concepts before they start learning the language (and that is what is recommended).  I have no doubt that if you read the newbie books well, they state the target reader(s) (e.g C++ programmers, programmers with OOP understanding, etc) and they usually mention chapters that students with good understanding of OOP may skip. You have skipped a very important item in their curriculum.
dammytosh
Re: Criticism Of Object Oriented Programming
« #33 on: December 13, 2008, 03:20 PM »

 
Quote from: logica on December 13, 2008, 02:24 PM
   you do need to teach students of Java, OOP concepts before they start learning the language (and that is what is recommended). 
@logica, that is not true. It depends on your approach. Good Books like "Java  How To Program From Deitel Associates" apart from introducing Objects and classes briefly in chapter 3 did not go into the details until they get to Chapter 6 ,  and a lot of problems have been solved before then.

 You can't teach java without teaching OOP. that is no news  Smiley, nobody doubts that. The point is that u can actually be a little comfortable with it before u understand all the concepts in depth.

Try to read all my posts on OOP in this section.  I don't work on live projects without using the OOP paradigm not because it is a must, but because it is the easiest way for me to manage my project.

 Lets concentrate on the Subject matter for people who are learning from the posts. Thanks
webdezzi (m)
Re: Criticism Of Object Oriented Programming
« #34 on: January 01, 2009, 12:17 PM »

@poster,

while procedural programming is not bad, OOP can be very helpfull when  you have to handle complex applications

and saying python is not object oriented is wrong, since it support classes and objects
Seun (m)
Re: Criticism Of Object Oriented Programming
« #35 on: January 01, 2009, 08:38 PM »

I think I had some of my terminologies mixed up.  What I meant to say is that unlike languages like Java, Python does not force you to program using OOP constructs if you don't feel like using them.

My real problem is with programmers using unnecessary OOP constructs for problems that would be best solved with a procedural or functional approach.  I just want you to know that there's life outside OOP!
webdezzi (m)
Re: Criticism Of Object Oriented Programming
« #36 on: January 02, 2009, 01:48 PM »

thats true, i know a guy who falls into that category,

writing classes for a demo.
*dhtml
Re: Criticism Of Object Oriented Programming
« #37 on: January 04, 2009, 12:19 PM »

@Seun is quite right about that - for instance javascript is NOT object oriented - but makes use of objects - and u can create classes as well.
Class creation in javascript is not compulsory to use classes, but some languages like c, java will tell you that any program you write
even if it is a beginners program must start by declaring your class - whether you now create other classes after that one is now your own business.

But me i love creating classes in javascript and php - they sure lessen my work. For instance, ever since i started using ajax, i created a base class that performs all the routine ajax stuffs i need, and the class comes with even handlers and stuffs, so anytime i am writing a new ajax script, i just inherit directly from the base class - that way any new solution i create based on ajax - i will not start writing onreadystatechange=,
i can just declare that:
Code:
var page=new jpage();
jpage.ondownloadcomplete=function() {alert(jpage.responseText);}
jpage.download("http://www.nairaland.com/");

And that is it - instead of having to start writing all those long ajax codes,  generally classes can aid your work and make you obtain faster results
But then, procedural vs oop: the important thing is to get your results as fast as possible - getting the job done that is.

I understand there is more to programming than using OOP constructs - just that if classes are used - and you are able to tap into their features like polymorphism, inheritance, reusability, it will make your work easier - and you will get results faster.
Plus if u find a bug later in future in the class - just sort it out in the present project - then reupdate the class in previous projects - that way you can keep your codes better organized - i use classes mainly because of that - anytime i find a new function somewhere online - i just integrate them with my base classes - that way it is saved for a rainy day.
webdezzi (m)
Re: Criticism Of Object Oriented Programming
« #38 on: January 04, 2009, 02:32 PM »

even the ajax u talk about, with me, no classes

just a function mapped out so well that i just need to call ajaxify(<page_to_request_from_server>,<var_to_be_sent>,<final_location_of_response>)
prodgalson
Re: Criticism Of Object Oriented Programming
« #39 on: January 04, 2009, 08:36 PM »

Been ages since I've been on NL.  Nice one with the informed discussion.  Dont have anything to add. 
*dhtml
Re: Criticism Of Object Oriented Programming
« #40 on: January 05, 2009, 04:39 AM »

And my site is entirely ajax driven too - www.mwebng.net - makes it very easy to update - because the entire site is just like an object built on an ajax framework - anyway - i have been posting some ajax related and class threads in the webmasters section - the moderator even pinned many of my threads on the first page of the webmasters section - Tutorials In Webmasters Section - http://www.nairaland.com/nigeria/topic-214594.0.html
And they are complete with samples and downloadables where necessary. The idea is that if classes are used very well your codes will become minimal.

Most of my personal ajax classes for instance can be used to download something as shown below:

Code:
<script src="jpage.class.js"></script>
<script>
var page1=new jpager();
page1.onDownloadSuccess=function() {document.body.innerHTML=page1.responseText();}
page1.onDownloadFail=function() {alert("Your download was not successful");}
page1.download("Home.html");
</script>

That in ordinary codes will mean:
Code:
<script>
function ajaxRequest() {
var activexmodes=["Msxml2.XMLHTTP", "Microsoft.XMLHTTP"] //activeX versions to check for in IE
if (window.ActiveXObject){ //Test for support for ActiveXObject in IE first (as XMLHttpRequest in IE7 is broken)
  for (var i=0; i<activexmodes.length; i++){try{return new ActiveXObject(activexmodes[i])} catch(e){alert("Failed");}}
} else if (window.XMLHttpRequest) {return new XMLHttpRequest()} else {return false}
return;
}

function download(url) {
var mygetrequest=new ajaxRequest()

    mygetrequest.onreadystatechange=function(){
     if (mygetrequest.readyState==4){
      if (mygetrequest.status==200) {document.body.innerHTML=mygetrequest.responseText;}
  else {alert("Download was not successful");}
}
}
mygetrequest.open("POST", url, true);
mygetrequest.send(null);
}

download("Home.html");
</script>

You can easily see which one is more productive - using classes - you can keep your baseline functions and stuffs into
it - that way mistakes will be minimal. If i am using my classes to do work and they fail - i know it is a code in the specific
project and not an error in my class - talking about functions in my various classes that i have used in more than 1 project.

And again, all my ajax classes are derived from my own version of prototype which contains various useful codes
i copied from so many places. But unlike the regular prototype class where they just dumped uncountable
codes making the entire class so large though functional, mine is splitted into bits and pieces, so i just
need to pick the ones i need for a particular project, that way my pages load faster.
*dhtml
Re: Criticism Of Object Oriented Programming
« #41 on: January 05, 2009, 04:47 AM »

Another common class i also use in php - now this one is a big one - it is a mailer class.
It can send alot of emails at once - i only use them on enterprise sites whenever the admin needs to
send notification to clients.

<?php
include_once "blah-blah-blah.class.php";
$mailer=new SendMail();
$mailer->send("wale@32.com","bc","cc","subject","message");
?>

The question is why not just use the mail function - well - this will convert the mail to the correct mine
format [and encodes it exactly the way yahoo encodes emails] - so that it can send properly formatted
html messages and can add unlimited number of attachments to it.
And if the to field contains more than 1 email address, then it will send the message to each person individually
and not just dump all of them into one long to field.

I did not want to discuss this here - as some may relate it to spamming [and God help anyone that tries to contact me for a mailer]
but hese are tools used by webmasters and of course there are lots of free mailers online - just type your search into google.

I was just trying to explain how classes can solve a lot of problems and make you code more efficiently.

So, if you work with objects like this, it makes your overral efficiency better, you can easily focus on more pressing issues
than to start debugging one small code here and there - debugging ajax, debugging php, my mail is not being sent,


webdezzi (m)
Re: Criticism Of Object Oriented Programming
« #42 on: January 05, 2009, 10:50 AM »

can i have your mailer class? Just brother to brother na Grin
*dhtml
Re: Criticism Of Object Oriented Programming
« #43 on: January 05, 2009, 03:16 PM »

Well, i am sorry, i dont give mailers out,  just go to phpclasses.org - i am sure you will find a better one - afterall i am just an amateur!
*dhtml
Re: Criticism Of Object Oriented Programming
« #44 on: January 11, 2009, 07:45 AM »

And to now clear this up, facebook application development. Instead of facebook to start telling developers that this is the database where ,  is stored, they just provided us with the framework we need - they provided us with a client-sided class [javascript/json] and a server sided php class to do all our manipulations.  I created a thread on how to build facebook classes on http://www.nairaland.com/nigeria?topic=214623.0 - all these show that OOP solves alot of problems.

Google too are supplying us with free ajax classes that enable us to pull rss feeds into our websites via ajax and u can use those classes with the instructions even if you do not know what the A in Ajax stand for.
I made a tutorial on this google class on http://www.nairaland.com/nigeria/topic-216105.0.html

I stand to be corrected, using Object Oriented Programming is a very professional way of working.

If you are still not convinced, you can check out some of the web developer's objects i have on my website - www.mwebng.net
Many of those things [still need to be reviewed] do not require you to know so much before you can use them.

Once you follow the instructions and get the right steps u will be able to use them - instead of saying, go into my source code on line 12, change this to the name of your box, go to the ,
 Nigerian Java Group : Jand  Who Knows Phone Programming?  Aptech, NIIT Or Karrox For Oracle Certificatification?  Page 2
Pages: (1) (2) Go Up Send Topic to Friend by E-mail Reply 


Sections: Autos/Cars (2) Jobs/Vacancies (2) (3) Career Talk Education General(2) Politics Romance Computers Phones Travel
Sports Fashion Health Religion Celebrities TV/Movies (2) Music/Radio (2) Books Webmasters Programming

Links: Page1 Page2 Page3 Page4 Page5 Page6 Page7 Page8 Page9 Page10

Nairaland is owned by Oluwaseun Osewa. See also: Nairalist Classified Ads
Nairaland Forum | Powered by SMF 1.0.12.
© 2001-2005, Lewis Media. All Rights Reserved.