![]() |
#71 | |||
![]() ![]() ![]() ![]() ![]() ![]() |
![]() <div class='quotetop'>QUOTE(Eagg @ Aug 19 2006, 08:46 AM) [snapback]249609[/snapback]</div>
Quote:
<div class='quotetop'>QUOTE(Eagg @ Aug 19 2006, 08:46 AM) [snapback]249609[/snapback]</div> Quote:
It's not just my opinion that OO programs run slower. Why are you just trying to refute my "opinion" with your "humble opinion" anyway? Defeats the purpose of labelling yourself humble. You can either look up the information yourself, test some code yourself, or sit back and listen (assuming you know what it's all about already). Object-oriented programming is deeply based on Pointers/References/Addresses. It can be seen logically that looking up a memory address and then checking a variable will take more time than just checking a variable. Then think about objects with object members. Following pointers to pointers to pointers, you'll be slowing your program down. It's not such a big deal as I mentioned before with our awesome computer capabilities, but it does make a difference. This is why linked lists are slower than arrays most of the time. Compilers do not make everything into some super great 'native code'. You'll notice that there are usually several ways to get an identical result when programming. When run, they probably won't take the same amount of time. Without optimizations, a compiler will take exactly what you give it and convert it to machine code. When talking about "possible or impossible", it makes no difference. Every task procedural can do, OO can do and vice-versa. The problem indeed lies with complexity. Programs written procedurally can get out of hand way easier than those written in an OO style. It almost seems like you already knew when you (puzzlingly) said this... <div class='quotetop'>QUOTE(Eagg @ Aug 19 2006, 08:46 AM) [snapback]249609[/snapback]</div> Quote:
|
|||
![]() ![]() |
|
![]() |
#72 | ||
![]() ![]() ![]() ![]() ![]() Join Date: May 2006
Location: ,
Posts: 29
|
![]() Let's take C and C++ for example.
Both have their uses today, C mostly at close to hardware development (sometimes together with ASM) and C++ mostly in application/game development. So it is very likely to see an API/wrapper/library being written in C, but hardly any new "big" game, of course the game will make use of the API/wrapper/libraries. Of course I know that everything possible in oop is also possible in procedural, but when you consider something possible or impossible to develop you need to take alot of things into account. The timeframe/man power a project needs to finish is a very important aspect and can make a project financially impossible (not profitable). That is the reason I talk about complexity of programs and not the technical aspects of those. I would never say that there is no use for procedural programming, I just think there is no use for such discussions. About oop making programs run slower, I never claimed that I know that it isn't the case, it was just news to me and thought you could clear that up. That is the reason I added the "imho". English is my third language and I may understand everything but when trying to express myself I might choose my words not perfectly fitting to its intended meaning (arguing) . Don't try to "look down" on people judging by the way they write and their choice of words, over 93% of the world population does not speak English natively and there is always a difference between knowing a language and thinking in that language. |
||
![]() ![]() |
|
![]() |
#73 | |||||
![]() ![]() ![]() ![]() ![]() ![]() ![]() Join Date: Aug 2006
Location: ,
Posts: 49
|
![]() Iowa:
If you're intrested in webdesign and programming, you might want try out PHP, PHP is designed for the web, it's easy to use, and you can probably have a functional application within a few days after starting with it http://www.php.net Quote:
Define "Old computer" pentium 1? 2? 3? Many people (including myself) are using a pentium2 or 3, java simply runs slow on that, it depends a bit on the quality of the application though ... but don't try running azereus or something.... It took 8 frelling kilobytes to put a man of the moon, why should be have to use frelling GIGABYTES to write a frelling letter? Many developers have TOTALLY lost touch with reality as far as speed is concerned, every expects that you're running a dual-core pentium 4 with some fancy quadro nvidia card. This is simply not true. There are more older pc's in use than newer pc's, and this will always remain true. Like I said, most users need their pc to only write a letter and browse the internet. My point in all this: SPEED MATTERS! Not as much as it did 20 years ago, but it still matters, now we just need to get the software developers to see that... Quote:
Procedural programming can be just as effective, if used properly Quote:
Quote:
Quote:
Anyway. My disliking of OO is, offourse, also a matter of taste, I prefer traditional programming because it's simpeler, more direct, and more scalable, I know what you're thinking, OO is more scalable, this only aplies to certain situations. C can be used to manage large and complex programs, take a look at the BSD family of operating system's, it's written almost enterly in C., It's generally considered to be one of the most stable and secure operating systems. Windows, on the other hand, is written in Visual C++, and, well, do I really need to post the general opinion about windows...? |
|||||
![]() ![]() |
|
![]() |
#74 | ||
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Join Date: Aug 2006
Location: Iowa City, United States
Posts: 290
|
![]() Wow...you've all been so helpfull...i'll remember that next time I want to know something about programming.
__________________
I did it for the lulz! |
||
![]() ![]() |
|
![]() |
#75 | ||
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Join Date: Sep 2005
Location: ,
Posts: 96
|
![]() <div class='quotetop'>QUOTE(carpetsmoker @ Aug 20 2006, 12:00 PM) [snapback]249684[/snapback]</div>
Quote:
|
||
![]() ![]() |
|
![]() |
#76 | ||
![]() ![]() ![]() Join Date: Dec 2004
Location: Eindhoven, Netherlands
Posts: 1,508
|
![]() <div class='quotetop'>QUOTE(GrimFang4 @ Aug 20 2006, 12:17 AM) [snapback]249673[/snapback]</div>
Quote:
For most corporate (non real-time) applications, the maintainiblity of a program and the short(er) development times outweigh by far the execution speed. That's is why Java (J2EE) is used a lot in that sector. As for the speed. The new JIT-compiler does a pretty good job and even 3D games in Java run quite smoothly. You should however, pick the language most suitable for the task and not stick to a single one. |
||
![]() ![]() |
|
![]() |
#77 | ||
![]() ![]() ![]() ![]() ![]() Join Date: May 2006
Location: ,
Posts: 29
|
![]() Since this discussion made me curious about oop vs procedural execution speed, I wrote a little test program in C++.
I don't have time to search the program for logical errors, so I won't release it yet. But if it is all correct, it shows that the speed varies a lot depending on compiler. With VS 2005 I got remarkable results that speak for oop in this case. I will upload the source code tomorrow when I find some time to check it for errors. This, of course, does not cover the oop languages vs procedural languages dialog, but only tests the truth behind the general statement: "oop makes programs slower" in C++ case. |
||
![]() ![]() |
|
![]() |
#78 | ||
![]() ![]() ![]() Join Date: Dec 2004
Location: Eindhoven, Netherlands
Posts: 1,508
|
![]() It might only prove you're OO skills are not very high :|
I can write an OO program that is slow. Just instatiate a zillion objects; fill the heap with crap and voila. Slomo. Doesn't prove a thing. |
||
![]() ![]() |
|
![]() |
#79 | ||
![]() ![]() ![]() ![]() ![]() Join Date: May 2006
Location: ,
Posts: 29
|
![]() <div class='quotetop'>QUOTE(Reup @ Aug 22 2006, 09:09 AM) [snapback]250143[/snapback]</div>
Quote:
Saying that oop makes it slower means that the same "function/idea" programmed with objects would run slower than without. |
||
![]() ![]() |
|
![]() |
#80 | ||
![]() ![]() ![]() ![]() ![]() ![]() |
![]() <div class='quotetop'>QUOTE(Reup @ Aug 21 2006, 05:11 AM) [snapback]249863[/snapback]</div>
Quote:
Quote:
[/b][/quote] OO is based on Pointers/References/Addresses when done correctly in C++/Java/Perl. You really have no choice but to use the implementation that your compiler uses. I didn't think it would be necessary, since we all know that functions and pointers take longer to work with than plain variables, but here's the code. I exaggerated the pointer to show that it is slower than procedural. C++ uses two forms of OO compared to Java. The first part of this test program is a variable that is an object. That isn't used too often when you're making a serious program, so I also have the pointer to an object (actually a triple pointer). The point is that any full implementation of the OO paradigm is slower than a procedural implementation because you sacrifice speed for modularity and programming ease. That's a basic lesson in Comp Sci 2. Word? Code:
#include <iostream> #include "time.h" using namespace std; class test { public: ****long setDatum(long i) ****{ ********datum = i; ****} ****long datum; }; int main() { ****test OODatum; ****test*** OOPtr = new test**; *****OOPtr = new test*; ******OOPtr = new test; ****long ProcDatum; ****clock_t startTime; ****clock_t endTime; ****for (int trials = 0; trials < 2; trials++) ****{ ********float avg = 0; ********for (int j = 0; j < 10; j++) ********{ ************startTime = clock(); ************for (int i = 0; i < 100000000; i++) ****************OODatum.datum = i; ************endTime = clock(); ************avg += endTime - startTime; ********} ********cout << endl << "OO Avg time taken: " << avg / 10 << endl; ********avg = 0; ********for (int j = 0; j < 10; j++) ********{ ************startTime = clock(); ************for (int i = 0; i < 100000000; i++) ****************OODatum.setDatum(i); ************endTime = clock(); ************avg += endTime - startTime; ********} ********cout << endl << "OO w/Func Avg time taken: " << avg / 10 << endl; ********avg = 0; ********for (int j = 0; j < 10; j++) ********{ ************startTime = clock(); ************for (int i = 0; i < 100000000; i++) ****************(***OOPtr).datum = i; ************endTime = clock(); ************avg += endTime - startTime; ********} ********cout << endl << "OO w/Ptr Avg time taken: " << avg / 10 << endl; ********avg = 0; ********for (int j = 0; j < 10; j++) ********{ ************startTime = clock(); ************for (int i = 0; i < 100000000; i++) ****************ProcDatum = i; ************endTime = clock(); ************avg += endTime - startTime; ********} ********cout << endl << "Proc Avg time taken: " << avg / 10 << endl; ****} ****system("PAUSE"); ****return 0; } |
||
![]() ![]() |
|
![]() |
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Translating Abandonia To Other Languages | Kosta | Old News | 267 | 14-03-2010 01:23 AM |
Different Languages = Different Versions? | Vikingblood80 | Old Suggestions | 14 | 09-02-2006 01:08 PM |
Languages | Grinder | Blah, blah, blah... | 34 | 30-07-2005 12:03 PM |
Languages #2 | Grinder | Blah, blah, blah... | 3 | 29-07-2005 12:39 PM |
|
|
||
  |