"...Should we start by teaching an easier, higher level language (ie Java) to get programming concepts down, then move to lower level "closer to the machine" language for advanced topics, or should we start with the lower level language and then treat additional languages as extras?...Personally I think the first option is the more viable..."
Now you're thinking like I'm thinking. If a small child were to ask about a car, would you explain its general use and major parts or would you immediately cover the finer points of the internal combustion engine? While it may be important to know about the internal workings of a car, these things are best introduced after a good general introduction.
I remember the first programming course I took in high school, and I hated it. There was a period where I fiddled around with my calculator, and I thought that programming would be fun to learn, so I signed up for a course in C. The person teaching the class was a originally a FORTRAN programmer, but had learned C on his own. He was so bogged down in the details of the language that he completely lost most of the class. Here I was wanting to be able to write simple little question-and-answer games, and this guy was covering the finer points of binary representation and overflow, right from the get-go. Needless to say, I bailed after the first semester, taking my barely-passing grade with me.
If we're talking about a good starting point for programming, it's usually the same answer as in other disciplines: start simple. Show some of the easy capabilities, and then peel back a layer, so to speak, to show what goes on under the hood. If you start under the hood, they're not going to appreciate it, because they never saw the big picture in the first place.
Given that may in Atlanta will be converted, will they change the message to:
All y'all gots mail!
Don't be silly. That's redundant. It is proper to say "Y'all gots mail", unless there is confusion as to who the y'all applies. "All y'all" clarifies ambiguity, showing that you meant all of y'all, and not some of y'all. See also "Coke: soda".
it's silly how a stupid comment based on ONE LINE in the/. header gets to be scored 5.
Pedantic comments that skip over the intention of a statement and concentrate only on a strict literal translation of it get an automatic score bonus. It's an enfuriatingly stupid trend.
One of the CS professors at the university I attended was incredibly paranoid about cheaters. He wrote a similar program for scanning different students' submitted source code and flagging those that seemed similar. It's a pretty smart thing to do, if you ask me. Heck, I even know someone who got caught by it. I'm not sure how effective it was in general.
Linus was using the phrase in a to make a rather mild joke. How it is that Linus, a foreigner, has a better command of English idiom than you, well...
Speaking of personal attacks...
You can see it however you want it, but the fact remains that Linus's joke _sounded_ like he was referring to smell, not performance. When you compare someone to a rotting corpse, how else are you supposed to take it? It could be a play on words, but it was a poor attempt at it.
And I would say that a more proper description for that idiom is just being of poor quality in general. As in "You stink at analyzing sentences"
If that worked, we'd have light bulbs that laster for 30 years, cars you bought for a lifetime, and software for life.
To paraphrase Chris Rock:
They ain't _never_ curing aids. That'd be like Chrysler making a car that lasts forever. They can make a space shuttle that can withstand temperatures of thousands of degrees; you mean to tell me that they can't make a car where the bumper don't fall off?
Not a direct quote, but you get the point.
Re:cloning a whole human won't become epidemic
on
Send out the Clones?
·
· Score: 1
What would be the advantage of creating a baby that's an exact genetic copy of someone, and then waiting years for it to be able to walk, talk, and think?
It might be worth the wait if the original had genetically superior intelligence.
I completely agree. I was a little offended when I read that comment. I realize that it was a joke, but it still sounded too much like slavery, which is something that is hard to laugh about. I'm glad to see that someone else felt the same way.
My feelings on the matter: If cloning were allowed, I think it would be important for us to accept them as equals in all respects.
As an even less useful piece of information, I believe C's precursor ("B") got its name from the place it was developed - Bell labs.
A useless piece of information, mainly because it's incorrect. C came from B. Where did B come from? A? It actually came from "BCPL" (Basic Combined Programming Language). So what is the next programming language going to be called? D or P? =)
Perhaps the dillemma means we are forever doomed to use names like C++, C#, etc.
Because when they are cast they get put into temporaries, and the reference now acts like a call by value (the temporary is changed, but NOT copied back - the changes are lost)
Correct me if I'm wrong, but this sounds like a problem with the compiler. Temporaries should be considered const. You should only be able to implicitly cast an unsigned int to a temporary int if the reference in the argument list is a const reference. I tried your program on my compiler, and it barked at me.
Ugh, note to self: grab a coke first thing in the morning. My post didn't make a whole lot of sense, in this context.
My point is that parents are ultimately responsible for their children. No matter what's out there (games, movies, friends who set poor examples, etc), the parents are the ones who need to assume the responsibility for their kids' actions. It is the parents' responsibility to guide their kids and teach them what is right, what is wrong, what is fantasy, and what is reality. Unfortunately, the gaming companies are a much bigger target and can offer more money than parents, so it's better to go after the companies in a court of law. In the end, this is pointing a finger at the wrong people.
While it may be true that exposure changes behavior, I think the most important point here is that parents need to assume responsibility for their children. If you don't agree with violent games, fine, then keep your kids from playing them. If you don't think your kids should watch R-rated flicks, then fine, don't take them to see them. But, for God's sake, don't sue the people who produuce them.
Thanks for clearing that up. I was looking at the problem from a totally different perspective. I was thinking that the desired result was a tree with nodes that had template derived classes, all with different types. But a generic tree that contains only one base type, yea, I could see that. And in that case, I completely agree with you.
The Right Way to implement this is to make an abstract class for the tree node, write the tree manipulation methods to work with the abstract class, and make derived classes that store different types of data, with appropriate constructors that initialize the data fields. Anything that doesn't have to care about the data type can just manipulate the objects as the original abstract class.
This sounds like a perfect place to use the STL and/or C++'s templating mechanism. Trust me, I'm not a huge C++ fan, but the container classes in the STL kick ass (I imagine something like what you describe is already there). Even if the STL don't give you no lovin', templates (and references) make it really easy to write a storage class that works over an arbitrary range of types.
I'm not following. Here's my problem with that solution:
Suppose you have a base tree node class that is a protocol class and then you templatize all the derived classes. If you templatize the derived class, nine times out of ten you're going to want to call functions of the derived class using some of the types that the derived class is using. This is impossible if you have a pointer to the base class, since the base class remains blissfully unaware of its derived classes and the types involved with them. If you don't want to call the functions of the derived classes using their types, that's fine, but I don't see that happen in practice that often. Usually when you templatize a class on a type, you are saying "I am class X, and I deal with type T." To speak its language, and call its functions, you usually need to know what type T is.
Like I said, this is not a problem if you don't have functions in your derived classes that require its caller to know the types being used. If they are all things like "void Execute(void)", then you're good to go. However, if you need to pass a parameter based on the receiver's template type, it seems that a test of the type is in order, which could get messy as more node types are added.
The other option is to also templatize the base class, but then all your base classes (which, of course, would belong to us) that are templatized on different things have different types, and forming a tree out of them would require bypassing the type system of C++.
Overall, yes, templates rock. But, like many features of a language, sometimes it doesn't seem to pay to use them.
references: most of your programmer's time will be spent reading the code rather than the class definitions (and this is as it should be) so anything that makes it more difficult to tell what is happening in the code is bad and to be avoided. References are just such a beast, especially when used in parameter lists. (As a return value they are almost acceptable)
As with all language features, there's a fine line between using and abusing a feature. I see your complaint about references, but the same damage can be done with pointers, and nobody wants to without those (well, not me at least).
I hate having to think to myself (when dealing with pure C) "Is that struct being passed via a pointer for updating or for efficiency? Which structs being passed are updated?" A simple way to solve the problem: whenever a parameter is passed out of a function via an argument, say so in the code with a comment. Please. Pretty please, even. All it takes is a simple "/* out */" or "// out".
It seems that everyone is ready to accuse software of becoming more and more bloated as time goes on, with no apparent gain in features. Even some software developers say this, even though they are some of the same people who call C "assembly-like" and prefer to do their programming in Perl or Java. (Mmm...Perl and Java...)
Really, the payoff in code "bloat" is in the area of development time. It may seem like this has no benefit on the user side, but the so-called bloat that the user complains about is the same stuff that helps the programmer get software to the user in a timely fashion, with fewer mistakes. Granted, this is not always the case, but the trend these days is to put run-time efficiency second in favor of programmer-efficiency. As a programmer, I like this. As a user, I don't like it as much.
Pick a sentence that means something to you, and pick a number or a few strange symbols that you can remember. Now take the first letter of each word in the sentence and string it together. Insert symbols and numbers where you like, and you have a decently sturdy password. Add longer sentences for more peace of mind.
For instance:
"Slashdot rocks my world and CmdrTaco is a god"
goes to srmwaciag (or srmwactiag if you want to include the Taco part). Add a few symbols in there, say "@$%" and you can get %srm@wa$ctia$g. I actually insert these symbols before the nouns, kinda like perl variables (slashdot being a hash, the world being an array, and god and CmdrTaco being a scalar). Kinda obfuscated, but not too hard to remember (for someone who knows the sentence). Change passes by picking different sentences.
I find that sentences can have virtually infinite combinations, and almost as easy to remember as passwords. Plus they're a little harder to guess without _really_ knowing the person who created it. Granted, it's not the best idea out there, but it's easy and fairly solid.
Well, you beat me to it, but here's what I was going to write. I was writing this when you posted you comment.
Recently, God himself has begun a DMCA-based lawsuit against practicers of genetic research.
"I have been disturbed by the lack of respect for my intellectual property. I spent long hours working on an encryption scheme for my 'life' technology, and I wish that these 'hackers' would appreciate that. Instead, they have reverse-engineered my genetic source code, claiming that it was all in the name of 'science'. This is piracy, plain and simple."
God owns several patents concerning this technology, including a method for autonomous reproduction of life forms and a process for imbuing free will into creatures.
"Now, with this new 'DMCA' law, I can finally put an end to the reverse engineering that threatens to destroy my business. It's obvious that the old standby of 'sin and you go to hell' isn't as effective as it used to be. I'm hoping that this will keep people from stealing my work."
"I thought that the last representative I sent to Earth made it perfectly clear that this sort of thing would not be tolerated. My next official will be expecting full compensation for any derivative works from my technology."
"...Should we start by teaching an easier, higher level language (ie Java) to get programming concepts down, then move to lower level "closer to the machine" language for advanced topics, or should we start with the lower level language and then treat additional languages as extras?...Personally I think the first option is the more viable..."
Now you're thinking like I'm thinking. If a small child were to ask about a car, would you explain its general use and major parts or would you immediately cover the finer points of the internal combustion engine? While it may be important to know about the internal workings of a car, these things are best introduced after a good general introduction.
I remember the first programming course I took in high school, and I hated it. There was a period where I fiddled around with my calculator, and I thought that programming would be fun to learn, so I signed up for a course in C. The person teaching the class was a originally a FORTRAN programmer, but had learned C on his own. He was so bogged down in the details of the language that he completely lost most of the class. Here I was wanting to be able to write simple little question-and-answer games, and this guy was covering the finer points of binary representation and overflow, right from the get-go. Needless to say, I bailed after the first semester, taking my barely-passing grade with me.
If we're talking about a good starting point for programming, it's usually the same answer as in other disciplines: start simple. Show some of the easy capabilities, and then peel back a layer, so to speak, to show what goes on under the hood. If you start under the hood, they're not going to appreciate it, because they never saw the big picture in the first place.
I thought this had already been brought up before, but I could only find a mention of this site in a comment.
http://www.rubycookbook.org
Not much there right now, but it should grow with time. Perhaps contributing to the work there would be better than starting a competing project.
Actually this brings new meaning to the bbspot article:
http://www.bbspot.com/News/2000/12/ms_cancer.html (Office 10 will cure cancer).
If anyone on slashdot hasn't read this, they probably should:
In the beginning was the command line:i nning_print.html
http://www-classic.be.com/users/cryptonomicon/beg
It's an interesting look at computers and their users. It goes along with what you say, in general, and elaborates on your statements even more.
Given that may in Atlanta will be converted, will they change the message to:
All y'all gots mail!
Don't be silly. That's redundant. It is proper to say "Y'all gots mail", unless there is confusion as to who the y'all applies. "All y'all" clarifies ambiguity, showing that you meant all of y'all, and not some of y'all. See also "Coke: soda".
it's silly how a stupid comment based on ONE LINE in the /. header gets to be scored 5.
Pedantic comments that skip over the intention of a statement and concentrate only on a strict literal translation of it get an automatic score bonus. It's an enfuriatingly stupid trend.
One of the CS professors at the university I attended was incredibly paranoid about cheaters. He wrote a similar program for scanning different students' submitted source code and flagging those that seemed similar. It's a pretty smart thing to do, if you ask me. Heck, I even know someone who got caught by it. I'm not sure how effective it was in general.
Linus was using the phrase in a to make a rather mild joke. How it is that Linus, a foreigner, has a better command of English idiom than you, well...
Speaking of personal attacks...
You can see it however you want it, but the fact remains that Linus's joke _sounded_ like he was referring to smell, not performance. When you compare someone to a rotting corpse, how else are you supposed to take it? It could be a play on words, but it was a poor attempt at it.
And I would say that a more proper description for that idiom is just being of poor quality in general. As in "You stink at analyzing sentences"
If that worked, we'd have light bulbs that laster for 30 years, cars you bought for a lifetime, and software for life.
To paraphrase Chris Rock:
They ain't _never_ curing aids. That'd be like Chrysler making a car that lasts forever. They can make a space shuttle that can withstand temperatures of thousands of degrees; you mean to tell me that they can't make a car where the bumper don't fall off?
Not a direct quote, but you get the point.
What would be the advantage of creating a baby that's an exact genetic copy of someone, and then waiting years for it to be able to walk, talk, and think?
It might be worth the wait if the original had genetically superior intelligence.
I completely agree. I was a little offended when I read that comment. I realize that it was a joke, but it still sounded too much like slavery, which is something that is hard to laugh about. I'm glad to see that someone else felt the same way.
My feelings on the matter: If cloning were allowed, I think it would be important for us to accept them as equals in all respects.
As an even less useful piece of information, I believe C's precursor ("B") got its name from the place it was developed - Bell labs.
A useless piece of information, mainly because it's incorrect. C came from B. Where did B come from? A? It actually came from "BCPL" (Basic Combined Programming Language). So what is the next programming language going to be called? D or P? =)
Perhaps the dillemma means we are forever doomed to use names like C++, C#, etc.
Let's take the following function
void swap(int& x, int& y) {
int a;
a=x;
x=y;
y=a;
}
Now do this:
unsigned int a=1, b=2;
swap(a, b)
a and b remain with 1 and 2, which is wrong!
Why?
Because when they are cast they get put into temporaries, and the reference now acts like a call by value (the temporary is changed, but NOT copied back - the changes are lost)
Correct me if I'm wrong, but this sounds like a problem with the compiler. Temporaries should be considered const. You should only be able to implicitly cast an unsigned int to a temporary int if the reference in the argument list is a const reference. I tried your program on my compiler, and it barked at me.
Ugh, note to self: grab a coke first thing in the morning. My post didn't make a whole lot of sense, in this context.
My point is that parents are ultimately responsible for their children. No matter what's out there (games, movies, friends who set poor examples, etc), the parents are the ones who need to assume the responsibility for their kids' actions. It is the parents' responsibility to guide their kids and teach them what is right, what is wrong, what is fantasy, and what is reality. Unfortunately, the gaming companies are a much bigger target and can offer more money than parents, so it's better to go after the companies in a court of law. In the end, this is pointing a finger at the wrong people.
While it may be true that exposure changes behavior, I think the most important point here is that parents need to assume responsibility for their children. If you don't agree with violent games, fine, then keep your kids from playing them. If you don't think your kids should watch R-rated flicks, then fine, don't take them to see them. But, for God's sake, don't sue the people who produuce them.
May I assume that the following books will also be available soon? Instant Guido van Rossum ....
I'm personally waiting for my copy of Guido van Rossum How To Program.
Silly slashdot story simply stated: storing some sort of small cell system sucks. Damn...It's too early in the morning for this.
Thanks for clearing that up. I was looking at the problem from a totally different perspective. I was thinking that the desired result was a tree with nodes that had template derived classes, all with different types. But a generic tree that contains only one base type, yea, I could see that. And in that case, I completely agree with you.
Most importantly, as a Monty Python fan, how do you feel about the treatment of fellow programmer Jared Blanks?
The Right Way to implement this is to make an abstract class for the tree node, write the tree manipulation methods to work with the abstract class, and make derived classes that store different types of data, with appropriate constructors that initialize the data fields. Anything that doesn't have to care about the data type can just manipulate the objects as the original abstract class.
This sounds like a perfect place to use the STL and/or C++'s templating mechanism. Trust me, I'm not a huge C++ fan, but the container classes in the STL kick ass (I imagine something like what you describe is already there). Even if the STL don't give you no lovin', templates (and references) make it really easy to write a storage class that works over an arbitrary range of types.
I'm not following. Here's my problem with that solution:
Suppose you have a base tree node class that is a protocol class and then you templatize all the derived classes. If you templatize the derived class, nine times out of ten you're going to want to call functions of the derived class using some of the types that the derived class is using. This is impossible if you have a pointer to the base class, since the base class remains blissfully unaware of its derived classes and the types involved with them. If you don't want to call the functions of the derived classes using their types, that's fine, but I don't see that happen in practice that often. Usually when you templatize a class on a type, you are saying "I am class X, and I deal with type T." To speak its language, and call its functions, you usually need to know what type T is.
Like I said, this is not a problem if you don't have functions in your derived classes that require its caller to know the types being used. If they are all things like "void Execute(void)", then you're good to go. However, if you need to pass a parameter based on the receiver's template type, it seems that a test of the type is in order, which could get messy as more node types are added.
The other option is to also templatize the base class, but then all your base classes (which, of course, would belong to us) that are templatized on different things have different types, and forming a tree out of them would require bypassing the type system of C++.
Overall, yes, templates rock. But, like many features of a language, sometimes it doesn't seem to pay to use them.
Please let me know if I'm missing something.
references: most of your programmer's time will be spent reading the code rather than the class definitions (and this is as it should be) so anything that makes it more difficult to tell what is happening in the code is bad and to be avoided. References are just such a beast, especially when used in parameter lists. (As a return value they are almost acceptable)
As with all language features, there's a fine line between using and abusing a feature. I see your complaint about references, but the same damage can be done with pointers, and nobody wants to without those (well, not me at least).
I hate having to think to myself (when dealing with pure C) "Is that struct being passed via a pointer for updating or for efficiency? Which structs being passed are updated?" A simple way to solve the problem: whenever a parameter is passed out of a function via an argument, say so in the code with a comment. Please. Pretty please, even. All it takes is a simple "/* out */" or "// out".
References don't confuse programmers. Programmers confuse programmers.
It seems that everyone is ready to accuse software of becoming more and more bloated as time goes on, with no apparent gain in features. Even some software developers say this, even though they are some of the same people who call C "assembly-like" and prefer to do their programming in Perl or Java. (Mmm...Perl and Java...)
Really, the payoff in code "bloat" is in the area of development time. It may seem like this has no benefit on the user side, but the so-called bloat that the user complains about is the same stuff that helps the programmer get software to the user in a timely fashion, with fewer mistakes. Granted, this is not always the case, but the trend these days is to put run-time efficiency second in favor of programmer-efficiency. As a programmer, I like this. As a user, I don't like it as much.
If your kids are taking your credit card and buying porn online in the middle of the night, should you blame the internet?
Pick a sentence that means something to you, and pick a number or a few strange symbols that you can remember. Now take the first letter of each word in the sentence and string it together. Insert symbols and numbers where you like, and you have a decently sturdy password. Add longer sentences for more peace of mind.
For instance:
"Slashdot rocks my world and CmdrTaco is a god"
goes to srmwaciag (or srmwactiag if you want to include the Taco part). Add a few symbols in there, say "@$%" and you can get %srm@wa$ctia$g. I actually insert these symbols before the nouns, kinda like perl variables (slashdot being a hash, the world being an array, and god and CmdrTaco being a scalar). Kinda obfuscated, but not too hard to remember (for someone who knows the sentence). Change passes by picking different sentences.
I find that sentences can have virtually infinite combinations, and almost as easy to remember as passwords. Plus they're a little harder to guess without _really_ knowing the person who created it. Granted, it's not the best idea out there, but it's easy and fairly solid.
Well, you beat me to it, but here's what I was going to write. I was writing this when you posted you comment.
Recently, God himself has begun a DMCA-based lawsuit against practicers of genetic research.
"I have been disturbed by the lack of respect for my intellectual property. I spent long hours working on an encryption scheme for my 'life' technology, and I wish that these 'hackers' would appreciate that. Instead, they have reverse-engineered my genetic source code, claiming that it was all in the name of 'science'. This is piracy, plain and simple."
God owns several patents concerning this technology, including a method for autonomous reproduction of life forms and a process for imbuing free will into creatures.
"Now, with this new 'DMCA' law, I can finally put an end to the reverse engineering that threatens to destroy my business. It's obvious that the old standby of 'sin and you go to hell' isn't as effective as it used to be. I'm hoping that this will keep people from stealing my work."
"I thought that the last representative I sent to Earth made it perfectly clear that this sort of thing would not be tolerated. My next official will be expecting full compensation for any derivative works from my technology."