Re:I've been using vi for so long...
on
The Birth of vi
·
· Score: 1
And from the point of an Emacs user, it doesn't seem so different to need to hit C-X before some commands, than to hit ESC and:.
Except that holding the control key down and then pressing another key is a good way to get wrist problems. I think it's quite appropriate that Richard Stallman got RSI seeing as he's the one largely responsible for inflicting Emacs on us.
I thought the use of hung for people was bad form, so shouldn't it be: "Chris had the good looks of Antonio Banderas and was hanged like John Holmes."?
Whatever happened to NPOV (Neutral Point Of View) in Wikipedia articles? Or can you say anything as long as you prefix it with "It has been said..."? If so I'm going to create an article about me with the line "It has been said that Chris has the good looks of Antonio Banderas and is hung like John Holmes".
Documents are worth far more than software, and they outlive the applications used to create them. See the comment to the original article - reading documents after 5, 20, 30, 100 years or more is not optional.
Which is why medical, legal and military records are often not held in word processor formats. For instance, the military records I have dealt with (NATO mostly) are held in SGML, conforming to carefully designed MIL DTD's that preserve structure rather than presentation. These files can be translated faithfully into HTML, PDF and so on without losing there meaning.
Sadly, as MS Word has become all too pervasive, more and more documents are stuck in a format where you cannot reliably extract data or convert it. For instance, with the processing system for scientific journal articles I worked on a table of contents can't be generated from Word documents, as headings are usually just inline styling that isn't even consistent within a single document. Years ago, the journal publishers could insist on properly structured data (LaTeX for instance), but nowadays scientists are too lazy - all they care about is the cheap thrill of seeing their article in print, sod anyone who wants to index or cross reference the data for future use.
I once saw NT running on a DEC Alpha, all be it briefly. A firm I worked for leased a machine (back in 1996 I think) which had already been used by another company. When we fired it up, the disks hadn't been wiped and we were able to boot it into NT. We promptly shut it down and installed VMS.
I briefly worked for a dodgy website that was trying to be a sort of Yahoo! for music, but wanted to entice users into creating new content for free that then a couple of editors would tart up. Despite having seven marketing staff, I was the only techie (I subsequently found out that the three previous techies had left after disputes with the boss - not bad for a company less than a year old). The entire company was run off a single PC running RedHat Linux 5 - database, email, webserver and fileserver. They had installed everything, back when doing so meant it was enabled by default, and no firewall rules had been setup. No updates had been installed either. I pointed out that this was a disaster waiting to happen, but was told to forget about it, as updating and cleaning the machine would require a reboot and therefore an outage. No budget was available for a spare machine, as the bosses boyfriend kept buying stupid things for the office such as expensive modern art and uncomfortable designer chairs.
When the inevitable happened, and the server got hacked, the boss accused me of doing it. Once I stopped laughing, I asked her why I'd hack a machine I had the root password to. She then insisted it had to be an inside job, as hacking was such a superhuman feat in her opinion. I told her to stuff her opinion and quit. She then tried to hold me to my contracted notice period of three months, until I threatened to take her to court for constructive dismissal.
A couple of questions you may be able to answer - if MVCC is being done in memory, and disk writes being delayed as long as possible, then I stand to lose an awful lot of data if my master DB server goes down dont't I? My slave will be well behind, and even if I can recover the master, then a lot of data wont have been saved to disk and the log checkpoints will be just as stale. Or is this some compromise, where a commit triggers a write to disk? If so, then I still don't get what's so great, as in all the systems I have worked on, rolled back transactions are very infrequent compared to committed ones.
InnoDB is licensed under the GPL. InnoDB is no more dependent on Oracle then Linux is on Red Hat. MySQL could if need be develop InnoDB themselves.
Except that a large chunk of MySQL AB's revenue would disappear as they'd no longer be able to sell a commercial version of their database with InnoDB support. And believe me, few people are going to buy the commercial version if the preferred storage engine is MyISAM. MySQL pay InnoSoft for the right to distribute the InnoDB engine as part of their commercial version - whether Oracle allows them to renew this agreement when it expires is somewhat doubtful.
I seem to remember hearing that the newest intel chips have hardware protection that prevents the execution of code loaded into data buffers (i.e., buffer overrun attacks) - could that have an effect?
Don't know, however the "exploit" doesn't work on my PowerPC based Mac either.
I don't know if D gives the features of Perl with the speed of C, but it's certainly a step in the right direction.
Well I for one hope that D doesn't give the features of Perl. Perl is the C++ of scripting languages - far too many idioms for doing the same thing, poor support for Object Oriented Programming and a complex grammar. The virtues of C include its relative simplicity, which means a competent programmer can understand the entire language and standard library without having to resort to a reference manual all the time. A language like Objective C shows that OOP support could be elegantly added to C, unlike the over-engineered mess of C++ which evolved in a haphazard manner, making some poor design decisions along the way. While I haven't looked deeply at D yet I'm encouraged by the design decisions, such as "virtual methods by default", which suggest the elssons of C++ have been learned by some people at least.
Nice try, but you have to write the WSDL before calling your WSDL compiler, that's time consuming, as the WSDL authoring tools I'm aware of are totally inadequate.
What you're describing - an interface in a C like syntax - is exactly what CORBA IDL provides. While CORBA has its own set of problems, it is a far better solution than SOAP. SOAP is incredibly tedious to develop for, and difficult to optimise as it's predicated on XML parsing which is an inefficient format for what is essentially an RPC mechanism.
I think they will store energy when the wind is strong and get the stored energy out when the wind is weak. There are many ways to store energy, my question is which one do they use and why?
Hydro power. In Scotland and Wales, there are a number of installations that pump water into reservoirs during periods when demand for electricity is low, and then release the water through turbines during periods of peak demand. I saw the construction site for one of these projects as a child, and it was impressively huge - plus it was completely invisible from the outside as it was inside a Welsh mountain.
As for the GUI software, the MySQL GUI Admin/query browser stuff is shinier than PgAdmin3 - but the MacOS version of the former is a complete crashfest! Neither of them steps up to the plate of providing a FOSS equivalent of (the good bits) of MS Access.
If you're talking about the MySQL GUI clients that are written in C++, then I strongly suggest you take a look at the source code. About eighteen months ago I tried to port the new clients to NetBSD as the older client wouldn't work with MySQL 4.1 (MySQL AB seem to rewrite their GUI clients from scratch every couple of years). Never have I seen such poor C++ coding in a fairly high profile project. I gave up trying to port them in the end (too many Linuxisms) and wrote a simple client in Java.
he's responsible for many of the design principals embodied in the Mac's OS
MacOS up to version 9, which was such a mess that it was replaced wholly by another operating system. That replacement, MacOS X, was NeXT's creation, and has nothing to do with Norman.
> Firstly templates. They are just void pointers with type safety.
This is thoroughly wrong it's hard to keep my reply polite. You'd be roughly correct about the generic support in Java, but about C++ templates, your statement is completely, totally and thoroughly wrong. I can't do anything approaching justice to the subject here, but I'd recommend reading Modern C++ Design by Andrei Alexrandescu, to at least start getting a clue about how much more there really is to templates. You might also want to look at the source code to The boost library for more along the same general line (e.g. take a look at boost Lambda, which is quite different from anything you can do with void pointers.
A colleague at work loaned me the Alexrandescu book, and while it's got some neat tricks in it, they're hardly what template support was originally intended to be used for. As I recall, even the book acknowledges that in the preface. It left me with a feeling of "neat, but it's a hack all the same". However, if you've mastered these ideas sufficently that they can be used productively, then I'm very happy for you. As for boost, I'm well aware that it's the testing ground for yet more fluff that will make its way into a future C++ standard. A classic case of ignoring the fact that C++ needs to go and diet, and chucking more "paradigms" into it instead. No wonder compiler writers are complaining that its nearly impossible to write a standards compliant C++ compiler - just getting the parser right is a nightmare, let alone trying to write a good intermediate code generator.
Firstly templates. They are just void pointers with type safety. While that safety is a very nice thing to have, it does have performance costs. The thing is, in practice the overhead of the type checking is superfluous as very few bugs are down to bad casts in functionally similar C code. And while I'm considering performance, despite another poster claiming it's a linker issue, vtable lookups do impact performance regardless of whether you blame the linker or the compiler. The language requiring something like vtable support is the real culprit, excacerbated by the debatable way that C++ handles method resolution. In Java, if I call List.get() on an object that is actually an ArrayList, I get the ArrayList version of the method - the most derived one - not the List implementation. In C++, I get the List implementation (this ignores the fact that List is an interface in Java, but you should get the gist of what I'm saying). In practice, the C++ way of doing this is counter intuitive, despite the fact that the C++ way seems more logical from a syntax point of view.
As for the inlining of sorting code, in a test I just ran the sorting function was inlined in a C example just like the use of std::sort() you described. The difference is that my sort resulted in far less assembler instructions than the C++ std::sort() one, although I did have to spend an extra couple of minutes copying the sort code from a Sedgewick book.
Finally, the iostream library. I spent part of this afternoon refactoring a loop that was proving to be a bottleneck in some C++ code. It relied on ostringstream to turn an unsigned integer into a string, and then passed the std::string representation to be added to an STL list. I refactored the code to use malloc (having determined the number of decimal digits in the number) and snprintf, then passed the C string to be added to the list. This resulted in a roughly 20% speedup, despite the malloc calls. The reason being that the ostringstream had to be allocated on each pass of the loop, as it provides no means I can see to effectively "flush" it at the end of each pass. Yet another reason the C++ iostream library is a pain in the arse. Switching to a minimal hand coded list class (something that I'd be suprised if many experienced programmers don't already have to hand), resulted in a further speedup of around 5%.
So JSP is for people who understand Java buzzwords and PHP is like a joke compared to JSP, eh?
Smalltalk "buzzwords" actually, that predate Java by years. If you don't know what MVC is, go and look it up. If you still think it's rubbish, then I hope I never get to use any of your code. As for POJO's, they are classes that encapsulate some funtionality (such as user administration for example) but they contain no presentation logic such as a user interface. Multiple interfaces can be created (Swing, JSP, etc) that sit on top of the POJO's - saving you having to refactor the code or duplicate it.
Because it's easier to suck in writing at least portable code and therefore using Java instead of being a real programmer and using PHP (which is portable), eh?
I can write portable code in C or C++, however I have to do a lot of testing. With Java my testing is much more straightforward, as I can even use the same test suites on different platforms (JUnit and JMeter for example). As for PHP, I'll wait until it can do some more of the things that Java can rather than being just a piss-poor web templating language.
Nope, different markets. JSP is for people who understand the Model, View, Controller architecture and are capable of building systems around generalised code (POJO's). PHP is ideal for small scale web apps, but that's it - it encourages unstructured code and no separation between presentation and business logic tiers.
But it's so slow and far away from the reality of productive systems that the Apache crew rather forked their server to a Java-only server (Tomcat) to keep their httpd codebase clean and free of anything that is Java.
Tomcat originated with Sun, as a proof of concept web container. The code was donated to the Apache foundation, and there has never been any plan to merge it with the Apache HTTP daemon. People usually proxy from Apache to Tomcat, as they have static content to serve as well, or just to keep web servers in the DMZ behind a single firewall and the web container servers behind a second firewall so that database connections and things like CORBA connections are more secure.
EVen if Java is open source now. There is a reason why Java applets have become almost distinct. Even Flash evidently performs better than an Java applet.
I assume you mean "extinct" rather than "distinct". However, applets have bugger all to do with JSP and webapps. They were a neat way of promoting the Java platform when it came out, but are tiny part of what made Java popular.
And why the hell would anyone still need this "Compile once, run anywhere." nonsense?
Because it's easier to port a virtual machine than a complete toolchain.
What's causing the OutOfMemory errors? If a pair of servers are falling over at 16 simultaneous requests for a 301 row dataset, there's a major problem.
They're probably caused by not upping the default for the maximum amount of memory the JVM will use and not using a database connection pool. Considering how inept the rest of the "Streaming Presidents" article is, it wouldn't surprise me if these are the problems.
Of course the compiler doesn't generate equivalent code for a C program and a C++ one, unless your simply compiling C with a C++ compiler because your platform doesn't provide a C one. For starters, there's name mangling and vtable lookups which bloat the code and slow it down. Then there's the overhead of the STL if you're using it. As a quick test, I wrote two programs with equivalent functionality in C and C++. They both use a hand coded linked list, with the C++ one implemented as a class. The compiled C++ code is 44% bigger than the C code (the STL wasn't used in the C++ code nor were excpetions, however the iostream library was used) and in a timed test run the C++ code is 21% slower.
And from the point of an Emacs user, it doesn't seem so different to need to hit C-X before some commands, than to hit ESC and :.
Except that holding the control key down and then pressing another key is a good way to get wrist problems. I think it's quite appropriate that Richard Stallman got RSI seeing as he's the one largely responsible for inflicting Emacs on us.
I thought the use of hung for people was bad form, so shouldn't it be: "Chris had the good looks of Antonio Banderas and was hanged like John Holmes."?
Having watched the Saddam video, I hope not.
Whatever happened to NPOV (Neutral Point Of View) in Wikipedia articles? Or can you say anything as long as you prefix it with "It has been said ..."? If so I'm going to create an article about me with the line "It has been said that Chris has the good looks of Antonio Banderas and is hung like John Holmes".
Documents are worth far more than software, and they outlive the applications used to create them. See the comment to the original article - reading documents after 5, 20, 30, 100 years or more is not optional.
Which is why medical, legal and military records are often not held in word processor formats. For instance, the military records I have dealt with (NATO mostly) are held in SGML, conforming to carefully designed MIL DTD's that preserve structure rather than presentation. These files can be translated faithfully into HTML, PDF and so on without losing there meaning.
Sadly, as MS Word has become all too pervasive, more and more documents are stuck in a format where you cannot reliably extract data or convert it. For instance, with the processing system for scientific journal articles I worked on a table of contents can't be generated from Word documents, as headings are usually just inline styling that isn't even consistent within a single document. Years ago, the journal publishers could insist on properly structured data (LaTeX for instance), but nowadays scientists are too lazy - all they care about is the cheap thrill of seeing their article in print, sod anyone who wants to index or cross reference the data for future use.
I once saw NT running on a DEC Alpha, all be it briefly. A firm I worked for leased a machine (back in 1996 I think) which had already been used by another company. When we fired it up, the disks hadn't been wiped and we were able to boot it into NT. We promptly shut it down and installed VMS.
I briefly worked for a dodgy website that was trying to be a sort of Yahoo! for music, but wanted to entice users into creating new content for free that then a couple of editors would tart up. Despite having seven marketing staff, I was the only techie (I subsequently found out that the three previous techies had left after disputes with the boss - not bad for a company less than a year old). The entire company was run off a single PC running RedHat Linux 5 - database, email, webserver and fileserver. They had installed everything, back when doing so meant it was enabled by default, and no firewall rules had been setup. No updates had been installed either. I pointed out that this was a disaster waiting to happen, but was told to forget about it, as updating and cleaning the machine would require a reboot and therefore an outage. No budget was available for a spare machine, as the bosses boyfriend kept buying stupid things for the office such as expensive modern art and uncomfortable designer chairs.
When the inevitable happened, and the server got hacked, the boss accused me of doing it. Once I stopped laughing, I asked her why I'd hack a machine I had the root password to. She then insisted it had to be an inside job, as hacking was such a superhuman feat in her opinion. I told her to stuff her opinion and quit. She then tried to hold me to my contracted notice period of three months, until I threatened to take her to court for constructive dismissal.
A couple of questions you may be able to answer - if MVCC is being done in memory, and disk writes being delayed as long as possible, then I stand to lose an awful lot of data if my master DB server goes down dont't I? My slave will be well behind, and even if I can recover the master, then a lot of data wont have been saved to disk and the log checkpoints will be just as stale. Or is this some compromise, where a commit triggers a write to disk? If so, then I still don't get what's so great, as in all the systems I have worked on, rolled back transactions are very infrequent compared to committed ones.
InnoDB is licensed under the GPL. InnoDB is no more dependent on Oracle then Linux is on Red Hat. MySQL could if need be develop InnoDB themselves.
Except that a large chunk of MySQL AB's revenue would disappear as they'd no longer be able to sell a commercial version of their database with InnoDB support. And believe me, few people are going to buy the commercial version if the preferred storage engine is MyISAM. MySQL pay InnoSoft for the right to distribute the InnoDB engine as part of their commercial version - whether Oracle allows them to renew this agreement when it expires is somewhat doubtful.
I seem to remember hearing that the newest intel chips have hardware protection that prevents the execution of code loaded into data buffers (i.e., buffer overrun attacks) - could that have an effect?
Don't know, however the "exploit" doesn't work on my PowerPC based Mac either.
I don't know if D gives the features of Perl with the speed of C, but it's certainly a step in the right direction.
Well I for one hope that D doesn't give the features of Perl. Perl is the C++ of scripting languages - far too many idioms for doing the same thing, poor support for Object Oriented Programming and a complex grammar. The virtues of C include its relative simplicity, which means a competent programmer can understand the entire language and standard library without having to resort to a reference manual all the time. A language like Objective C shows that OOP support could be elegantly added to C, unlike the over-engineered mess of C++ which evolved in a haphazard manner, making some poor design decisions along the way. While I haven't looked deeply at D yet I'm encouraged by the design decisions, such as "virtual methods by default", which suggest the elssons of C++ have been learned by some people at least.
Nice try, but you have to write the WSDL before calling your WSDL compiler, that's time consuming, as the WSDL authoring tools I'm aware of are totally inadequate.
What you're describing - an interface in a C like syntax - is exactly what CORBA IDL provides. While CORBA has its own set of problems, it is a far better solution than SOAP. SOAP is incredibly tedious to develop for, and difficult to optimise as it's predicated on XML parsing which is an inefficient format for what is essentially an RPC mechanism.
A couple of links to hydro storage installations:
Dinorwig
Ffestiniog
Not sure if these were the ones I saw as a kid, although the first one fits the time frame.
I think they will store energy when the wind is strong and get the stored energy out when the wind is weak. There are many ways to store energy, my question is which one do they use and why?
Hydro power. In Scotland and Wales, there are a number of installations that pump water into reservoirs during periods when demand for electricity is low, and then release the water through turbines during periods of peak demand. I saw the construction site for one of these projects as a child, and it was impressively huge - plus it was completely invisible from the outside as it was inside a Welsh mountain.
How about a MW output.
1.3GW according to the Register article.
As for the GUI software, the MySQL GUI Admin/query browser stuff is shinier than PgAdmin3 - but the MacOS version of the former is a complete crashfest! Neither of them steps up to the plate of providing a FOSS equivalent of (the good bits) of MS Access.
If you're talking about the MySQL GUI clients that are written in C++, then I strongly suggest you take a look at the source code. About eighteen months ago I tried to port the new clients to NetBSD as the older client wouldn't work with MySQL 4.1 (MySQL AB seem to rewrite their GUI clients from scratch every couple of years). Never have I seen such poor C++ coding in a fairly high profile project. I gave up trying to port them in the end (too many Linuxisms) and wrote a simple client in Java.
A progressive Christian is someone who actually does what the Bible says to do
Well I guess that excludes me, as I've been serious thought to coveting my neighbour's ox lately.
The "news" is that Stefan Esser unsubscribed from the security@php.net mailing list.
That may be how Suraski is describing it, but if you read you'll find a slightly different story.
he's responsible for many of the design principals embodied in the Mac's OS
MacOS up to version 9, which was such a mess that it was replaced wholly by another operating system. That replacement, MacOS X, was NeXT's creation, and has nothing to do with Norman.
> Firstly templates. They are just void pointers with type safety.
This is thoroughly wrong it's hard to keep my reply polite. You'd be roughly correct about the generic support in Java, but about C++ templates, your statement is completely, totally and thoroughly wrong. I can't do anything approaching justice to the subject here, but I'd recommend reading Modern C++ Design by Andrei Alexrandescu, to at least start getting a clue about how much more there really is to templates. You might also want to look at the source code to The boost library for more along the same general line (e.g. take a look at boost Lambda, which is quite different from anything you can do with void pointers.
A colleague at work loaned me the Alexrandescu book, and while it's got some neat tricks in it, they're hardly what template support was originally intended to be used for. As I recall, even the book acknowledges that in the preface. It left me with a feeling of "neat, but it's a hack all the same". However, if you've mastered these ideas sufficently that they can be used productively, then I'm very happy for you. As for boost, I'm well aware that it's the testing ground for yet more fluff that will make its way into a future C++ standard. A classic case of ignoring the fact that C++ needs to go and diet, and chucking more "paradigms" into it instead. No wonder compiler writers are complaining that its nearly impossible to write a standards compliant C++ compiler - just getting the parser right is a nightmare, let alone trying to write a good intermediate code generator.
Firstly templates. They are just void pointers with type safety. While that safety is a very nice thing to have, it does have performance costs. The thing is, in practice the overhead of the type checking is superfluous as very few bugs are down to bad casts in functionally similar C code. And while I'm considering performance, despite another poster claiming it's a linker issue, vtable lookups do impact performance regardless of whether you blame the linker or the compiler. The language requiring something like vtable support is the real culprit, excacerbated by the debatable way that C++ handles method resolution. In Java, if I call List.get() on an object that is actually an ArrayList, I get the ArrayList version of the method - the most derived one - not the List implementation. In C++, I get the List implementation (this ignores the fact that List is an interface in Java, but you should get the gist of what I'm saying). In practice, the C++ way of doing this is counter intuitive, despite the fact that the C++ way seems more logical from a syntax point of view.
As for the inlining of sorting code, in a test I just ran the sorting function was inlined in a C example just like the use of std::sort() you described. The difference is that my sort resulted in far less assembler instructions than the C++ std::sort() one, although I did have to spend an extra couple of minutes copying the sort code from a Sedgewick book.
Finally, the iostream library. I spent part of this afternoon refactoring a loop that was proving to be a bottleneck in some C++ code. It relied on ostringstream to turn an unsigned integer into a string, and then passed the std::string representation to be added to an STL list. I refactored the code to use malloc (having determined the number of decimal digits in the number) and snprintf, then passed the C string to be added to the list. This resulted in a roughly 20% speedup, despite the malloc calls. The reason being that the ostringstream had to be allocated on each pass of the loop, as it provides no means I can see to effectively "flush" it at the end of each pass. Yet another reason the C++ iostream library is a pain in the arse. Switching to a minimal hand coded list class (something that I'd be suprised if many experienced programmers don't already have to hand), resulted in a further speedup of around 5%.
So JSP is for people who understand Java buzzwords and PHP is like a joke compared to JSP, eh?
Smalltalk "buzzwords" actually, that predate Java by years. If you don't know what MVC is, go and look it up. If you still think it's rubbish, then I hope I never get to use any of your code. As for POJO's, they are classes that encapsulate some funtionality (such as user administration for example) but they contain no presentation logic such as a user interface. Multiple interfaces can be created (Swing, JSP, etc) that sit on top of the POJO's - saving you having to refactor the code or duplicate it.
Because it's easier to suck in writing at least portable code and therefore using Java instead of being a real programmer and using PHP (which is portable), eh?
I can write portable code in C or C++, however I have to do a lot of testing. With Java my testing is much more straightforward, as I can even use the same test suites on different platforms (JUnit and JMeter for example). As for PHP, I'll wait until it can do some more of the things that Java can rather than being just a piss-poor web templating language.
Wow, so much ignorance in just one post.
JSP is a nice try to eat into the PHP market.
Nope, different markets. JSP is for people who understand the Model, View, Controller architecture and are capable of building systems around generalised code (POJO's). PHP is ideal for small scale web apps, but that's it - it encourages unstructured code and no separation between presentation and business logic tiers.
But it's so slow and far away from the reality of productive systems that the Apache crew rather forked their server to a Java-only server (Tomcat) to keep their httpd codebase clean and free of anything that is Java.
Tomcat originated with Sun, as a proof of concept web container. The code was donated to the Apache foundation, and there has never been any plan to merge it with the Apache HTTP daemon. People usually proxy from Apache to Tomcat, as they have static content to serve as well, or just to keep web servers in the DMZ behind a single firewall and the web container servers behind a second firewall so that database connections and things like CORBA connections are more secure.
EVen if Java is open source now. There is a reason why Java applets have become almost distinct. Even Flash evidently performs better than an Java applet.
I assume you mean "extinct" rather than "distinct". However, applets have bugger all to do with JSP and webapps. They were a neat way of promoting the Java platform when it came out, but are tiny part of what made Java popular.
And why the hell would anyone still need this "Compile once, run anywhere." nonsense?
Because it's easier to port a virtual machine than a complete toolchain.
What's causing the OutOfMemory errors? If a pair of servers are falling over at 16 simultaneous requests for a 301 row dataset, there's a major problem.
They're probably caused by not upping the default for the maximum amount of memory the JVM will use and not using a database connection pool. Considering how inept the rest of the "Streaming Presidents" article is, it wouldn't surprise me if these are the problems.
Of course the compiler doesn't generate equivalent code for a C program and a C++ one, unless your simply compiling C with a C++ compiler because your platform doesn't provide a C one. For starters, there's name mangling and vtable lookups which bloat the code and slow it down. Then there's the overhead of the STL if you're using it. As a quick test, I wrote two programs with equivalent functionality in C and C++. They both use a hand coded linked list, with the C++ one implemented as a class. The compiled C++ code is 44% bigger than the C code (the STL wasn't used in the C++ code nor were excpetions, however the iostream library was used) and in a timed test run the C++ code is 21% slower.