It's not the matter of making something that works, it's the matter of making something that is easy to maintain and evolve. Procedural programs gradually become harder to modify as they evolve, while OOP programs much less so.
Like i said above, more flexible and convenient, yes they are that. Although you do realise "procedural" might not be the right description? Since C++ can also be called procedural AND OOP.
Procedural paradigm is fine for something solid that won't change much.
I´m not sure i can agree on that though, because some languages, like Amiga Basic can effectively do everything that OOP can, it just works and looks different. Without inheriting all the annoyances that i have learned to loathe with vehemence within OOP.
But! As soon as you need two somethings where you had one something written using functions and global variables... You're screwed.
Why? I mean did you loose the sourcecode or something? Otherwise you add another "something" and recompile it/run it. Yes it takes a few minutes to write, it´s not the end of the world unless you need it to be highly complex.
I gradually learned to form my code as a few large classes with lots of methods and lots of fields. Even if each class does ever have only one instance. Because it allows me to "pack and leave" without much fuss, if a need arises. Use chunk of one project in another, add or change some functionality withour changing the code base (virtual methods are mightily convenient, I'm telling you). Things like that.
Decent approach. And probably vastly better than mine for anything someone else is going to look at, i tend to just sit down and write on intuition, worked well for me, but whenever my friend (with actual programming education) looked at my code he couldn´t figure it out at all most of the time.
PCHeintz72 wrote:As for OOP... in any language that can support it, prefer modular discreet programming to full OOP for smaller projects... with larger blocks or pure data blocks among external code/include files (by whatever the language calls them). Programmed right, doing it this way can make a program OOP ready, and easier to port, as each block does specific functionality and can be easier to port or alter.
Pretty much what i did in Amiga Basic. Wrote up a bundle of codeblocks that i could then copy and paste into a new program, with standardised variable names to make it easy.
I've never needed the extreme compactness nor speed of assembly or machine code. I cannot argue though that if you can code in it, it is by far the single best approach to a one off program. I can see though for larger projects it being a bit of a nightmare for upgrades.. And impossible to use if the goal is multiplatform.
Aye, it is definitely the best thing to program in, from a USER standpoint, as it´s smaller and seriously better performing, but upgrades, well you basically have to make it so that any upgrades replaces whole individual files without introducing any new connections unless you replace all files involved.
Both have benefit that if you can code in them, learning many other languages can be easy since even if different it is similar. Both can depending on version support multi threading and multi processor. Both are extensible.
*sigh*
Yeah i know, i sooo totally wish NOW, that i had continued learning to use the Pascal plugin module i had for the C128. Was extremely useful to have the language, compiler and all instantly loaded by just turning the computer off and plugging in the module.
Spokavriel wrote:Boiling it down to the Machine Code is how this one guy got a Linux version to fit onto a single floppy disk. Full GUI and capable of handling just about everything the full version did but it's just locked down to one processor family. The full version took half a CD for the so called flexibility and less reliability.
It definitely has some advantages, but sadly it´s such a bother to program with.
If you can get to the point where you can write machinecode fluidly and without mistakes, then you can do wonders, but getting to that point, *eeep*, not easy.