Amateur hour stuff. China does it on much larger scales. That said, it occurs to me that if you stood in front of a column of US tanks, you'd simply be classified as an illegal combatant (posthumously). US troops don't question or disobey orders, unlike those wishy washy liberal commies.
> How is it that the RIAA can see what songs you're sharing.
The classic game netrek had a lovely feature called a "cluecheck" where on some servers, you had to answer simple multiple choice questions using the in-game messenging system before being allowed to play. Can I suggest something similar for Slashdot. Here's one to get us started:
If you choose to run a P2P client/server that works by serving content to anyone who asks for it, should you expect it to know that it's the RIAA asking, and to refuse to talk to them?
I wonder if the problem is simply one of scale. In a global market, with people patenting their "inventions" in every area, there are a lot of inventors struggling to be not first to market, but first to file.
I fully expect to see fantasy patents ooze out of the USA into other areas. Once the EU caves in and allows software patents, watch them get swamped by US patent holders trying to file their patents (and variants on them) there.
You asked what's wrong with "int *bar;". What's wrong with it is simply that getting into the habit of using "*bar" discourages the use of const. Just that, and no more. It's easy to get into good habits if you don't pick up bad ones to begin with.
Kudos to Sony for that, and granted that this is Slashdot, but it's not all about linux. There are other OSs out there, or perhaps, just perhaps, you feel like writing your own. You know, like Linus did.
Two years ago Mr Eddy Stevens sold unauthorised copies of computer games on CD-ROMs for use on Sony PlayStations. He also supplied and installed modifying chips in PlayStation consoles
Case closed. We really need to find better cause celebres rather than letting rights owners pick the fights.
Don't go slagging off C++ syntax until you first learn to program robustly in C, which involves using const, which precludes using "*bar" although (unfortunately) not "int*" because of syntactic sugar.
The correct declaration in either language is, and always has been:
int foo;
int * bar;
No? Make bar a constant pointer using "*bar" then get back to me.
Actually, I've just noticed that you're not at all obsessive. If you use "int *foo;", then you preclude using constant pointers. Obsessing over which particular brand of unnecessary syntactic sugar to use isn't helpful if it discourages you from writing robust code.
That's the big reason I always insist on putting the * by the variable name rather than by the type.
What have you got against declaring constant pointers? Is it so very hard to just use "int * foo;" and not introduce conventions that discourage writing robust code?
>What do you mean by the order of type modifiers? Can you give an example?
If you read right to left when translating an English description into a declaration, you won't go far wrong.
Examples: pointer to constant int. Just read right to left. int, constant, pointer, so "int const *". The trick is that the compiler will associate any leading (left hand) modifier with the first type encountered, so you can also write "const int *". It's pure syntactic sugar, but it causes confusion with complex types.
Try it yourself. Pointer to constant pointer to int? Constant pointer to pointer to constant int? Constant pointer to constant pointer to constant int? Throw some volatile, unsigned, or C++ references in there as well for extra fun.
It's not that hard, really, but it's usually so badly learned that it takes an effort to persuade C coders to use const enough. Everything should be const unless there's a reason otherwise.
Type modifiers are also the reason why * or & modifiers belong with neither the variable name or the basic type. If you rely on syntactic sugar, you can usually get away with putting them with the basic type, but if you insist on, e.g. "int *foo;", then how are you going to make that a constant pointer?
int const isn't obsessive, it's correct. const int is training wheels. I have worked with engineers who never took the wheels off, and who have real trouble understanding:
int const * const
or who don't realise that it's the same as:
const int * const
simply because they're never learned to read (or write) right to left. That said, it would have made more sense to have the typing apply left to right, but it doesn't, and we're stuck with that, so it makes little sense to pretend otherwise.
I didn't mean become an engineer who knows the law, I mean become a lawyer. All the engineering jobs are moving to India anyway. In twenty years, we'll be a nation of lawyers, politicians (I know that's redundant) and towel boys.
Huh, I consider gets to be a minor (!) snafu compared to the vile mind poison of:
int foo, *bar;
And the way that C interprets type modifiers as right to left except that any modifiers on the far left to the first type. Gnnn.
If I had a penny for every time I'd seen developers failing to completely understand C types because of this, I'd be handing my wet towels to Bill Gates.
I guess some people just like to duplicate things. ;-P
1,284,303,705 (July 2002 est.)
Amateur hour stuff. China does it on much larger scales. That said, it occurs to me that if you stood in front of a column of US tanks, you'd simply be classified as an illegal combatant (posthumously). US troops don't question or disobey orders, unlike those wishy washy liberal commies.
>Show me a government who acts with the good of even only their own population in mind.
Sealand.
Better than cheering one on just because you happen to live there. At least there's some rationality to highlighting the positives.
They've failed as a communist party
India. Government type: federal republic. Population: 1,045,845,226. GDP per capita: $2,540. Literacy: 52%. Life expectancy: 62.2 years.
China. Government type: Communist state. Population: 1,284,303,705. GDP per capita: $4,600. Literacy: 81.5%. Life expectancy: 71.86 years.
Don't get me wrong, China sucks wang, but I'd hardly call it a failure.
> How is it that the RIAA can see what songs you're sharing.
The classic game netrek had a lovely feature called a "cluecheck" where on some servers, you had to answer simple multiple choice questions using the in-game messenging system before being allowed to play. Can I suggest something similar for Slashdot. Here's one to get us started:
If you choose to run a P2P client/server that works by serving content to anyone who asks for it, should you expect it to know that it's the RIAA asking, and to refuse to talk to them?
I wonder if the problem is simply one of scale. In a global market, with people patenting their "inventions" in every area, there are a lot of inventors struggling to be not first to market, but first to file.
I fully expect to see fantasy patents ooze out of the USA into other areas. Once the EU caves in and allows software patents, watch them get swamped by US patent holders trying to file their patents (and variants on them) there.
Why not just use ogg video?
You asked what's wrong with "int *bar;". What's wrong with it is simply that getting into the habit of using "*bar" discourages the use of const. Just that, and no more. It's easy to get into good habits if you don't pick up bad ones to begin with.
Kudos to Sony for that, and granted that this is Slashdot, but it's not all about linux. There are other OSs out there, or perhaps, just perhaps, you feel like writing your own. You know, like Linus did.
> Why should we allow tools that have no possible legal use?
It's illegal to write your own software for PS2?
Argue that you can't find anybody doing it, but as they can't do it legally, is that really surprising?
It sets a precedent. Will it still not matter when you can't buy the tools to uncripple a DRM "enhanced" PC and run/write your own software on it?
Two years ago Mr Eddy Stevens sold unauthorised copies of computer games on CD-ROMs for use on Sony PlayStations. He also supplied and installed modifying chips in PlayStation consoles
Case closed. We really need to find better cause celebres rather than letting rights owners pick the fights.
Don't go slagging off C++ syntax until you first learn to program robustly in C, which involves using const, which precludes using "*bar" although (unfortunately) not "int*" because of syntactic sugar.
The correct declaration in either language is, and always has been:
int foo;
int * bar;
No? Make bar a constant pointer using "*bar" then get back to me.
struct { int member1; int member2; } foo, *bar;
How many structs are "created" by this declaration?
Actually, I've just noticed that you're not at all obsessive. If you use "int *foo;", then you preclude using constant pointers. Obsessing over which particular brand of unnecessary syntactic sugar to use isn't helpful if it discourages you from writing robust code.
That's the big reason I always insist on putting the * by the variable name rather than by the type.
What have you got against declaring constant pointers? Is it so very hard to just use "int * foo;" and not introduce conventions that discourage writing robust code?
So what is wrong with:
int *bar;
Make that a constant pointer. Let the hand waving commence.
>What do you mean by the order of type modifiers? Can you give an example?
If you read right to left when translating an English description into a declaration, you won't go far wrong.
Examples: pointer to constant int. Just read right to left. int, constant, pointer, so "int const *". The trick is that the compiler will associate any leading (left hand) modifier with the first type encountered, so you can also write "const int *". It's pure syntactic sugar, but it causes confusion with complex types.
Try it yourself. Pointer to constant pointer to int? Constant pointer to pointer to constant int? Constant pointer to constant pointer to constant int? Throw some volatile, unsigned, or C++ references in there as well for extra fun.
It's not that hard, really, but it's usually so badly learned that it takes an effort to persuade C coders to use const enough. Everything should be const unless there's a reason otherwise.
Type modifiers are also the reason why * or & modifiers belong with neither the variable name or the basic type. If you rely on syntactic sugar, you can usually get away with putting them with the basic type, but if you insist on, e.g. "int *foo;", then how are you going to make that a constant pointer?
> This is why I ALWAYS put the type modifier next to the variable name. I do this for pointers and references.
Shame you can't declare a constant pointer then.
int const isn't obsessive, it's correct. const int is training wheels. I have worked with engineers who never took the wheels off, and who have real trouble understanding:
int const * const
or who don't realise that it's the same as:
const int * const
simply because they're never learned to read (or write) right to left. That said, it would have made more sense to have the typing apply left to right, but it doesn't, and we're stuck with that, so it makes little sense to pretend otherwise.
I didn't mean become an engineer who knows the law, I mean become a lawyer. All the engineering jobs are moving to India anyway. In twenty years, we'll be a nation of lawyers, politicians (I know that's redundant) and towel boys.
"The thing that you do not want to do is be a nut case. Don't bash Microsoft"
Investing dozens (hundreds?) of hours of time to get a $199 refund is by definition nutty. On the second point, this is Slashdot.
Huh, I consider gets to be a minor (!) snafu compared to the vile mind poison of:
int foo, *bar;
And the way that C interprets type modifiers as right to left except that any modifiers on the far left to the first type. Gnnn.
If I had a penny for every time I'd seen developers failing to completely understand C types because of this, I'd be handing my wet towels to Bill Gates.