[Harbour-users] Re: OOP, ORMs etc
Jasim A Basheer
jasim.ab at gmail.com
Wed Mar 17 16:10:14 EDT 2010
On Thu, Mar 18, 2010 at 12:49 AM, <dougf at people.net.au> wrote:
> Hi all
>
> Loving this discussion!
>
> I'm an old programmer who wrote procedural code for many years and paid
> scant regard to OOP when the theoreticians started to push it. Now I'm a
> bit of a convert. That happened through a rather ambitious project from
> the pre .Net days that built web pages that behaved like traditional
> programmes "on the fly" and did some of the things that I understand .Net
> does well before Microsoft got around to it. It is still used to this
> day. The point is that when I looked at the structure of the data base
> that I had to build to hold the specification of the application what I
> had seemed to correspond pretty much to the language of OOP.
>
> Up until then I had used OOP a bit (when forced to pretty much) but that
> experience opened ny eyes a bit. I still didn't write much OOP type code
> until I discovered Harbour. Even then it took a while as I started off
> where I had left Clipper coding probably 10 years before. But once I got
> the hang of it again and saw how beautifully it fitted into the xBase
> language and how you could hide the details if you so desired, I find
> myself even thinking in terms of objects / classes etc most of the time.
Adding a few thoughts:
OOP has been widely portrayed as an overkill for writing code that
simply gets things done. All the 'inheritance', 'abstraction',
'polymorphism' kind of buzzwords did a lot of harm to the perception
regarding OOP. And most of it is thanks to C++ and Java. Here is an
interesting take on the origin of C++:
http://artlung.com/smorgasborg/Invention_of_Cplusplus.shtml
However, the new generation scripting languages like Python, Ruby and
JavaScript (and to a great extent VB 3 till VB 6) have taken some of
the best practical aspects from OOP and threw away the rest. I'm very
happy to program in these languages without worrying about 'friend'
functions or 'pure virtual methods' (!). When talking about OOP in
Harbour, I hope to see an adoption that resembles the pragmatism of
the scripting languages than the hard theoretical OOP like in C++.
One of the posts mentioned the namings of class variables - TWindow,
TForm, TWindow::TForm etc:
> (not to mention those tongue-tie, virus-like "T"s that dominates the classes name-space for absolutely useless reasons
> denoting an immanent adoration to stereotypes, which is one of the unwelcome features of OOP model.
I agree with Pete very much. I think we've rooted ourselves firmly in
the Clipper-style OOP notations like TBrowse, TBColumnNew etc. and
have sincerely followed that path. However, except for the enterprisy
languages (C++, Java, C# etc.), the new agile languages all favour
using lower case for denoting classes and variables. This could add a
lot to the readabilty of the code (IMHO) YMMV.
> If OOP isn't suitable for your application then don't use it and forget
> the theorists BUT please remember that if OOP approach is making things
> more complex, slower etc it MAY not be that OOP is unsuitable, but rather
> that your application of OOP may be sub optimal.
>
Exactly!
> I would love to share the architecture of my client-server data base back
> end (written in Harbour) and / or code but I have to drive kids to school
> just at the moment.
>
We will be looking forward to that.
> Regards to all
> xProgrammer
>
> BTW I love cBase, OOP and client-server architecture, am not fond of SQL
> and loathe UML
>
> _______________________________________________
> Harbour-users mailing list (attachment size limit: 40KB)
> Harbour-users at harbour-project.org
> http://lists.harbour-project.org/mailman/listinfo/harbour-users
>
More information about the Harbour-users
mailing list