If you don't mind I'm gonna continue this argument, as I think it has a lot of pedagogical value (if you want to take it offline, feel free to e-mail me at AT.cc)
I'll start by saying that STL was designed for references, and as a consequence it feels a little bit more natural to write code for it with references. However, the examples in your reply can be done with pointers easily (including the pair). Nothing prevents you from redefining the comparison operator for pointers (with a friend), or better yet, give the collection a custom-made Comparator.
Furthermore, by using pointers you're shielded from a very common mistake that, in the best case scenario, will lead unnecessary copies on the stack - it's quite easy to forget one & in your code and... copy constructor. With pointers it's not the problem as the compiler will immediately barf (one way or the other).
I might be missing something - let me know if that's the case.
Think how much loss in revenue to Linux companies they created... There are quite a few executives who thought "let's wait until the trial is over before we make any move to Linux".
Such lawyers destroy, people employed by Linux companies create, and generate real economical value.
In my original post I said that I dislike operator overloading and abused templates - I actually use templates a lot, but only class templates and only with types, and I try to avoid mixing inheritance with templates as much as I can.
So if you don't mind, I'd greatly appreciate an example of references making your life easier with templates.
Operator overloading - the most abused feature, as it makes coders feel "in control". It's very rarely useful for non-library stuff (container/matrix/numeric code that's already coded), but it manages to screw up projects very easily through abuse.
References. They're simply idiotic. You can't really do useful stuff with them, as they can't be NULL, . Java references are fine, C++ references - a pointless feature meant to save you a "*" or "->", that doesn't really offer any advantage over pointers, but manages to make code unreadable if you use pointers, statics and references at the same time.
Memory management. Either you are a high-level language and you do GC, or you're low level (like C) and you fully control it. C++ manages to get the worst of both worlds here, as object orientation w/o GC is a big mess. (leaks because "ownership contracts" are not respected are very common)
Templates. I do think generic types are a good idea, but what's the f* point of making the template sub-language Turing complete?? (Yes, you can write partial recursive functions to be evaluated at compile time...). Furthermore, if you allow member functions to be templated individually of the class, things can get really tricky.
Multiple inheritance. Everything's ok, until you get a piece of code that works when you inherit A then B, but fails if you do it the other way around. Happened to me...
Higher frequency means more switching activity per second, and slightly higher voltage for good noise margins. It also needs smaller feature sizes, which (surprisingly enough) means more power consumption as well (increased resistivity for thinner wires, more leakage b/c of electron tunneling)
From a power standpoint it is generally more advantageous to do more computation per clock at a lower frequency than less computation at higher frequency. Of course, many other aspects of the design matter (like cache layout, etc)
Anyway, at the current level (I'm talking 1.5GHz to 2.5GHz Intel processors or perf-equivalent AMDs), performance is not an issue anymore for most home & office uses (with the exception of some highend games and realtime mpeg4 video encoding).
At least the chipmakers are happy with M$. As the software gets slower and slower, you need better procs to compensate.
Arafat is actually geographical. If you don't believe me, google for "Arafat plains".
Both Arafat and Sharon took their last name from geographical locations that have historical connotations for their respective peoples.
But I agree, it'd be quite difficult to climb Arafat...
The Megapixel illusion
on
Beyond Megapixels
·
· Score: 2, Informative
People buy megapixels instead of quality for the same reason they buy gigahertz instead of performance: it's a simple quantity (number) and it's very easy to compare two products by this number (although sometimes it's meaningless)
With digicams, megapixels only matter (these days) for large prints, especially since most monitors these days are used at 1024x768, which is... 768 kPixels:).
How about using SNR ? I know it's difficult to compute, but reviewers could use VHQ analog film, film-scan it and compare the output to digital output.
That game provided me more dramatic entertainment than two thirds of the movies I've seen. It convinced me beyond any doubt that games are a form of art.
But his applied utopia (effectively stalinism) killed about 100M people (see "The Black Book of Communism" by Curtois et al.)
Sure, many people argue that communism wasn't "true" communism as Marx defined it. But I'd similarly argue that it's impossible to implement what Marx proposed with homo sapiens.
Approx quote: "with enough layoffs we'll be able to make a profit without selling any product".
Guess Sun is following their way.
BTW, their processors have sucked for quite a while now, they were getting server performance from "the power of many" (i.e. by putting lots of processors in SMP or SMP/NUMA configurations). AMD's Opteron beats the crap out of a Sparc IV (with server benchmarks), it's just that there aren't solutions for more than 8 chips on a board for AMD (AFAIK)
There are extremely few albums with more than a third of the tunes "interesting" (de gustibus non disputandum, of course). IMNSHO most artists do one or at most two hits, and fill the rest of the CD with lameware. I don't mind paying 1$/good tune or even more (Apples' itunes is great in that respect), but don't force lameware down my throat.
Eventually, on-line music distribution will increase quality, as artists will focus on making a couple excellent songs instead of many lame ones.
How much useful work you're doing in a cycle is also very important. That's why a P4 3GHz has a smaller SPECint score than an Itanium running at 1.4GHz...
Furthermore, 0.9 is in production, but 0.6 is in the making.
While I am certainly not a physicist, the limitting factor for lithography is the wavelength - your precision is directly proportional to the wavelength you're using. This is why you can't just use more powerful/precise lenses - the wavelength is still the same when light is back in the air.
An approach to reducing the wavelength is to simply go to higher frequency, but that poses some tough challenges (x-rays don't behave like visible light). What these researchers have done is to change the environment such that the wavelength is smaller (light is 25% slower in water, and because frequency doesn't change, wavelength gets shorter). Anyway, 25% is hardly "an order of magnitude".
In ancient times there used to be a similar fine (read: death penalty) for mentioning the names of psychopaths who destroyed important pieces of art (who were doing that so that their names remained in history).
If you used Intel's C Compiler then yes, it would be worth it (for instance icc does automatic loop vectorization, and different processors have different vector support) - with gcc however the speedups you'd get are minimal (if not inexistent...).
icc, btw, is free for non-commercial use on Linux.
Let's face it - we are killing our beautiful planet. Global warming is happening, beyond any reasonable doubt (unless, of course, you're a "funded" scientist). We're not doing anything to prevent this from happening (the USA, the biggest polutor of the world, won't even adhere to the Kyoto treaty), yet we consider teraforming another planet.
WTF ? Is this the richest nation of the world ?
So it's safe to put 5. Profit :)
I'll start by saying that STL was designed for references, and as a consequence it feels a little bit more natural to write code for it with references. However, the examples in your reply can be done with pointers easily (including the pair). Nothing prevents you from redefining the comparison operator for pointers (with a friend), or better yet, give the collection a custom-made Comparator.
Furthermore, by using pointers you're shielded from a very common mistake that, in the best case scenario, will lead unnecessary copies on the stack - it's quite easy to forget one & in your code and ... copy constructor. With pointers it's not the problem as the compiler will immediately barf (one way or the other).
I might be missing something - let me know if that's the case.
Such lawyers destroy, people employed by Linux companies create, and generate real economical value.
So if you don't mind, I'd greatly appreciate an example of references making your life easier with templates.
Tia,
Thanks,
Look here. Scroll down to the implementation of factorial with templates.
Top reasons I hate it:
Operator overloading - the most abused feature, as it makes coders feel "in control". It's very rarely useful for non-library stuff (container/matrix/numeric code that's already coded), but it manages to screw up projects very easily through abuse.
References. They're simply idiotic. You can't really do useful stuff with them, as they can't be NULL, . Java references are fine, C++ references - a pointless feature meant to save you a "*" or "->", that doesn't really offer any advantage over pointers, but manages to make code unreadable if you use pointers, statics and references at the same time.
Memory management. Either you are a high-level language and you do GC, or you're low level (like C) and you fully control it. C++ manages to get the worst of both worlds here, as object orientation w/o GC is a big mess. (leaks because "ownership contracts" are not respected are very common)
Templates. I do think generic types are a good idea, but what's the f* point of making the template sub-language Turing complete?? (Yes, you can write partial recursive functions to be evaluated at compile time ...). Furthermore, if you allow member functions to be templated individually of the class, things can get really tricky.
Multiple inheritance. Everything's ok, until you get a piece of code that works when you inherit A then B, but fails if you do it the other way around. Happened to me ...
My point - C++ for AP ? Worst idea ever.
From a power standpoint it is generally more advantageous to do more computation per clock at a lower frequency than less computation at higher frequency. Of course, many other aspects of the design matter (like cache layout, etc)
Anyway, at the current level (I'm talking 1.5GHz to 2.5GHz Intel processors or perf-equivalent AMDs), performance is not an issue anymore for most home & office uses (with the exception of some highend games and realtime mpeg4 video encoding).
At least the chipmakers are happy with M$. As the software gets slower and slower, you need better procs to compensate.
Both Arafat and Sharon took their last name from geographical locations that have historical connotations for their respective peoples.
But I agree, it'd be quite difficult to climb Arafat ...
With digicams, megapixels only matter (these days) for large prints, especially since most monitors these days are used at 1024x768, which is ... 768 kPixels :).
How about using SNR ? I know it's difficult to compute, but reviewers could use VHQ analog film, film-scan it and compare the output to digital output.
That game provided me more dramatic entertainment than two thirds of the movies I've seen. It convinced me beyond any doubt that games are a form of art.
Sure, many people argue that communism wasn't "true" communism as Marx defined it. But I'd similarly argue that it's impossible to implement what Marx proposed with homo sapiens.
Guess Sun is following their way.
BTW, their processors have sucked for quite a while now, they were getting server performance from "the power of many" (i.e. by putting lots of processors in SMP or SMP/NUMA configurations). AMD's Opteron beats the crap out of a Sparc IV (with server benchmarks), it's just that there aren't solutions for more than 8 chips on a board for AMD (AFAIK)
If this is not price fixing, then I don't know what is... FTC, where are you ?
DAMN! I just gave away my password.
Eventually, on-line music distribution will increase quality, as artists will focus on making a couple excellent songs instead of many lame ones.
How much useful work you're doing in a cycle is also very important. That's why a P4 3GHz has a smaller SPECint score than an Itanium running at 1.4GHz ...
Furthermore, 0.9 is in production, but 0.6 is in the making.
An approach to reducing the wavelength is to simply go to higher frequency, but that poses some tough challenges (x-rays don't behave like visible light). What these researchers have done is to change the environment such that the wavelength is smaller (light is 25% slower in water, and because frequency doesn't change, wavelength gets shorter). Anyway, 25% is hardly "an order of magnitude".
In ancient times there used to be a similar fine (read: death penalty) for mentioning the names of psychopaths who destroyed important pieces of art (who were doing that so that their names remained in history).
icc, btw, is free for non-commercial use on Linux.
Are we really "viruses", as agent Smith puts it ?
Yes, real performance is more important than MHz, but more MHz of the same model usually means more performance.
I mean, c'mon, a real model would be 3d.