Which C++ standard? It really matters. They really are completely different languages.
C++98 was only a few steps past "C with Classes". Compare some C++98 code (which at this point looks like somewhat portable object-oriented assembly in terms of abstraction level) to some modern idiomatic C++14 code. Idiomatic C++14 is often closer to a functional language with compile-time computation than anything a C programmer would recognize. No raw pointers anywhere, first-class function objects, implicit dependency ordering on multithreaded computations with continuations, there's a lot to love there. (There's a lot of legacy baggage too, but the core language is actually becoming quite beautiful.)
Having just been through this with a friend of mine, who has decades of OO experience in desktop programming, beware of prerequisites that you don't realize they need:
Sockets, Ports, Packets. Until you get across the idea that all internet applications communicate through bytestreams, and standard protocols, not much will make sense. Most programmers either haven't used RPC at all, or have used something like COM to do it, not TCP/IP.
Multithreading. The idea is still alien to a lot of folks, even people well-versed in Java. They just know that they have to be careful when they call Swing, but not why. Writing web apps, you must have at least an inkling of what thread safety is, and when to synchronize. A brief comment about deadlocks wouldn't be amiss.
Permissions. Some people have mentioned security - that only covers the basic part. Teach your students to always consider "What is this {class|person|request|application} allowed to do?" There are lots of things that you can do in a desktop application, including Java, that won't fly under tomcat running in Security Mode. "I just asked for the user's home directory, how come my app won't run anymore?"
If you get any one of these wrong, your web app is doomed to failure. These are tough concepts for some, but they aren't optional.
... and never will be. UML assumes that everything can be reduced to boxes. There are things I can say in code, that I would like to have another notation for. If UML is truly "unified," show me the UML (sequence diagrams, in this case) for the following code (explained here):
Want an example in a more contemporary language? Then just draw a UML diagram of, say, Spirit , for instance. The control flow here simply cannot be reduced to boxes. UML can't deal with RAII in C++, or finalize-time operations in Java. UML is fundamentally a decent whiteboard tool for some of the less complicated and less expressive languages. That's all it is. (Except for use cases, which have somewhat more broad applicability.)
You want to change resolutions or monitor profile? Reboot.
No, restart X. Or run a second X server. Or hit Control-Alt-Numpad+ to go to the next resolution setting. Or use an X server that implements the RandR extension. (I think most drivers do in Xfree86 4.3).
You want to change font DPI? Reboot.
No, restart X. Or run a second X server. I admit that I don't know of an extension that can change the font DPI on the fly. You may be able to do some magic by restarting the font server to get different fonts in all new applications, but I haven't tried it.
Your system has scheduled fsck to run, either out of routine or out of improper shutdown? You need to reboot after it's done.
One word: ext3.
Or another word: XFS.
A third word (although some people consider it an obscenity, myself included): ReiserFS. There's even the IBM option.I've been running ext3 on my laptop over three years and many unclean shutdowns, and I never have to wait for an fsck, or reboot afterwards.
About the only thing that requires a reboot these days is a kernel or hardware upgrade. You go ahead and keep on rebooting the system, if that's all you know how to do. Just don't confuse your lack of troubleshooting skills with a deficiency on Linux's part.
If you're not prepared to assume it's a compiler problem, then why do say your code "gets miscompiled"? That sure reads like an accusation, which you acknowledge as being unfounded in the next sentence.
OK, let's try this again. I'll type more slowly, so you can understand.
The code is fairly complicated. It passes unit tests under 3.3 regardless of options. Under 3.4 without optimization it works fine, but when I use -O2 it behaves differently. Either my code is broken in a subtle way that only manifests under 3.4 with optimization, or the 3.4 optimizer is doing something naughty. I don't know which yet. Either way, I'm warning people that the 3.4 optimizer may treat code differently than 3.3 did. That's not an accusation.
In the process of trying out different compile options to see if I could get a better idea of what was going on, I managed to get the compiler to bomb out completely and fail to generate any executable at all, with errors that appeared to be the optimizer finding itself unable to find enough registers. IMHO, that justifies some suspicion about the compiler's code generation.
I've been developing in C++ with gcc 3.3 for some time, and just moved to 3.4 for some testing. Thank god for unit tests. There's some bitop-heavy code that gets miscompiled with full optimization (-O2). In the process of trying to debug these (I'm not prepared to assume that they're the compiler's fault, it could certainly be my code invoking implementation-defined behavior,) I managed to get the compiler to choke with the -fschedule-insns flag with 'no free register' errors.
In short, I don't have much confidence in the optimizer in 3.4. I'm trying to condense the problem to a testcase right now to submit a bug report.
It used to be that when you patented something, you had to supply enough information for anyone to produce an instance of the patented invention. From the US PTO:
The specification must be in such full, clear, concise, and exact terms as to enable any person skilled in the art or science to which the invention pertains to make and use the same.
Why don't they enforce this? I know that many folks, myself included, think most computer patents are utterly bogus. I think a proper enforcement of this rule would go a long way toward fixing the problem. If it doesn't compile, you shouldn't be able to patent it. The text of this patent reads more like a philosophy book than a technical invention.
This whole thread seems based on the premise that you actually could, in some way, relicense Linux under the BSD license. This isn't as easy as you might think.
Relicensing checklist:
Go to Linus, and get him to release the portions of Linux that he owns under the new license.
Armed with his blessing, go to each person who's ever contributed code, and get them to sign on. Last time I looked, this was at least a few tens of thousands of coders. Some are deceased, so you will have to get permission from their heirs.
Ask the FSF to release glibc under the new license. Wear body armor.
Go through every userspace program you want. If it is GPL'd, either get the author to relicense, write a replacement, or do without. Good luck trying to even find all the authors, let alone get them on board.
It's widely considered that even Linus Himself could not push through a license change. No need to worry about a corporation doing it.
If you want something under the BSD license, you might want to use BSD.
I take care of Sun kit at work, and I can't possibly imagine why anybody is buying these. The place where sun sets themselves apart is in their large machines - dozens of CPUs, piles and piles of SCSI channels, etc. If you're buying high-end sun stuff, you should see if you can do better by clustering cheaper boxes, but sometimes you can't, and the big huge behemoths are a reasonable choice.
If you're buying SunBlades, though, you need to visit your psychiatrist and have him help you with your white-box phobia. $5k will get you an Opteron box that will run rings around this thing all day long.
I use linux instead of *BSD for what I'll admit are pretty much subjective reasons - I spent a lot of time learning the various quirks, and FreeBSD just never fit right in my brain.
However, I think we're losing sight of the real fundamental dichotomy here, which, for lack of a better phrase, I'll call the 'Vendor/Community' spectrum. As it stands, Microsoft has power because they control the protocols that their users can access. Through 'embrace&extend', they try to ensure that you simply cannot interoperate with any other operating systems.
Apple would act this way if they could, I'm sure, but since they do not have the market share that MS does, they can't afford to have OS X be an island of its own. It's in their best interests to be a team player. For now.
These are the Large Evil Vendor and Small Brown-Nosing Vendor models, respectively.
Linux, *BSD, etc, all the (to whatever extent) open-source OSes are aware that they are part of a community. As such, it is the users, not business interests, that drive development. While there is value to a Vendor in lock-in, there is never value to a user in adding gratuitous incompatibilities. If Windows boxes can't talk nicely to Unix boxes, Bill Gates wins. If Linux boxes can't talk to OpenBSD boxes, nobody wins, and Linus and Theo will both want to figure out why, and fix it.
Yes, they do. They are solarpowered; in fact, the mission lifetime is determined by how long it will take for the solar panels to become degraded by dust cover.
I attended a lecture about sleep & human performance recently, and this question came up. The best strategy would be to keep the workers in an environment with a light pattern synched to mars time. Unfortunately, this would be very expensive. Even more unfortunately, since Spirit and Opportunity are landing at very different longitudes, they would need two.
That's not going to happen, so they're just using blackout shades, and telling the engineers not to spend much time in the Big Blue Room.
It would be more accurate to say that the Moon is not considered a planet because of one little detail. Doesn't orbit the Sun, but rather the Earth. Something orbiting the Sun is either a planet, comet, or asteroid. Something orbiting a planet is a moon.
I agree, though, the Pluto/Charon pair (Charon, pluto's moon, is probably 12.5% of the size of Pluto (that number has an accuracy of +/-35%, one of the things this mission wants to clarify) - relatively, the largest moon in the Solar system) should probably be considered a pair of minor planets/captured asteroids or Oort objects. However, that is unlikely to happen.
Which C++ standard? It really matters. They really are completely different languages.
C++98 was only a few steps past "C with Classes". Compare some C++98 code (which at this point looks like somewhat portable object-oriented assembly in terms of abstraction level) to some modern idiomatic C++14 code. Idiomatic C++14 is often closer to a functional language with compile-time computation than anything a C programmer would recognize. No raw pointers anywhere, first-class function objects, implicit dependency ordering on multithreaded computations with continuations, there's a lot to love there. (There's a lot of legacy baggage too, but the core language is actually becoming quite beautiful.)
Having just been through this with a friend of mine, who has decades of OO experience in desktop programming, beware of prerequisites that you don't realize they need:
If you get any one of these wrong, your web app is doomed to failure. These are tough concepts for some, but they aren't optional.
... and never will be. UML assumes that everything can be reduced to boxes. There are things I can say in code, that I would like to have another notation for. If UML is truly "unified," show me the UML (sequence diagrams, in this case) for the following code (explained here):
Better yet, show me the sequence diagram for this function's caller. Or, since Lisp is supposedly dead, how about this:
Want an example in a more contemporary language? Then just draw a UML diagram of, say, Spirit , for instance. The control flow here simply cannot be reduced to boxes. UML can't deal with RAII in C++, or finalize-time operations in Java. UML is fundamentally a decent whiteboard tool for some of the less complicated and less expressive languages. That's all it is. (Except for use cases, which have somewhat more broad applicability.)
You want to change resolutions or monitor profile? Reboot.
No, restart X. Or run a second X server. Or hit Control-Alt-Numpad+ to go to the next resolution setting. Or use an X server that implements the RandR extension. (I think most drivers do in Xfree86 4.3).
You want to change font DPI? Reboot.
No, restart X. Or run a second X server. I admit that I don't know of an extension that can change the font DPI on the fly. You may be able to do some magic by restarting the font server to get different fonts in all new applications, but I haven't tried it.
Your system has scheduled fsck to run, either out of routine or out of improper shutdown? You need to reboot after it's done.
One word: ext3. Or another word: XFS. A third word (although some people consider it an obscenity, myself included): ReiserFS. There's even the IBM option.I've been running ext3 on my laptop over three years and many unclean shutdowns, and I never have to wait for an fsck, or reboot afterwards.
About the only thing that requires a reboot these days is a kernel or hardware upgrade. You go ahead and keep on rebooting the system, if that's all you know how to do. Just don't confuse your lack of troubleshooting skills with a deficiency on Linux's part.
If you're not prepared to assume it's a compiler problem, then why do say your code "gets miscompiled"? That sure reads like an accusation, which you acknowledge as being unfounded in the next sentence.
OK, let's try this again. I'll type more slowly, so you can understand.
The code is fairly complicated. It passes unit tests under 3.3 regardless of options. Under 3.4 without optimization it works fine, but when I use -O2 it behaves differently. Either my code is broken in a subtle way that only manifests under 3.4 with optimization, or the 3.4 optimizer is doing something naughty. I don't know which yet. Either way, I'm warning people that the 3.4 optimizer may treat code differently than 3.3 did. That's not an accusation.
In the process of trying out different compile options to see if I could get a better idea of what was going on, I managed to get the compiler to bomb out completely and fail to generate any executable at all, with errors that appeared to be the optimizer finding itself unable to find enough registers. IMHO, that justifies some suspicion about the compiler's code generation.
I've been developing in C++ with gcc 3.3 for some time, and just moved to 3.4 for some testing. Thank god for unit tests. There's some bitop-heavy code that gets miscompiled with full optimization (-O2). In the process of trying to debug these (I'm not prepared to assume that they're the compiler's fault, it could certainly be my code invoking implementation-defined behavior,) I managed to get the compiler to choke with the -fschedule-insns flag with 'no free register' errors.
In short, I don't have much confidence in the optimizer in 3.4. I'm trying to condense the problem to a testcase right now to submit a bug report.
It used to be that when you patented something, you had to supply enough information for anyone to produce an instance of the patented invention. From the US PTO:
Why don't they enforce this? I know that many folks, myself included, think most computer patents are utterly bogus. I think a proper enforcement of this rule would go a long way toward fixing the problem. If it doesn't compile, you shouldn't be able to patent it. The text of this patent reads more like a philosophy book than a technical invention.
This whole thread seems based on the premise that you actually could, in some way, relicense Linux under the BSD license. This isn't as easy as you might think.
Relicensing checklist:
It's widely considered that even Linus Himself could not push through a license change. No need to worry about a corporation doing it.
If you want something under the BSD license, you might want to use BSD.
I take care of Sun kit at work, and I can't possibly imagine why anybody is buying these. The place where sun sets themselves apart is in their large machines - dozens of CPUs, piles and piles of SCSI channels, etc. If you're buying high-end sun stuff, you should see if you can do better by clustering cheaper boxes, but sometimes you can't, and the big huge behemoths are a reasonable choice.
If you're buying SunBlades, though, you need to visit your psychiatrist and have him help you with your white-box phobia. $5k will get you an Opteron box that will run rings around this thing all day long.
I use linux instead of *BSD for what I'll admit are pretty much subjective reasons - I spent a lot of time learning the various quirks, and FreeBSD just never fit right in my brain.
However, I think we're losing sight of the real fundamental dichotomy here, which, for lack of a better phrase, I'll call the 'Vendor/Community' spectrum. As it stands, Microsoft has power because they control the protocols that their users can access. Through 'embrace&extend', they try to ensure that you simply cannot interoperate with any other operating systems.
Apple would act this way if they could, I'm sure, but since they do not have the market share that MS does, they can't afford to have OS X be an island of its own. It's in their best interests to be a team player. For now.
These are the Large Evil Vendor and Small Brown-Nosing Vendor models, respectively.
Linux, *BSD, etc, all the (to whatever extent) open-source OSes are aware that they are part of a community. As such, it is the users, not business interests, that drive development. While there is value to a Vendor in lock-in, there is never value to a user in adding gratuitous incompatibilities. If Windows boxes can't talk nicely to Unix boxes, Bill Gates wins. If Linux boxes can't talk to OpenBSD boxes, nobody wins, and Linus and Theo will both want to figure out why, and fix it.
Yes, they do. They are solar powered; in fact, the mission lifetime is determined by how long it will take for the solar panels to become degraded by dust cover.
I attended a lecture about sleep & human performance recently, and this question came up. The best strategy would be to keep the workers in an environment with a light pattern synched to mars time. Unfortunately, this would be very expensive. Even more unfortunately, since Spirit and Opportunity are landing at very different longitudes, they would need two.
That's not going to happen, so they're just using blackout shades, and telling the engineers not to spend much time in the Big Blue Room.
It would be more accurate to say that the Moon is not considered a planet because of one little detail. Doesn't orbit the Sun, but rather the Earth. Something orbiting the Sun is either a planet, comet, or asteroid. Something orbiting a planet is a moon.
I agree, though, the Pluto/Charon pair (Charon, pluto's moon, is probably 12.5% of the size of Pluto (that number has an accuracy of +/-35%, one of the things this mission wants to clarify) - relatively, the largest moon in the Solar system) should probably be considered a pair of minor planets/captured asteroids or Oort objects. However, that is unlikely to happen.