Are you certain about that? There are plenty of multi-million dollar companies that do not net a profit for many years at a time. Amazon was not profitable for the first four or so years, and for all I know still is not.
There is definitely a criteria however. This keeps people from creating companies for their hobbies and writing them off, but I thought the time frame was around seven years, and the criteria was related to gross income.
I think they're reading about the settlement of the western frontier of the United States of America. A mobile platform is an analog for the covered wagon, a caravan of which is effectively a trackless train. I also mention this because an essay contrasting NASA with western frontiersman was circulating for awhile. It was a critical piece, but it may have sparked some ideas, too.
It did not cost 2% of the GDP to build it; the expenses were largely in development. That information is now known, and the majority of it is available at your university library.
The pilot said that he wasn't afraid on the ascent, but coming back was a bit scary. The fact of the matter is that people on the ground, myself included, were plenty scared for him -- albeit to a lesser a degree and without risk of death. Humor is how most people dispel that feeling, because laughing about it is much better than stressing out. "Bad attitude" is a long-standing industry joke.
Melvill stating that he was uneasy about the descent humanizes this endeavour, and more importantly, makes it understandable and accessible to more people. Moreover, this will greatly publicizing Rutan's group and the X Prize. It's only a death-defying feat if there is actual risk, and in this case, there's more than enough to go around.
So hats off to Scaled Composites! And may their subsequent flights be safe and successful.
You need to convince AST, the department of the FAA that is tasked with granting your launch license, that you are safe enough for the general civilian population. They do not care if you kill yourself or even members of your own team, just so long as the public at large is safe from your launch vehicle, its exhaust, re-entering expendable components, toxic propellent, etc. There's the additional burden of not landing on an endangered mouse or historical monument.
As you might guess, launching from a scorching empty desert with non-toxic propellents and nothing that separates and falls back to earth is going to be easier to license.
As an aside, most of the convincing AST needs is hand-waving and postering, but a good bit of it is also mathematical. "If the craft does not explode and creates an impact zone of this size with a maximum flight radius of this size, there are is 1 in 5 million chance of hitting Bob who has a trailer sitting out in the middle of desert. Since that's less likely than the established 30 x 10 ^ -6 expected causalties, we should be able to fly." Response: "OK, you're on; try not to hit Bob."
It has been an incredible hassle to get anything, and I mean anything into orbital or suborbital trajectories as a citizen of the United States of America, from any point on the surface of the planet, due to governmental regulations.
Suborbital flights are not only the first step to orbital, but also the first step into the political fray that has been, until recently, entirely dominated by NASA and friends.
Before you go lobbing projectiles over Europe on your way to orbit, you had sure has heck better be able to prove you can lob one over an empty desert and get it back in one piece.
One step at a time folks. Physics has been the least of the troubles.
Also, with regard to XCOR, until they received their launch license, they were unable to secure the investors necessary to begin their work in earnest. This, despite the fact that they have working engines and a proven team.
It should also be mentioned that the java language requires specific overhead to be included that C++ and C do not. Even if compiled down to sleak assembly, Java is still saddled with doing bounds checking.
The rest of the performance improvements are in the compiler optimizations and libraries which are mostly tangential to the language itself. If the compiler is clever enough to take "for (x=0, i=0; i<100; ++i) x+=5;" and substitute this for "x=500;", then great, but it should not be confused with an endorsement of the language itself.
Furthermore, I had no difficulty modifying the C++ code to outperform or at least meet the results of the server-side JVM using G++. In the cases where Java had any lead whatsoever, the code was so trivial that the JVM could virtually precompute the result. I don't see this as being useful because in the real-world, nothing I write is so trivial that this is possible. If it was, I would have done it myself. I believe this largely explains the discrepency between these "tests" and my actual experience.
Your transaction was canceled waiting for the server operator to enter the database password. Please try again when the operator is back from lunch.
It does not really matter if the data is encrypted or not. Whatever agent is accessing the data has the password, and if it is compromised, the data is also compromised. Add to that, the encryption credentials must be stored somewhere, in which case it is vulnerable, or entered manually by an operator, in which case rebooting your webserver just got that much more entertaining.
Actually, sitting next to my Linux boxes at home is a nice dual-G5 running OSX 10.3, so I'm right there with you. However, as soon as Yellow Dog handles G5 better, I'll be dual-booting. Fink is good, but it's not the greatest way to get functionality, and while I enjoy the Mac immensely, there are still things that I find it does not do. All my Windows boxes run cygwin for the same reason.
If you, as a small-time developer, hold a patent on an algorithm, you can be assured that the mega-corporation that "steals" your idea will hold a number of patents on things you do. They can cross-license with you (ie. you get nothing but the opportunity to remain in business), or they can litigate you to death. In no circumstance will you come out ahead.
Patents may have been conceived as a means to protect "the little guy," but nowadays, they're nuclear weapons on a very small battlefield. Your bombshelter is not deep enough.
Actually, we do staged rollouts. Kernel updates always get special attention, but basic package upgrades run without much trouble. Most can generally be rolled back if there is a problem that was missed. I have not had to do that in a long while.
My other comment ("By the way") somehow got attached to the wrong post... look up and over one.
With respect to what you paid for...
* an operating system that is no easier to use than any of the competing operating systems including OSX and any recently released Linux distribution.
* an operating system that has gaping holes in its hardware compatibility for any device older than a few years.
* an operating system that, despite its "unparalleled commercial software support," still cannot provide a consistent software installation and removal method, avoid rebooting the machine for every other install, prevent applications from writing to the system directory, and not require all users to run as administrator to operate properly.
* it does run a lot of programs though. I'll give you that.
With respect to what we paid for...
* flawless operation on the hardware we use, which includes all major brands and standards. We do not get the same level of compatibility with Windows.
* the ability to continuously download feature and security updates to every package installed on our network automatically and remotely in piece-wise fashion without requiring a company-wide regression test. We still do not have that with our remaining Windows computers. One simply does not install a service pack company-wide without a lot of testing. It's never been an issue with Linux.
* the knowledge that if in two years we decide to change vendors based on price, performance, or value, that we have the freedom to do so as there will be no vendor lock-in.
* the ability to run the same operating system throughout the company, on our desktops, on our servers, on any hardware from Intel to PowerPC to big iron.
* the list goes on...
That's about all the time I got... there's a Windows machine on fire at one of our Chicago clients that I have to look into. It's been fun.
Well argued points... Ordinarily, I'd debate you point for point, but I'm actually pretty busy with work.:)
On the whole though, I don't consider any of the Windows operating systems anything more than a hardware abstraction layer and GUI. Since Linux is substantially more modular than that, any value comparison is moot until you get to feature set. Literally, does it provide what we need? If wide hardware compatibility is your need, then fine. I just don't see it on the corporate desktop.
So when all is said and done, what have you paid for?
Also, if you would like to list one single virus that is make the rounds this afternoon infecting Linux computers, I am all ears. Security is a matter of degree. "Fat-free" does not mean no fat; it means less than epsilon. I stand by "virus-free," and assert that epsilon is exceedingly small.
I'll reiterate: What exactly do you get when you buy XP Home? Is this a real value?
And while you have your thinking caps on... how does that compare to XP Professional? What exactly are you paying for?
Device compatibility? At home? Maybe. But, at the office? Office computers are ordered to specification. IT should know whether the operating system runs on a computer before purchasing it. Otherwise, they're not doing their job.
As an aside, we have an assortment of computers at this office, and Linux runs on all of them with no lose of functionality whatsoever. I cannot say the same for XP, 2000, and NT.
I don't contest anything you've said. All I want to know is when you plunked down your money for XP Home, what exactly did you pay for? Clearly, it wasn't any of the above items since they are freely available. So what did you get, really?
Given that, what is the difference between XP Home and XP Professional?
I think it's telling that half the items you list as remedies include downloading third-party software. What exactly does one get when they pay for XP Home?
Also, your comment about Linux being insufficient on the corporate desktop is off-base. This very post originated from a Linux-installed computer on a corporate network. I want for very little on the office desktop.
XP Home comes with an industry standard web server? XP Home can operate as a full-fledged file server? With unlimited client-licensed connections? XP Home provides a secure, virus-free work environment for the corporate desktop? XP Home comes with a fully functional word processor and spreadsheet? XP Home comes with a complete compiler and development environment?
Seems to me that XP Home is a bit overpriced.
All it can do out of the box is play music, watch DVD's, connect to the internet, and download malware while you're trying to get real work done. No, thank you, but I'll pass.
Well, first off, I do not see any contradiction in anything I've stated, so if you think you've identified one, state it explicitly. It's more likely that something needs to be clarified.
Secondly, I've programmed in many dozens of programming languages, and I don't consider any to be more "powerful" than another. They are either optimal for a given problem set or not. If a language is complete, you can write anything in it. Some languages make this easier, but you must accept certain tradeoffs if you use them.
As I said previously, the degree to which a language is "high-level" has nothing to do with its feature set. It is solely the degree of abstraction. For a given problem described below, one can divide the languages into several levels of abstraction. They are:
HIGHEST: arguments have no fixed type, set processing is automatic, including bounds checking and iteration. Instance lifetimes are managed.
FOR EACH I IN SETOFARGUMENTS FOOFUNC(I) for i in setOfArguments do foofunc(i) for I in $(SETOFARGUMENTS); do foofunc $I; done for i in setOfArguments: foofunc(i) while (list($key,$i) = each($setofarguments)) foofunc($i); (foreach foofunc setOfArguments)
All these statements are at a roughly equivalent level of abstraction. They all do exactly the same thing in approximately the same way. They iterate through an entire set of data, in sequential order, without any regard to type-checking. Each language has its own features and failures. The first will choke if there are any lowercase letters. One of the languages will choke if there is a space character in the argument. Another requires an additional key parameter. The last one does not need an explicit iterator. These issues are related to syntax, not code generation.
Also, this is not to say that each of the languages presented above are at the same level; they can be further separated out amongst themselves, but they are all higher levels than the next group and many languages not referenced will fall between.
MIDDLE-HIGH: Type-checking is enforced. Set processing is accomplished through class-specific iteration. Bounds checking is enforced. Instance lifetimes are managed.
VALUES[] setOfArgs = new VALUES[N]; for (int i=0; i<setOfArgs.length; ++i) foofunc(setOfArgs[i]);
Different from the higher-level languages, the value type must be explicitly declared. Iteration is no longer an automatic function of the language. From a syntactic point of view, this code looks similar to C++, but that does not make them equivalent. What makes this higher-level then even C++ is that bounds checking is implicit and management of the setOfArgs array is taken care of directly.
MIDDLE-LOW: Type-checking is enforced. Set processing is accomplished through class-specific iteration. Bounds checking is not enforced. Array management is not provided. Only scoped instance lifetimes are managed (ie. anything not allocated).
std::vector<VALUE> v(N); std::vector::iterator i; for (i=v.begin(); i!=v.end(); ++i) FooFunc(*i);
Vector v(N); VALUE* i; for (i=v.Begin(); i!=v.End(); ++i) FooFunc(*i);
Vector v(N); int i; for (i=v.FirstIndex(); i!=v.LastIndex(); ++i) FooFunc(v.Deref(i));
All of these cases are equivalent, both in terms of code implementation and in terms of features and failures. There is no bounds checking for the iterator, regardless of whether it is implemented with pointers or integer offsets. The vector class must be explicitly declared in its entirety; there is no builtin type. Memory for the vector must be explicitly allocated and destroyed. Due to scoping rules, limited instance management will automatically call the constructor and deconstructor for the vector.
LOWER: Type-checking is enforced. No classes. No bounds checking. No instance management. No initialization. Limited
Nothing prevents you from calling getValue and not using the return result. When I do this I explicitly write it as "(void)getValue();" so my colleagues don't assume that I made a mistake.
Left hand value means that it can be used as the left-hand argument of an assignment. If you return a NULL reference, you are pretty much dooming the caller to fault since they will dereference it without checking. By returning a reference you are guaranteeing that the value is not NULL. The can cheat the system with some pointer casts.
int& getValue() int* getPtrValue()
getValue() = 5;// assigns ref'd value *getPtrValue() = 5;// equivalent
This is an uninteresting example since "setValue" would be more appropriate. A better example would be the following operator override.
class stringtointmap { int& operator[](const char* key); };
stringtointmap f; f["hello"] = 5;
This allows the actual internal value to be exposed for assignment without providing an explicit pointer. I consider this to be cleaner, clearer code. For people that like hash tables and bounds checking, all that is available in C++, you just have to use the right objects.
Here's a simple example. Try to create a map where the first argument is a class. You will find that without overriding the less-than operator for mykey it won't work.
typedef std::map<mykey,myvalue> MAP;
MAP m; m.insert(std::make_pair(mykey(),myvalue()));
This single overload allows the map to use this class as the key for sorting purposes. That's very powerful voodoo. Since copies of the key and value are made, you should also implement copy constructors for both mykey and myvalue which again take references. If you don't, you get whatever the compiler gives you which might not be what you want.
mykey(const mykey& k); myvalue(const myvalue& v);
Without these items, you cannot fully utilize the map template. At most you would be limited to having basic types like integers and pointers for the keys and values. Sometimes that's enough, often times it's not.
A sample is provided. The ECODE tag screws up the indentation, so it's not as clean as it could be.
Actually, I would assert that COBOL is a much higher level language than either C++ or Java. "High level" does not mean complex or feature rich; it means that the level of abstraction from assembly language is greater.
COBOL is about as abstracted from the final assembly code as PHP, Python, or Perl. The only thing more abstract would be languages like SQL.
With Java, there is a closer relationship between the objects that are declared and the assembly that will be necessary to implement them. For C++ that correlation is nearly one-to-one with C except for the minor additions like calling constructors and deconstructors, maintaining the exception stack, etc. These are not complicated things to implement which is why I don't consider C++ especially higher than C.
C++ is necessarily lower than Java since it does not provide string classes, garbage collection, and automatic bounds checking. Also, as far as I'm concerned, namespaces do not add anything to the "level" of the language; it's merely a feature. The code compiles to the same assembly whether you use them or not.
If you never overload operators and do not use templates, then I cannot think of any reason that you would need references. Here is an especially bad use of a references.
int a=1, b=2; int &ref = a; ref = b;
Is ref now referencing b or is a being assigned 2? The compiler has only one interpretation here. With pointers, both possibilities can be made explicit.
References are used to declare parameters that are passed by reference, such as for an operator override. They are also used for return values when it must be clear whether the result will be a temporary object or an existing object. The code (a+b) returns a new object. The code (a+=b) returns a. This matters to the compiler when generating optimal code.
For what it's worth, the extent of how "high" a language is with respect to another is not a matter of language features, IMHO. It's a matter of what the compiler is doing for you that you don't have to, or could not otherwise do as efficiently, for yourself.
Anything you can implement in C++, you can do in C. Polymorphism, exceptions, and virtual functions: all of these are implementable in C -- with some hassle. But here, the C++ compiler just takes care of it. So what is the C++ compiler doing for you?
Classes are simply structures. Classes with virtual functions are simply structures where the first member is a pointer to a v-table. A v-table is structure containing function pointers. In C, you would have to declare and implement each of these items. C++ quietly does that for you. C++ also calls your initializers and finalizers for you, which is nice, but it doesn't check to make sure you actually initialized everything.
Exception handling is mostly the maintenance of a linked-list of structures, some gotos, and some long-jumps. Some compilers go a bit further with this which is why C++ exception handling can be more efficient. C++ can pushing and pop the exception handling stack in optimized assembly whereas the C program has to do it manually.
After that, you are pretty much on your own. Nothing is automatically initialized for you. No builtin string class. No builtin bounds checking. No builtin hash tables. No builtin anything, really.
As for C++ templates, I would consider that a "higher" level than the basic new/delete, try/catch/throw mechanism mentioned above, but it's really a separate part of the language. I know C++ programmers who never touch templates. I love templates, but I consider the feature to be more of a sophisticated macro preprocessor than a different mode of the compiler. In the end, no new assembly language optimizations are performed than are otherwise available in C++.
Are you certain about that? There are plenty of multi-million dollar companies that do not net a profit for many years at a time. Amazon was not profitable for the first four or so years, and for all I know still is not.
There is definitely a criteria however. This keeps people from creating companies for their hobbies and writing them off, but I thought the time frame was around seven years, and the criteria was related to gross income.
-Hope
I think they're reading about the settlement of the western frontier of the United States of America. A mobile platform is an analog for the covered wagon, a caravan of which is effectively a trackless train. I also mention this because an essay contrasting NASA with western frontiersman was circulating for awhile. It was a critical piece, but it may have sparked some ideas, too.
-Hope
It did not cost 2% of the GDP to build it; the expenses were largely in development. That information is now known, and the majority of it is available at your university library.
-Hope
The pilot said that he wasn't afraid on the ascent, but coming back was a bit scary. The fact of the matter is that people on the ground, myself included, were plenty scared for him -- albeit to a lesser a degree and without risk of death. Humor is how most people dispel that feeling, because laughing about it is much better than stressing out. "Bad attitude" is a long-standing industry joke.
Melvill stating that he was uneasy about the descent humanizes this endeavour, and more importantly, makes it understandable and accessible to more people. Moreover, this will greatly publicizing Rutan's group and the X Prize. It's only a death-defying feat if there is actual risk, and in this case, there's more than enough to go around.
So hats off to Scaled Composites! And may their subsequent flights be safe and successful.
-Hope
You need to convince AST, the department of the FAA that is tasked with granting your launch license, that you are safe enough for the general civilian population. They do not care if you kill yourself or even members of your own team, just so long as the public at large is safe from your launch vehicle, its exhaust, re-entering expendable components, toxic propellent, etc. There's the additional burden of not landing on an endangered mouse or historical monument.
As you might guess, launching from a scorching empty desert with non-toxic propellents and nothing that separates and falls back to earth is going to be easier to license.
As an aside, most of the convincing AST needs is hand-waving and postering, but a good bit of it is also mathematical. "If the craft does not explode and creates an impact zone of this size with a maximum flight radius of this size, there are is 1 in 5 million chance of hitting Bob who has a trailer sitting out in the middle of desert. Since that's less likely than the established 30 x 10 ^ -6 expected causalties, we should be able to fly." Response: "OK, you're on; try not to hit Bob."
-Hope
It has been an incredible hassle to get anything, and I mean anything into orbital or suborbital trajectories as a citizen of the United States of America, from any point on the surface of the planet, due to governmental regulations.
Suborbital flights are not only the first step to orbital, but also the first step into the political fray that has been, until recently, entirely dominated by NASA and friends.
Before you go lobbing projectiles over Europe on your way to orbit, you had sure has heck better be able to prove you can lob one over an empty desert and get it back in one piece.
One step at a time folks. Physics has been the least of the troubles.
Also, with regard to XCOR, until they received their launch license, they were unable to secure the investors necessary to begin their work in earnest. This, despite the fact that they have working engines and a proven team.
-Hope
It should also be mentioned that the java language requires specific overhead to be included that C++ and C do not. Even if compiled down to sleak assembly, Java is still saddled with doing bounds checking.
The rest of the performance improvements are in the compiler optimizations and libraries which are mostly tangential to the language itself. If the compiler is clever enough to take "for (x=0, i=0; i<100; ++i) x+=5;" and substitute this for "x=500;", then great, but it should not be confused with an endorsement of the language itself.
Furthermore, I had no difficulty modifying the C++ code to outperform or at least meet the results of the server-side JVM using G++. In the cases where Java had any lead whatsoever, the code was so trivial that the JVM could virtually precompute the result. I don't see this as being useful because in the real-world, nothing I write is so trivial that this is possible. If it was, I would have done it myself. I believe this largely explains the discrepency between these "tests" and my actual experience.
-Hope
Error 408 - Request Timeout
Your transaction was canceled waiting for the server operator to enter the database password. Please try again when the operator is back from lunch.
It does not really matter if the data is encrypted or not. Whatever agent is accessing the data has the password, and if it is compromised, the data is also compromised. Add to that, the encryption credentials must be stored somewhere, in which case it is vulnerable, or entered manually by an operator, in which case rebooting your webserver just got that much more entertaining.
-Hope
Actually, sitting next to my Linux boxes at home is a nice dual-G5 running OSX 10.3, so I'm right there with you. However, as soon as Yellow Dog handles G5 better, I'll be dual-booting. Fink is good, but it's not the greatest way to get functionality, and while I enjoy the Mac immensely, there are still things that I find it does not do. All my Windows boxes run cygwin for the same reason.
-Hope
If you, as a small-time developer, hold a patent on an algorithm, you can be assured that the mega-corporation that "steals" your idea will hold a number of patents on things you do. They can cross-license with you (ie. you get nothing but the opportunity to remain in business), or they can litigate you to death. In no circumstance will you come out ahead.
Patents may have been conceived as a means to protect "the little guy," but nowadays, they're nuclear weapons on a very small battlefield. Your bombshelter is not deep enough.
-Hope
Actually, we do staged rollouts. Kernel updates always get special attention, but basic package upgrades run without much trouble. Most can generally be rolled back if there is a problem that was missed. I have not had to do that in a long while.
-Hope
My other comment ("By the way") somehow got attached to the wrong post... look up and over one.
With respect to what you paid for...
* an operating system that is no easier to use than any of the competing operating systems including OSX and any recently released Linux distribution.
* an operating system that has gaping holes in its hardware compatibility for any device older than a few years.
* an operating system that, despite its "unparalleled commercial software support," still cannot provide a consistent software installation and removal method, avoid rebooting the machine for every other install, prevent applications from writing to the system directory, and not require all users to run as administrator to operate properly.
* it does run a lot of programs though. I'll give you that.
With respect to what we paid for...
* flawless operation on the hardware we use, which includes all major brands and standards. We do not get the same level of compatibility with Windows.
* the ability to continuously download feature and security updates to every package installed on our network automatically and remotely in piece-wise fashion without requiring a company-wide regression test. We still do not have that with our remaining Windows computers. One simply does not install a service pack company-wide without a lot of testing. It's never been an issue with Linux.
* the knowledge that if in two years we decide to change vendors based on price, performance, or value, that we have the freedom to do so as there will be no vendor lock-in.
* the ability to run the same operating system throughout the company, on our desktops, on our servers, on any hardware from Intel to PowerPC to big iron.
* the list goes on...
That's about all the time I got... there's a Windows machine on fire at one of our Chicago clients that I have to look into. It's been fun.
-Hope
Well argued points... Ordinarily, I'd debate you point for point, but I'm actually pretty busy with work. :)
On the whole though, I don't consider any of the Windows operating systems anything more than a hardware abstraction layer and GUI. Since Linux is substantially more modular than that, any value comparison is moot until you get to feature set. Literally, does it provide what we need? If wide hardware compatibility is your need, then fine. I just don't see it on the corporate desktop.
-Hope
So when all is said and done, what have you paid for?
Also, if you would like to list one single virus that is make the rounds this afternoon infecting Linux computers, I am all ears. Security is a matter of degree. "Fat-free" does not mean no fat; it means less than epsilon. I stand by "virus-free," and assert that epsilon is exceedingly small.
-Hope
My first. I must have touched a nerve.
I'll reiterate: What exactly do you get when you buy XP Home? Is this a real value?
And while you have your thinking caps on... how does that compare to XP Professional? What exactly are you paying for?
Device compatibility? At home? Maybe. But, at the office? Office computers are ordered to specification. IT should know whether the operating system runs on a computer before purchasing it. Otherwise, they're not doing their job.
As an aside, we have an assortment of computers at this office, and Linux runs on all of them with no lose of functionality whatsoever. I cannot say the same for XP, 2000, and NT.
-Hope
I don't contest anything you've said. All I want to know is when you plunked down your money for XP Home, what exactly did you pay for? Clearly, it wasn't any of the above items since they are freely available. So what did you get, really?
Given that, what is the difference between XP Home and XP Professional?
-Hope
I think it's telling that half the items you list as remedies include downloading third-party software. What exactly does one get when they pay for XP Home?
Also, your comment about Linux being insufficient on the corporate desktop is off-base. This very post originated from a Linux-installed computer on a corporate network. I want for very little on the office desktop.
-Hope
XP Home comes with an industry standard web server? XP Home can operate as a full-fledged file server? With unlimited client-licensed connections? XP Home provides a secure, virus-free work environment for the corporate desktop? XP Home comes with a fully functional word processor and spreadsheet? XP Home comes with a complete compiler and development environment?
Seems to me that XP Home is a bit overpriced.
All it can do out of the box is play music, watch DVD's, connect to the internet, and download malware while you're trying to get real work done. No, thank you, but I'll pass.
-Hope
Secondly, I've programmed in many dozens of programming languages, and I don't consider any to be more "powerful" than another. They are either optimal for a given problem set or not. If a language is complete, you can write anything in it. Some languages make this easier, but you must accept certain tradeoffs if you use them.
As I said previously, the degree to which a language is "high-level" has nothing to do with its feature set. It is solely the degree of abstraction. For a given problem described below, one can divide the languages into several levels of abstraction. They are:
HIGHEST: arguments have no fixed type, set processing is automatic, including bounds checking and iteration. Instance lifetimes are managed.
All these statements are at a roughly equivalent level of abstraction. They all do exactly the same thing in approximately the same way. They iterate through an entire set of data, in sequential order, without any regard to type-checking. Each language has its own features and failures. The first will choke if there are any lowercase letters. One of the languages will choke if there is a space character in the argument. Another requires an additional key parameter. The last one does not need an explicit iterator. These issues are related to syntax, not code generation.
Also, this is not to say that each of the languages presented above are at the same level; they can be further separated out amongst themselves, but they are all higher levels than the next group and many languages not referenced will fall between.
MIDDLE-HIGH: Type-checking is enforced. Set processing is accomplished through class-specific iteration. Bounds checking is enforced. Instance lifetimes are managed.
Different from the higher-level languages, the value type must be explicitly declared. Iteration is no longer an automatic function of the language. From a syntactic point of view, this code looks similar to C++, but that does not make them equivalent. What makes this higher-level then even C++ is that bounds checking is implicit and management of the setOfArgs array is taken care of directly.
MIDDLE-LOW: Type-checking is enforced. Set processing is accomplished through class-specific iteration. Bounds checking is not enforced. Array management is not provided. Only scoped instance lifetimes are managed (ie. anything not allocated).
All of these cases are equivalent, both in terms of code implementation and in terms of features and failures. There is no bounds checking for the iterator, regardless of whether it is implemented with pointers or integer offsets. The vector class must be explicitly declared in its entirety; there is no builtin type. Memory for the vector must be explicitly allocated and destroyed. Due to scoping rules, limited instance management will automatically call the constructor and deconstructor for the vector.
LOWER: Type-checking is enforced. No classes. No bounds checking. No instance management. No initialization. Limited
I sent email directly. -Hope
Left hand value means that it can be used as the left-hand argument of an assignment. If you return a NULL reference, you are pretty much dooming the caller to fault since they will dereference it without checking. By returning a reference you are guaranteeing that the value is not NULL. The can cheat the system with some pointer casts.This is an uninteresting example since "setValue" would be more appropriate. A better example would be the following operator override.This allows the actual internal value to be exposed for assignment without providing an explicit pointer. I consider this to be cleaner, clearer code. For people that like hash tables and bounds checking, all that is available in C++, you just have to use the right objects.
-Hope
Somewhere you will need to declare and implement:
This single overload allows the map to use this class as the key for sorting purposes. That's very powerful voodoo. Since copies of the key and value are made, you should also implement copy constructors for both mykey and myvalue which again take references. If you don't, you get whatever the compiler gives you which might not be what you want.Without these items, you cannot fully utilize the map template. At most you would be limited to having basic types like integers and pointers for the keys and values. Sometimes that's enough, often times it's not.
A sample is provided. The ECODE tag screws up the indentation, so it's not as clean as it could be.Results in:-Hope
Actually, I would assert that COBOL is a much higher level language than either C++ or Java. "High level" does not mean complex or feature rich; it means that the level of abstraction from assembly language is greater.
COBOL is about as abstracted from the final assembly code as PHP, Python, or Perl. The only thing more abstract would be languages like SQL.
With Java, there is a closer relationship between the objects that are declared and the assembly that will be necessary to implement them. For C++ that correlation is nearly one-to-one with C except for the minor additions like calling constructors and deconstructors, maintaining the exception stack, etc. These are not complicated things to implement which is why I don't consider C++ especially higher than C.
C++ is necessarily lower than Java since it does not provide string classes, garbage collection, and automatic bounds checking. Also, as far as I'm concerned, namespaces do not add anything to the "level" of the language; it's merely a feature. The code compiles to the same assembly whether you use them or not.
-Hope
References are used to declare parameters that are passed by reference, such as for an operator override. They are also used for return values when it must be clear whether the result will be a temporary object or an existing object. The code (a+b) returns a new object. The code (a+=b) returns a. This matters to the compiler when generating optimal code.
-Hope
For what it's worth, the extent of how "high" a language is with respect to another is not a matter of language features, IMHO. It's a matter of what the compiler is doing for you that you don't have to, or could not otherwise do as efficiently, for yourself.
Anything you can implement in C++, you can do in C. Polymorphism, exceptions, and virtual functions: all of these are implementable in C -- with some hassle. But here, the C++ compiler just takes care of it. So what is the C++ compiler doing for you?
Classes are simply structures. Classes with virtual functions are simply structures where the first member is a pointer to a v-table. A v-table is structure containing function pointers. In C, you would have to declare and implement each of these items. C++ quietly does that for you. C++ also calls your initializers and finalizers for you, which is nice, but it doesn't check to make sure you actually initialized everything.
Exception handling is mostly the maintenance of a linked-list of structures, some gotos, and some long-jumps. Some compilers go a bit further with this which is why C++ exception handling can be more efficient. C++ can pushing and pop the exception handling stack in optimized assembly whereas the C program has to do it manually.
After that, you are pretty much on your own. Nothing is automatically initialized for you. No builtin string class. No builtin bounds checking. No builtin hash tables. No builtin anything, really.
As for C++ templates, I would consider that a "higher" level than the basic new/delete, try/catch/throw mechanism mentioned above, but it's really a separate part of the language. I know C++ programmers who never touch templates. I love templates, but I consider the feature to be more of a sophisticated macro preprocessor than a different mode of the compiler. In the end, no new assembly language optimizations are performed than are otherwise available in C++.
-Hope