Author Topic: Procedural or OOP lib ?  (Read 5015 times)

0 Members and 1 Guest are viewing this topic.

Offline va!n

  • Pentium
  • *****
  • Posts: 1435
  • Karma: 109
    • View Profile
    • http://www.secretly.de
Procedural or OOP lib ?
« on: March 31, 2008 »
hi guys...
when having the choise to select between a procedural and an OOP coded *.lib, with some nice functions inbuild... what lib would you like to use? The procedural or the OOP based one? (The OOP based lib could be available for procedural coding use too)

Thanks in advance for you votes / opinions...
- hp EliteBook 8540p, 4 GB RAM, Windows 8.1 x64
- Asus P5Q, Intel Q8200, 6 GB DDR2, Radeon 4870, Windows 8.1 x64
http://www.secretly.de
Challenge Trophies Won:

Offline ninogenio

  • Pentium
  • *****
  • Posts: 1668
  • Karma: 133
    • View Profile
Re: Procedural or OOP lib ?
« Reply #1 on: March 31, 2008 »
with me working in cpp and not so much in c i would say oop.

it just has so many advantages over standerd procedural code. and as you say you could use an oop lib in procedural code although it's a bit ugh.
Challenge Trophies Won:

Offline Jim

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 5301
  • Karma: 402
    • View Profile
Re: Procedural or OOP lib ?
« Reply #2 on: March 31, 2008 »
What's the difference?  Use the most suitable one/one that works.  It shouldn't affect your own code.

Jim
Challenge Trophies Won:

Offline va!n

  • Pentium
  • *****
  • Posts: 1435
  • Karma: 109
    • View Profile
    • http://www.secretly.de
Re: Procedural or OOP lib ?
« Reply #3 on: March 31, 2008 »
thanks for feedback... i just want to know how you guys think about procedural and OOP based code/libs...  i am starting learning C/CPP coding atm (first wihout OOP i think)...  Is there any big different to code procedural or OOP? (more/less code, easier/harder to code, speed?) As far as i know using OOP will be 4 bytes more for each function, but this is not an issue for me. I think in future i will try to learn and understand OOP... first i have try to learn and code C/CPP things like the 1k i started and released at BP
- hp EliteBook 8540p, 4 GB RAM, Windows 8.1 x64
- Asus P5Q, Intel Q8200, 6 GB DDR2, Radeon 4870, Windows 8.1 x64
http://www.secretly.de
Challenge Trophies Won:

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17422
  • Karma: 499
  • evil/good
    • View Profile
    • My Homepage
Re: Procedural or OOP lib ?
« Reply #4 on: March 31, 2008 »
well, i am a procedural programmer so i guess procedural for me.

oop code has a lot of advantages though, namely that your code becomes very portable and much easier to adapt.

For instance, if someone wrote an object to do a task, it can be easily imported by another programmer who wanted that object without the second programmer even needing to change anything.

I would say that if you are making anything significant then you should definately use oop.
Shockwave ^ Codigos
Challenge Trophies Won:

Offline benny!

  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4384
  • Karma: 228
  • in this place forever!
    • View Profile
    • bennyschuetz.com - mycroBlog
Re: Procedural or OOP lib ?
« Reply #5 on: March 31, 2008 »
Start off learning procedural stuff first, va!n. You
already know purebasic - so writing some c functions
isn't that hard. Especially when your aim is writing
tiny (1k) productions.

Generally speaking if you want to become a software
architect - there is nearly no way of avoiding OO
design (jaja, I know there is always an exception from
the rule).

So in that case - it would be really useful for you to
learn the object orientated part of C++ (or altenatively
choose an easier way like Java, C#).

[ mycroBLOG - POUET :: whatever keeps us longing - for another breath of air - is getting rare ]

Challenge Trophies Won:

Offline Jim

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 5301
  • Karma: 402
    • View Profile
Re: Procedural or OOP lib ?
« Reply #6 on: March 31, 2008 »
I could write a library in Common Lisp for all your app cares.  It wouldn't mean you had to write your app in CLisp.
If you code in C++ or the lib uses C or C++ runtime library you will have a much bigger problem crunching in to 1Kb - the C++ compiler is more likely to use built-in stuff that you would need to emulate if you remove the libs, eg. new and delete.
Quote
As far as i know using OOP will be 4 bytes more for each function
I wouldn't say there's any hard and fast rule.  Calling a function in a class means possibly one extra instruction, but it might get optimised away.

If you want to code commercially, you need OO skills.  C++, C# and/or Java.  (C# rocks, by the way).  If you want to be a web designer and code Javascript, you might get away without.

Jim
Challenge Trophies Won:

Offline Pixel_Outlaw

  • Pentium
  • *****
  • Posts: 1389
  • Karma: 84
    • View Profile
Re: Procedural or OOP lib ?
« Reply #7 on: April 01, 2008 »
OOP is supposedly "The Way of The Future."

I don't know if I could easily adapt to procedural. I would have to have some sort of monotone compiler running on a yellowing computer with some sort or rainbow colored apple on the side.
Challenge Trophies Won:

Offline va!n

  • Pentium
  • *****
  • Posts: 1435
  • Karma: 109
    • View Profile
    • http://www.secretly.de
Re: Procedural or OOP lib ?
« Reply #8 on: April 02, 2008 »
the question about OOP or procedural coding, is just in generall... 64k intros, demos, games... so thanks for your feedback. For 1k and 4k coding i think i will use no OOP... Now i will try to find some easy (for total beginners) and good (best in german) tutorials showing how to use/code Win32 API and OOP.
- hp EliteBook 8540p, 4 GB RAM, Windows 8.1 x64
- Asus P5Q, Intel Q8200, 6 GB DDR2, Radeon 4870, Windows 8.1 x64
http://www.secretly.de
Challenge Trophies Won:

Offline Jim

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 5301
  • Karma: 402
    • View Profile
Re: Procedural or OOP lib ?
« Reply #9 on: April 02, 2008 »
Petzold is the Windows programming bible.
http://www.google.com.au/search?hl=en&q=petzold&meta=

When I was at university, I bought a book called 'Standard C' by P.J.Plaugher and J.Brodie.  I recommend that too.  It was a very technical book, but it specs C to you enough to write anything and it has the library reference too.  It was enough for me to become an adequate C programmer, becoming an ace C programmer has taken another 15 years :P

Jim


Challenge Trophies Won:

Offline va!n

  • Pentium
  • *****
  • Posts: 1435
  • Karma: 109
    • View Profile
    • http://www.secretly.de
Re: Procedural or OOP lib ?
« Reply #10 on: April 02, 2008 »
@Jim:
Thanks for the info... i bought this book now and i will check out if there are some other petzold books i should buy to learn C/CPP with Win32 API and OOP:   

- hp EliteBook 8540p, 4 GB RAM, Windows 8.1 x64
- Asus P5Q, Intel Q8200, 6 GB DDR2, Radeon 4870, Windows 8.1 x64
http://www.secretly.de
Challenge Trophies Won:

Offline benny!

  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4384
  • Karma: 228
  • in this place forever!
    • View Profile
    • bennyschuetz.com - mycroBlog
Re: Procedural or OOP lib ?
« Reply #11 on: April 02, 2008 »
@va!n:
I have this book, too. Covers nearly everything
about WinAPI programming. Good for basic under-
standing but very focused on standard WinAPI.

(well do not know how updated it is - mine is nearly
10 years old or so).
[ mycroBLOG - POUET :: whatever keeps us longing - for another breath of air - is getting rare ]

Challenge Trophies Won:

Offline Pixel_Outlaw

  • Pentium
  • *****
  • Posts: 1389
  • Karma: 84
    • View Profile
Re: Procedural or OOP lib ?
« Reply #12 on: April 02, 2008 »
I love the excessive length of some German words. Also, I see that the book fits the general "look" of a programming book.

A good programming book will have one of two cover styles.

a. The cover contains abstract geometrical figures.
b. The cover has a black and white picture of an animal totally unrelated to the language in question.

Based on those two criteria selection is a breeze.

 :clap:
Challenge Trophies Won: