OOP: should I learn it?

J

johnb41

I've been spending alot of time learning vb.net the past 6 months (for
regular winform apps. Been somewhat experienced in asp.net for a few
years)

But my style has been using Procedural techniques, rather than OOP.
Lately i've read more and more how OOP is the way to go. So i'm trying
to learn it, and boy is it difficult if you've not worked that way much
before!

I ran into this web site: http://www.geocities.com/tablizer/oopbad.htm
It swears that OOP is over-hyped, and says that Procedural is better.
It has many arguments against OOP.

Do you pros think the info on that site has eny merrit? Or is the
author just trying to get some attention?

Thanks,
John
 
M

Marina

Everything has its time and place. Knowing all the methodologies will allow
you to choose the right one for a particular project.
 
H

Herfried K. Wagner [MVP]

johnb41 said:
I've been spending alot of time learning vb.net the past 6 months (for
regular winform apps. Been somewhat experienced in asp.net for a few
years)

But my style has been using Procedural techniques, rather than OOP.
Lately i've read more and more how OOP is the way to go. So i'm trying
to learn it, and boy is it difficult if you've not worked that way much
before!

I would learn OOP although it is a hype and often not the most suitable
tool. OO is an important technique in every programmer's toolbox.
 
W

Workgroups

That guy's a procedural ideologue, I wouldn't give him much credit. When
you see someone using that much rhetoric to make what they claim is a valid
& logical point, that's a bit of a warning sign that their point isn't as
valid or logical as they claim.

I suggest you study OOP then ask yourself which you think is best. You
might actually like OOP once you get to know it.
 
P

Peter van der Goes

johnb41 said:
I've been spending alot of time learning vb.net the past 6 months (for
regular winform apps. Been somewhat experienced in asp.net for a few
years)

But my style has been using Procedural techniques, rather than OOP.
Lately i've read more and more how OOP is the way to go. So i'm trying
to learn it, and boy is it difficult if you've not worked that way much
before!

I ran into this web site: http://www.geocities.com/tablizer/oopbad.htm
It swears that OOP is over-hyped, and says that Procedural is better.
It has many arguments against OOP.

Do you pros think the info on that site has eny merrit? Or is the
author just trying to get some attention?

Thanks,
John
Look at it this way.
C++(hybrid, actually), C#, VB.NET, Java, etc., etc. are all object oriented
languages. Why is that, I wonder?
I would be the last person to tell you that OO is the *only* way, but it has
many appealing real world advantages conveniently ignored by the procedural
zealot.
 
C

Cor Ligthert [MVP]

John,

I would not spent to much time on it.

Just try to avoid:
- modules
- shared classes
- placing your declaration global
- placing your declaration in top of a method
- access to variables in another class others than that there are public
properties for that

You will see that sooner of later you are using OOP

(And buy than a good book or documentation about it how you can improve
that)

Just my thought,

Cor
 
H

Herfried K. Wagner [MVP]

Workgroups said:
That guy's a procedural ideologue, I wouldn't give him much credit.

OOP only puts a meta-structure over procedural programming. Procedural
programming is still one of the main programming techniques. I often see OO
code written by people claiming that they are "system architects" which show
a lack of knowledge in procedural programming. Thus the solutions may have
a good object model, but the implementation is flawed.

It's never good to have only a single tool in the toolbox, especially if you
need to combine the tools to get the best solution.
 
H

Herfried K. Wagner [MVP]

Cor,

Cor Ligthert said:
Just try to avoid:
[...]
- placing your declaration in top of a method
[...]
You will see that sooner of later you are using OOP

Block-level scope is not an OO feature.
 
J

johnb41

Herfried,

Do you have advice on when is a good time to use OOP and when it is
not? How do I know?

John
 
H

Herfried K. Wagner [MVP]

johnb41 said:
Do you have advice on when is a good time to use OOP and when it is
not? How do I know?

Databases are one example. In this field relational databases/programming
is currently used in most cases because it has benefits over object-oriented
databases/programming. In simple scripting scenarios procedural programming
is often sufficient and object-oriented programming is oversized.
 
H

Herfried K. Wagner [MVP]

johnb41 said:
Do you have advice on when is a good time to use OOP and when it is
not? How do I know?

Databases are one example. In this field relational databases/programming
is currently used in most cases because it has benefits over object-oriented
databases/programming. In simple scripting scenarios procedural programming
is often sufficient and object-oriented programming is oversized.
 
J

Joel Whitehouse

This was well said!

OOP only puts a meta-structure over procedural programming.

This is true. All code is procedural at some level. However, OOP's
abstraction and data-hiding concepts make it possible for a single
programmer to code very complex programs single handedly. Making an
argument that objects shouldn't be abstracted and modeled in classes is
like making an argument that tasks like writing to the console shouldn't
be represented and abstracted into functions.

Even if OOP isn't the best methodology, it's is simply what is in use
today (in Windows, in .NET, in Java, etc.) Sure, you can make an
argument that OOP should be less prevalent in programming today, but
that's like saying that books in English should be less prevalent,
because other languages are more concise and descriptive.

Idealists don't really change the world, they just annoy it. In the
end, it's a lot easier just to use things the way they are to your own
advantage, rather than insisting on reinventing the wheel.

-Joel
 
W

Workgroups

Herfried K. Wagner said:
OOP only puts a meta-structure over procedural programming. Procedural
programming is still one of the main programming techniques. I often see
OO code written by people claiming that they are "system architects" which
show a lack of knowledge in procedural programming. Thus the solutions
may have a good object model, but the implementation is flawed.

It's never good to have only a single tool in the toolbox, especially if
you need to combine the tools to get the best solution.

I don't disagree with you.

But none of this justifies the outrageously misleading demonization of OOP
found on that website. The numerous vague examples where the philosophy
itself is roped into a faulty guilt-by-association with the implementation;
the attempt at prophetically equating the spread of OOP to the spread of
communism; a particularly obnoxious claim that the basic human learning
process (starting small and building upon core concepts) is, within the
context of OOP, a devious "bait and switch" drummed up by the OOP "pushers";
he implies that those who embrace OOP are "elitist". This ideological
rhetoric is woven into the fabric of every article.

I'm sure the guy is a good procedural programmer, but his website is not
exactly what I'd call a "fair" analysis of OOP.
 
C

Cor Ligthert [MVP]

Herfried,
Block-level scope is not an OO feature.
That is not the intention. The intention is to force you to use OO in VBNet.

Block-level scope learns in my opinion the behaviour of the constructing and
deconstructing from an value/object

However, I agree with you that this was for me as well a little bit a kind
of decision if I would include that in the text or not

While I left out passing values using a constructor

Cor
 
C

Cor Ligthert [MVP]

Herfried,
Databases are one example. In this field relational databases/programming
is currently used in most cases because it has benefits over
object-oriented
databases/programming. In simple scripting scenarios procedural
programming
is often sufficient and object-oriented programming is oversized.

--
I absolutly disagree with you. The concept of the dataset (what is one big
container of objects needed for database programming) is for me a good
example how by using objects than all kind of structures, values or whatever
things which are everywhere placed in a program, data handling with well
organised objects can be done more secure, documented and easier (This is as
well for me when there are own classes created to handle and store the data
objects).

The reason that with databases still a lot of non object oriented procedures
are used is because some of those programs which handles that (and used
language or methods) are from before 1980. As I have seen an in your opinion
benefit, that we forever disagree about.

However just my opinion.

Cor
 
T

Tym

Making an
argument that objects shouldn't be abstracted and modeled in classes

Being an old procedural programmer (Turbo Basic) I "migrated" to VB a
few years ago, and am now toying with VB.Net

Obviously I've grasped the principles of forms and modules, but am
lost as to what classes are!

Could someone give me an idiot's guide to what's what in vb??


---


Tym

Please do not adjust your brain, there is a fault with reality
 
C

Cor Ligthert [MVP]

Tym,

A class is a template (type) from which you can make (instance) an object.

That class (instanced object) can contain as every program
Methods
Variables (including properties the accessors to that)
Events

You can use shared (static) methods and variables in a class direct because
those are part of the application.

That is all.

I hope this helps,

Cor
 
H

Herfried K. Wagner [MVP]

Cor Ligthert said:
I absolutly disagree with you. The concept of the dataset (what is one big
container of objects needed for database programming) is for me a good
example how by using objects than all kind of structures, values or
whatever things which are everywhere placed in a program, data handling
with well organised objects can be done more secure, documented and easier
(This is as well for me when there are own classes created to handle and
store the data objects).

I was talking about relational databases query languages like SQL. Even
datasets are only a thin wrapper around relational databases and
programming. IIRC there are plans to include features for convenient access
to relational databases into the VB and C# programming languages.
 
T

Tym

A class is a template (type) from which you can make (instance) an object.

So we're back to the OOP debate again? >:->

Thanks for your explanation - are there any good online tutorials for
class modules?


---


Tym

Please do not adjust your brain, there is a fault with reality
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top