my father was part of the Occupation forces in Southern Japan at the end of WWII.
And that gives you credibility exactly how? Or your father for that matter. The decision of dropping the bomb wasn't made by the to be formed occupational forces.
Military estimates are that as many as 250,000 Americans would probably have lost their lives, and Japanese casualties from the American invasion would have topped 1,000,000. Estimates are that if the Soviet Union had invaded from the north (where I lived), casualties would have tripled over those expected in the American invasion. From what elderly Japanese people told me when I lived there, the deaths from starvation and disease would probably have pushed the death toll much higher.
Maybe, maybe not. It's a bit hard to believe more American would die than died while fighting in Europe, when the US was fighting on two fronts. As for the estimated Japanese deaths, I'm not questioning the numbers, but in 1945, the people who decided to drop the bombs didn't give a rat's ass for the lives of the Japanese. Otherwise, they would have picked different targets than large cities.
When Emporer Hirohito saw the damage of these bombs (which they had been warned about), he overruled his military advisors and told the Japanese people to lay down their arms and welcome the Americans
Yeah, to save his own ass. He might as well done that if the bombs had not been dropped - it's something we will never know.
The real reason atomic weapons were invented in the United States was because the government realized that they were in an arms race with the Nazi's, and that they absolutely had to win.
And the allied forces defeated the Nazi's without the use of atomic weapons.
Yeah, except that in the 25+ years of the existance of the current holes, noone did misuse the holes on a scale as was done recently.
Just because evildoers might find tools doesn't mean you don't carry any responsibility (moral and sometimes legal as well) for handing them the tools on a silver platter.
Burgerking didn't say "we are innocent - they did it themselves" when some kids experiences some rather nasty side effects of playing with a toy. And that was for something with a harmless intended purpose.
People have a moral responsibility for their actions, and that includes giving away dangerous stuff to lusers. Even if they live in a jurisdiction that is to backwards to recognize this.
Well, I disagree, though I disagree with Mixter's actions. A piece of code may have as its only use to break into a system, but distributing the source of the code makes the weaknesses public, and so able to be dealt with. Closing these publicly known holes then improves the security of the whole system even against unknown attacks.
That's like saying "it's ok to hand out guns so it becomes known how unsafe movie theaters are, and people can fix security".
Handing out code isn't necessary at all to show weaknesses. You can also write an article about it, and *gasp* release some code that fixes the problem. Of course, in this case, the "holes" weren't exactly new. 20 years ago, people know about them as well. The big difference was, 20 years ago noone (mass) distributed code to abuse the holes, and there were no problems.
If someone is really concerned about the existing security holes, and wants to do something about it, then by all means, *do* something about it. Fix the holes, jump on the IP6 bandwagon, port kernels and applications to use IP6. But don't hand lusers the tools to exploit the weaknesses. Noone, absolutely noone is helped by that. Unless you find ego-stroking helping.
Sometimes, the most effective way to kill people will avoid a bigger harm. Nuclear weapons were invented with one intention: to end World War 2. They were successful at that; nuclear weapons, whose only purpose was to kill people, avoided millions of human deaths in WW2.
They might have been invented with one intention, and the actual droppings might have ended WW2, but anyone with any insight will know that they weren't at all necessary to end WW2. Don't forget, the war in Europe was already over in August 1945, and Japan had no significant airforce or Navy left. There was absolutely no question left who would win the Asian conflict. The main reason the bombs were dropped was to impress the Soviets, and to prevent them from joining the war in Asia and them claiming some of the booty. The cold war had already started.
They had also an unexpected side benefit - they avoided World War 3.
That's highly debatable. WW3 hasn't happened (yet), but that doesn't mean nuclear weapons prevented that. And a few times, the world has been on the brink of a WW3 *because* of nuclear weapons. The world would have been quite different if Truman had dropped the bomb in Korea, or if the Cuban missile crises would have went the other way.
There are scientists who create machines that can be used to kill people, but that can also be used to better purposes.
There's a big difference between can and intended to. I think the world would be a safer place without guns - it's worth the price of the occasional bear in your back garden and the lack of a recreational shooting range. But the world wouldn't be better of without hammers. Hammers can be used to kill, but it's not their main purpose.
Whose side are you on?
Me? I'm on the rational side. The world is filled with lusers. If you create something, and make it available to everyone, you have some form of responsibility. The world isn't an anarchy filled with irresponsible people.
That may be your purpose for a gun. For me, the main purpose of one of my guns is for home defense. The main purpose of some of my other guns is recreation at the shooting range. The main purpose of the model 94 Winchester (circa 1897) is as a decorative showpiece above the fireplace mantle. The main purpose of the rifle is for hunting.
And how exactly do you do your home defense with a gun, without potentially maiming and killing? Pry it between the door and the post so it becomes harder to open the door? How do you hunt with a rifle without killing? Use it as a crude spade to dig a hole? The gun that was produced in 1897 by the Winchester factory, was that intended to be a showpiece?
What a narrow limited view you have, and further what arrogance you have to even suggest that your one view on the purpose of guns is the only purpose.
Perhaps you should consult a dictionary and look up the words primary and only. Those meanings aren't equivalent.
Not really. Quicksort has the same worst case and "average" (from a analytical, random input standpoint) performance as mergesort, but yet quicksort performs better "in practice".
That's wrong. Mergesort is O (n log n) worst case. Worst case quicksort is Omega (n^2). And to make it worse, common implementations of picking the pivot element (first element, last element, median of the first three elements) have sorted inputs as their worst case (that is, they produce their own worst case input). Even if you pick a pivot at random, there is a non-zero chance you always pick an extreme, leading to quadratic behaviour.
Now, you *can* find a median of a set in linear time, and using such a method to find the pivot leads to a worst-case O (n log n) sorting algorithm. However, the overhead is so much, the resulting algorithm will be slower, more complicated, and certainly less elegant than either mergesort or heapsort.
References: Knuth, D.E: The Art of Computer Programming, Vol III, Sorting and Searching, 2nd edition, Addison-Wesley, 1998. ISBN 0-201-89685-0. Cormen, T. H., Leiserson, C. E. and Rivest, R. L.: Introduction to Algorithms MIT Press, 1990, ISBN 0-262-53091-0. Hoare, C.A.R.: "Algorithm 63, Partition; Algorithm 64, Quicksort" Communications of the ACM, Vol 4, 1961, p 321.
Do you agree that C and C++ are both more strongly typed than Perl?
That depends on what your view is. If you mean that C and C++ have the types of variables more visible in program text than Perl, certainly. I disagree that they are strongly typed. Or whether C's typing mechanism is actually useful. Take for instance a look at this program:
Compiling that with gcc -Wall, you get: float.c: In function `main': float.c:9: warning: comparison of distinct pointer types lacks a cast
A warning that shouldn't be there, and many type violations that don't get flagged at all.
I wasn't sure what that meant. An array is a list of values addressable by a subscript, ie foo[1]. I simply don't understand what you mean by "monsters that try to look like arrays".
In C, there is a strong relationship between pointers and arrays, strong enough that pointers and arrays should be discussed simultaneously. Any operation that can be achieved by array subscripting can also be done with pointers.
Kernighan & Ritchie: The C Programming Language. Prentice Hall, 1988.
C lacks useful operators on arrays. You can't add from arrays. You can't take pieces of it. Copying arrays is fun too. Look at the following program:
Fun. This won't even compile - due to a (to make the circle round) a typing error: try.c: In function `main': try.c:9: incompatible types in assignment
So, that's what I mean with monsters. They call themselves arrays, but they really just pointers - and the language doesn't have anything to actual manipulate arrays - just pointers.
Arrays in Perl are used to hold data structures.
Rubbish. Arrays in Perl are used to hold data, just like in any other language. An array can be (an implementation of) a datastructure, or be part of a datastructure.
I don't think arrays have enough structure for a beginning programmer. While C structs allow you to defeat the structure, you at least have the option of defining a rigid structure and having the compiler enforce it.
Perl arrays certainly don't have less structure than C arrays or Python arrays. And just like in C or Python, or most other languages, Perl has more data structures than arrays. If you want structures, pseudo-hashes will approximate your needs. Compiler enforced checking, with the speed of arrays.
Personally, I don't think statements of opinion with earnest attempts to explain the reasoning behind the opinion constitute trolls.
"Don't get me started on Perl arrays" in a discussion about a beginners book of Perl doesn't contain any reasoning in my book. It was nothing more than a flamebait.
My initial response to you was hostile. Why? Because your initial post to me was hostile.
Your first question is meaningless since you are referring to something different than I.
You talked about "strongly typed languages". Not language that are stronger typed than Perl. If you are referring to something different than I am, what do you mean by strongly typed languages then?
As far as the second question goes, I'm just going to make this broad statement: Perl lacks the structure that I feel is necessary for large scale development projects. I also feel that this lack of structure is an impediment to learning good programming methodology.
My second question was "What about arrays?" after your remark "don't get me started on Perl arrays". Your broad statement about your experienced lack of structure in Perl doesn't address arrays at all. Hence, it doesn't answer the question, it's just a flamebait.
It will take more than trolls to get me to change my mind.
If there's any trolling going on, it's you doing it.
Pointers are crucial to any serious language, including Perl. Without use of pointers (aka references) in Perl
You missed the point completely. It isn't pointers aka references. A reference isn't a pointer, and a pointer isn't a reference. You can't point a reference to anywhere you want - it always has to reference something. You can't do pointer arithmetic - after all, a reference isn't a pointer. You can't segfault while dereferencing a reference - it always lead somewhere safe.
Well, Perl has some advantages and disadvantages as a learning programing language. I definitely agree that its lack of strong typing and quirky handling of nested data structures are things that I wouldn't want to force a beginning programer to learn. OTOH, I think that some of its other features, like being interpreted, having localizable variable, and having easy file handling, are things that are desirable for a learner.
Well, Perl has no strong typing, but languages that do have strong typing aren't very popular as first languages either. And no, C or Python don't have strong typing either. Haskell and ML do though. I fail to see what is "quirky" about Perls handling of nested data structures. It behaves similary to Python, and it sure beats the crap out of C. I don't think beginners have any interest about whether languages are interpreted or compiled - not that Perl is interpreted; Perl gets compiled before it's executed. Proper use of local is one of the harder things to learn in Perl, if I were to teach beginners, I wouldn't tell them about local untill they are past the beginning stage.
Some typing: At the very least numbers and strings should be kept separate, even if there's no int/float distinction. The complex rules about casting strings to numbers in Perl are more confusing to a learner than requiring separate types would be.
Why? What's so special about having different types for strings and numbers? With warnings turned on, Perl will warn you if try to add "foo" to "bar", so it isn't that you can easily make errors. OTOH, you don't have to teach newbies about horrid functions like sscanf, or bother them with a battery of functions that do nothing than take a value, and return the same value, but as a different type. (atoi, atof, etc).
Interpreted: I find that interpreted languages are much easier to debug than compiled ones, and a learning programer probably cares more about that than the speed of a compiled language.
Really? What's the benefit of an interpreted language over a compiled one? I can see the benefit of not having a separate compile stage, like C or Pascal have, but Perl is compiled before executed.
Good commenting: It's never too easy to learn how to do in code documentation.
That's not a language feature, but a feature of programs.
Good libraries: This should help a beginner to write more significant and satisfying programs. If the source is included, as it should be in an interpreted language, they can also provide a good style guide.
Core libraries are typically optimized for speed. I don't think providing a style guide for newbies should be a primary task for something like libc or libm.
Any other ideas for what a language should have?
Not really a language feature, but more a compiler one: good error and warning message. (This is my biggest hesitation to suggest Python as a good first language, its error messages are very cryptical)
Memory management, both in the sense of garbage collection, automatic allocation and range checking. Thirty years (and counting) of security holes due to buffer overflows in C programs show that the price of range checking is well worth it.
The language should serve the programmer, instead of the programmer be a slave of the language. With C, you have to tell the compiler everything: this is a number, and it will not have a sign, and reserve at least 2 bytes for it. And just do something undefined when the programmer uses it as a pointer anyway. Either do it the Perl way, where the value determines the type of the variable, or the way certain functional languages do it: deduce the types of variables from the way they are used, and abort compilation when there's a conflict.
Compact syntax. If things tend to be done often, it isn't a sin to have a special language construct to do this, even if it makes the language bigger. That's the way natural languages work as well. This includes doing things automatically, like allocation of space. That way, important fragments of code don't get cluttered with trivial code, making code much more readable. Take this piece of Perl code, and write a C equivalent: my%words; while(<>){ foreachmy$word(split'')&nb sp;{ $words{$word}++ } }
Invariants. You should be able to set restrictions on the values of variables, which are checked on a regular basis (like the end of method call, or when parameters are passed in to a function). Eiffel has this. Of course, you can do this by hand, but that clutters your code, and makes it harder to change the conditions.
But it does matter, because there are diferent comparison operators: ==(numbers) and eq(strings)
No, it doesn't. == and eq are different operators, doing different things. They aren't the same operator giving different answers depending on the type of the operands, like/ does in C. == and eq are different, just like + and * are.
For example, in Perl (like most scripting languages) there is a single data type to represent everything from strings to characters to all sorts of numbers. Java/C++/C/Fortran/Basic etc...have different data types (short, long, char, String etc...) for very good reasons.
Well, that isn't quite true. Strings and numbers are two different things in Perl. True, you don't see that in the program _text_, but it sure is there behind the scenes. Don't get too excited over the dozen or so numerical types in C. They aren't there to help you write better code - they main reason they are there is to help the compiler generate more efficient code. In C, one can get type "warnings" from the compiler that don't warrant warnings, or not get warnings where you should have gotten one. If you want a language with useful (strong) typing, look at something like ML where the program text doesn't contain any types, but the compilers figures out the types of the variables, and complains when there are conflicts.
But you'll get to know that "school" and life will be good.
Of course, the -d in Perl comes from a certain "school" as well. The test function from Unix shells.
For a experienced perl programmer at the end of the day he/she will use what's more convenient, which is good. But for someone who's learning the ropes it can be exasperating.
And this is different from learning the libraries in C (or Python) in which way?
The overall effect of this is that it would be much more difficult to automate the slashdot-bombing procedure, as you'd have to create a new email account and user account every time you got booted. I think this would kill about 90% of the worst crap posted here.
Not sure what this discussion has to do with the subject of the story (and, in that sense, it's as much a DoS as the "attack" the posters are complaining about), but the above is hardly a hindrance. It wouldn't take a halfway decent coder more than an hour to write a Perl or Python program that creates a new email account on one of the many free email services out there, and a new account on slashdot. Let the account generator run overnight, and you have quite a few accounts you can (mis)use.
I would say, let's keep the "Anonymous Coward", but add an "AC" filter, regardless of your comment level. A filter like "show me only comments of people having positive karma, have made at least 10 comments, and have been around for at least 4 weeks" would be useful.
[1] Does compiling proprietary code with gcc make it GPL? How do you know which libraries are okay to link in (if any)?
Nope, ever heard of the LGPL??
That only works if all the linked in libraries are LGPL. And some GNU pronents (including RMS, IIRC) advocate using GPL for libraries too - just so that code linked with it turns into GPL code.
Of course, this can lead to interesting situations. Suppose I write some code C, under license L, with L != GPL. C needs a library L. I use a non-GPLed implementation of L. Now, I give you the code. Your system has a GPLed implementation of L. Now what?
Then it's still illegal to be or pay a cyber journalist. From the article, I got the impression that money is one of the driving factors of the production of news items. If you take away the money aspect, or at least, seriously reduce it by making it illegal, you take away a lot of cyber journalists. Sure, those who do it for the love of freedom will always find a way to distribute news - but for the government, it's a lot easier to claim that the "news" of a small group of people using illegal means, and foreign help is propaganda then having a battery of legal sites inside the country.
Screwing up while learning Linux gives lots of hackers access to all the porn on my hard drive and the recipes for my mother's 'experimental' cooking.
Screwing up gives Linux and Unix a bad name, people not knowing what they do flood IRC and Usenet channels with noise, and they give script kiddies many opportunities.
Now, this, of course, ignores the fact that if you were as kewl as you think you are, you wouldn't be USING RPM's ANYWAY!
Well, duh, I don't.
I want to learn Linux, but because of the great wisdom of Abigail, I shouldn't install it, I should get experience as a user.
I dunno. Do you think the best way to learn how to fly is to buy a plane and just take off? Or would you start with making yourself more familiar with flying planes under the supervision of someone who knows how to fly?
Rarely does a server need more than a single 100mbit link.
Whether or not a server needs more than one link is not a matter of just the server. Your network topology is very important as well. If you have a whole bunch of work stations, grouped on a handful of switches, and the switches tied together with a router, the majority of your server/workstation traffic is going via said router. By plugging your server directly into each switch, you avoid bottlenecks.
-- Abigail
Re:Yeh but Linux is actually better...
on
Free Solaris 8
·
· Score: 2
Well the point I think he/she was making is that Linux stuff comes in RPM's etc and you just install the RPM. No need to build etc. Solaris stuff very rarely comes prebuilt, and even more rarely comes with dependency-based packaging.
Sun has had a package system for many years. Predating RPMs, IIRC.
Call me old fashioned, paranoid, or just sensible, but I don't use RPMs or Debian packages on my Linux system, nor packages for Solaris if I can avoid it. I want to know where every file goes, I want to know which compile options I have, I want to see the output of the compiler, and, most of all, I want to test it before installing it.
-- Abigail
Re:What are the Differences?
on
Free Solaris 8
·
· Score: 2
I don't consider Apache, mod_perl, Python, PHP, etc. to be "goodies". They're necessary tools for business.
Unless you are in the "web business", none of Apache, mod_perl or PHP are necessary tools. And if I have third party packages that are "necessary tools", I will keep track of them, and upgrade when needed - why would I let my OS vendor decide? It isn't his (her?) product.
Sure. If you want to have to pull down an install a new package that isn't supported by the OS vendor every time you have a new need go for it. I'd rather pay for one support package.
So, which Linux vendor supports Perl, Python, Apache, GIMP, whatever? While I've seen Red Hats with broken, trial release, Perl packages, I've yet to see any Perl patches by a Red Hat, Debian or other Linux "vendor".
Products like Perl, Python, PHP, gcc, Apache, GIMP all have their release scedules totally independent from any OS vendor. And Red Hat or Debian ain't going around "oh, there's a new release of Perl, quick, we need to make a new release too". If I have a need to maintain Perl or Python, I'll install it, and keep track of their versions.
Saying that Linux is better than Solaris because of the existance of vendors that gather the freeware for you, and put it on a CD doesn't make much sense. Sure, in some case, it might be convenient. It usually isn't a big deal.
It was somewhat understandable. But with the new distros that want you to create a non-root account upon installation, it is less understandable. Perhaps they need to add a function that if the user enters 'root' at the first logon, they are asked to confirm this, reiterate that it could be dangerous, etc.
I beg to differ. That would be just too damn annoying for people who do know what they are doing. And for people who don't, well, though luck. People with no Unix experience shouldn't admin a Unix box - let alone install a Unix system. Either get experience as a user, or just run Windows. That's why M$ exists.
The virus would have to find a way to get root access.
No, all you need to do is trick the user in running something as root. For instance, offering him some nice looking software, and infect the system during "make install". You might even wrap it in a PGP signed RPM, with available fingerprints, and do the same trick when the RPM is installed.
It's a pity, really. Now Sun is giving away Solaris, what would Open Sourcing cost them? Control, I guess.
Lots and lots and lots of money if the appropriate holders of the intellectual properties sue Sun. As explained in the article, Sun doesn't hold the IP of everything that makes Solaris. Even if Sun would be willing to Open Source Solaris, they can't.
And that gives you credibility exactly how? Or your father for that matter. The decision of dropping the bomb wasn't made by the to be formed occupational forces.
Military estimates are that as many as 250,000 Americans would probably have lost their lives, and Japanese casualties from the American invasion would have topped 1,000,000. Estimates are that if the Soviet Union had invaded from the north (where I lived), casualties would have tripled over those expected in the American invasion. From what elderly Japanese people told me when I lived there, the deaths from starvation and disease would probably have pushed the death toll much higher.
Maybe, maybe not. It's a bit hard to believe more American would die than died while fighting in Europe, when the US was fighting on two fronts. As for the estimated Japanese deaths, I'm not questioning the numbers, but in 1945, the people who decided to drop the bombs didn't give a rat's ass for the lives of the Japanese. Otherwise, they would have picked different targets than large cities.
When Emporer Hirohito saw the damage of these bombs (which they had been warned about), he overruled his military advisors and told the Japanese people to lay down their arms and welcome the Americans
Yeah, to save his own ass. He might as well done that if the bombs had not been dropped - it's something we will never know.
The real reason atomic weapons were invented in the United States was because the government realized that they were in an arms race with the Nazi's, and that they absolutely had to win.
And the allied forces defeated the Nazi's without the use of atomic weapons.
Yeah, except that in the 25+ years of the existance of the current holes, noone did misuse the holes on a scale as was done recently.
Just because evildoers might find tools doesn't mean you don't carry any responsibility (moral and sometimes legal as well) for handing them the tools on a silver platter.
Burgerking didn't say "we are innocent - they did it themselves" when some kids experiences some rather nasty side effects of playing with a toy. And that was for something with a harmless intended purpose.
People have a moral responsibility for their actions, and that includes giving away dangerous stuff to lusers. Even if they live in a jurisdiction that is to backwards to recognize this.
-- Abigail
That's like saying "it's ok to hand out guns so it becomes known how unsafe movie theaters are, and people can fix security".
Handing out code isn't necessary at all to show weaknesses. You can also write an article about it, and *gasp* release some code that fixes the problem. Of course, in this case, the "holes" weren't exactly new. 20 years ago, people know about them as well. The big difference was, 20 years ago noone (mass) distributed code to abuse the holes, and there were no problems.
If someone is really concerned about the existing security holes, and wants to do something about it, then by all means, *do* something about it. Fix the holes, jump on the IP6 bandwagon, port kernels and applications to use IP6. But don't hand lusers the tools to exploit the weaknesses. Noone, absolutely noone is helped by that. Unless you find ego-stroking helping.
-- Abigail
They might have been invented with one intention, and the actual droppings might have ended WW2, but anyone with any insight will know that they weren't at all necessary to end WW2. Don't forget, the war in Europe was already over in August 1945, and Japan had no significant airforce or Navy left. There was absolutely no question left who would win the Asian conflict. The main reason the bombs were dropped was to impress the Soviets, and to prevent them from joining the war in Asia and them claiming some of the booty. The cold war had already started.
They had also an unexpected side benefit - they avoided World War 3.
That's highly debatable. WW3 hasn't happened (yet), but that doesn't mean nuclear weapons prevented that. And a few times, the world has been on the brink of a WW3 *because* of nuclear weapons. The world would have been quite different if Truman had dropped the bomb in Korea, or if the Cuban missile crises would have went the other way.
There are scientists who create machines that can be used to kill people, but that can also be used to better purposes.
There's a big difference between can and intended to. I think the world would be a safer place without guns - it's worth the price of the occasional bear in your back garden and the lack of a recreational shooting range. But the world wouldn't be better of without hammers. Hammers can be used to kill, but it's not their main purpose.
Whose side are you on?
Me? I'm on the rational side. The world is filled with lusers. If you create something, and make it available to everyone, you have some form of responsibility. The world isn't an anarchy filled with irresponsible people.
-- Abigail
And how exactly do you do your home defense with a gun, without potentially maiming and killing? Pry it between the door and the post so it becomes harder to open the door? How do you hunt with a rifle without killing? Use it as a crude spade to dig a hole? The gun that was produced in 1897 by the Winchester factory, was that intended to be a showpiece?
What a narrow limited view you have, and further what arrogance you have to even suggest that your one view on the purpose of guns is the only purpose.
Perhaps you should consult a dictionary and look up the words primary and only. Those meanings aren't equivalent.
-- Abigail
That's wrong. Mergesort is O (n log n) worst case. Worst case quicksort is Omega (n^2). And to make it worse, common implementations of picking the pivot element (first element, last element, median of the first three elements) have sorted inputs as their worst case (that is, they produce their own worst case input). Even if you pick a pivot at random, there is a non-zero chance you always pick an extreme, leading to quadratic behaviour.
Now, you *can* find a median of a set in linear time, and using such a method to find the pivot leads to a worst-case O (n log n) sorting algorithm. However, the overhead is so much, the resulting algorithm will be slower, more complicated, and certainly less elegant than either mergesort or heapsort.
References:
Knuth, D.E: The Art of Computer Programming, Vol III, Sorting and Searching, 2nd edition, Addison-Wesley, 1998. ISBN 0-201-89685-0.
Cormen, T. H., Leiserson, C. E. and Rivest, R. L.: Introduction to Algorithms MIT Press, 1990, ISBN 0-262-53091-0.
Hoare, C.A.R.: "Algorithm 63, Partition; Algorithm 64, Quicksort" Communications of the ACM, Vol 4, 1961, p 321.
-- Abigail
That depends on what your view is. If you mean that C and C++ have the types of variables more visible in program text than Perl, certainly. I disagree that they are strongly typed. Or whether C's typing mechanism is actually useful. Take for instance a look at this program:
#include<stdio.h>
#include<stdlib.h>
intmain(void)
{
unsignedchar*c;
floatf=10;
for(c=(char*)&f;c<s izeof(float)+(char*)&f;c++){
printf("%u",*c);
}
putchar('\n');
return0;
}
Compiling that with gcc -Wall, you get:
float.c: In function `main':
float.c:9: warning: comparison of distinct pointer types lacks a cast
A warning that shouldn't be there, and many type violations that don't get flagged at all.
I wasn't sure what that meant. An array is a list of values addressable by a subscript, ie foo[1]. I simply don't understand what you mean by "monsters that try to look like arrays".
C lacks useful operators on arrays. You can't add from arrays. You can't take pieces of it. Copying arrays is fun too. Look at the following program:#include<stdlib.h>
#include<stdio.h>
intmain(){
int*a;
int*b;
a=(int*)malloc(sizeof(int));
b=(int*)malloc(sizeof(int));
a[0]=3;
b=a;
printf("%d\n",b[0]);
a[0]=5;
printf("%d\n",b[0]);
exit(0);
}
When run, it will print
3
5
This is of course because we copied pointers, not arrays. So, let's change the program slightly, to use arrays, not pointers.
#include<stdlib.h>
#include<stdio.h>
intmain(){
inta[1];
intb[1];
a[0]=3;
b=a;
printf("%d\n",b[0]);
a[0]=5;
printf("%d\n",b[0]);
exit(0);
}
Fun. This won't even compile - due to a (to make the circle round) a typing error:
try.c: In function `main':
try.c:9: incompatible types in assignment
So, that's what I mean with monsters. They call themselves arrays, but they really just pointers - and the language doesn't have anything to actual manipulate arrays - just pointers.
Arrays in Perl are used to hold data structures.
Rubbish. Arrays in Perl are used to hold data, just like in any other language. An array can be (an implementation of) a datastructure, or be part of a datastructure.
I don't think arrays have enough structure for a beginning programmer. While C structs allow you to defeat the structure, you at least have the option of defining a rigid structure and having the compiler enforce it.
Perl arrays certainly don't have less structure than C arrays or Python arrays. And just like in C or Python, or most other languages, Perl has more data structures than arrays. If you want structures, pseudo-hashes will approximate your needs. Compiler enforced checking, with the speed of arrays.
Personally, I don't think statements of opinion with earnest attempts to explain the reasoning behind the opinion constitute trolls.
"Don't get me started on Perl arrays" in a discussion about a beginners book of Perl doesn't contain any reasoning in my book. It was nothing more than a flamebait.
My initial response to you was hostile. Why? Because your initial post to me was hostile.
I think your first post was hostile.
-- Abigail
You talked about "strongly typed languages". Not language that are stronger typed than Perl. If you are referring to something different than I am, what do you mean by strongly typed languages then?
As far as the second question goes, I'm just going to make this broad statement: Perl lacks the structure that I feel is necessary for large scale development projects. I also feel that this lack of structure is an impediment to learning good programming methodology.
My second question was "What about arrays?" after your remark "don't get me started on Perl arrays". Your broad statement about your experienced lack of structure in Perl doesn't address arrays at all. Hence, it doesn't answer the question, it's just a flamebait.
It will take more than trolls to get me to change my mind.
If there's any trolling going on, it's you doing it.
-- Abigail
You missed the point completely. It isn't pointers aka references. A reference isn't a pointer, and a pointer isn't a reference. You can't point a reference to anywhere you want - it always has to reference something. You can't do pointer arithmetic - after all, a reference isn't a pointer. You can't segfault while dereferencing a reference - it always lead somewhere safe.
References aren't pointers.
-- Abigail
Well, Perl has no strong typing, but languages that do have strong typing aren't very popular as first languages either. And no, C or Python don't have strong typing either. Haskell and ML do though. I fail to see what is "quirky" about Perls handling of nested data structures. It behaves similary to Python, and it sure beats the crap out of C. I don't think beginners have any interest about whether languages are interpreted or compiled - not that Perl is interpreted; Perl gets compiled before it's executed. Proper use of local is one of the harder things to learn in Perl, if I were to teach beginners, I wouldn't tell them about local untill they are past the beginning stage.
Some typing: At the very least numbers and strings should be kept separate, even if there's no int/float distinction. The complex rules about casting strings to numbers in Perl are more confusing to a learner than requiring separate types would be.
Why? What's so special about having different types for strings and numbers? With warnings turned on, Perl will warn you if try to add "foo" to "bar", so it isn't that you can easily make errors. OTOH, you don't have to teach newbies about horrid functions like sscanf, or bother them with a battery of functions that do nothing than take a value, and return the same value, but as a different type. (atoi, atof, etc).
Interpreted: I find that interpreted languages are much easier to debug than compiled ones, and a learning programer probably cares more about that than the speed of a compiled language.
Really? What's the benefit of an interpreted language over a compiled one? I can see the benefit of not having a separate compile stage, like C or Pascal have, but Perl is compiled before executed.
Good commenting: It's never too easy to learn how to do in code documentation.
That's not a language feature, but a feature of programs.
Good libraries: This should help a beginner to write more significant and satisfying programs. If the source is included, as it should be in an interpreted language, they can also provide a good style guide.
Core libraries are typically optimized for speed. I don't think providing a style guide for newbies should be a primary task for something like libc or libm.
Any other ideas for what a language should have?
my%words;
while(<>){
foreachmy$word(split'')&nb sp;{
$words{$word}++
}
}
foreachmy$word(sortkeys%words){
print"$word:$words{$word}\n"
}
-- Abigail
No, it doesn't. == and eq are different operators, doing different things. They aren't the same operator giving different answers depending on the type of the operands, like / does in C. == and eq are different, just like + and * are.
-- Abigail
Care to point out some large coding projects in languages that have strong typing? Don't bother showing anything in C - that isn't strong typing.
And don't get me started on Perl arrays.
What about them? At least Perl has arrays, unlike popular languages like C, which just has monsters that try to look like arrays.
-- Abigail
Well, that isn't quite true. Strings and numbers are two different things in Perl. True, you don't see that in the program _text_, but it sure is there behind the scenes. Don't get too excited over the dozen or so numerical types in C. They aren't there to help you write better code - they main reason they are there is to help the compiler generate more efficient code. In C, one can get type "warnings" from the compiler that don't warrant warnings, or not get warnings where you should have gotten one. If you want a language with useful (strong) typing, look at something like ML where the program text doesn't contain any types, but the compilers figures out the types of the variables, and complains when there are conflicts.
-- Abigail
Of course, the -d in Perl comes from a certain "school" as well. The test function from Unix shells.
For a experienced perl programmer at the end of the day he/she will use what's more convenient, which is good. But for someone who's learning the ropes it can be exasperating.
And this is different from learning the libraries in C (or Python) in which way?
-- Abigail
Not sure what this discussion has to do with the subject of the story (and, in that sense, it's as much a DoS as the "attack" the posters are complaining about), but the above is hardly a hindrance. It wouldn't take a halfway decent coder more than an hour to write a Perl or Python program that creates a new email account on one of the many free email services out there, and a new account on slashdot. Let the account generator run overnight, and you have quite a few accounts you can (mis)use.
I would say, let's keep the "Anonymous Coward", but add an "AC" filter, regardless of your comment level. A filter like "show me only comments of people having positive karma, have made at least 10 comments, and have been around for at least 4 weeks" would be useful.
-- Abigail
Nope, ever heard of the LGPL??
That only works if all the linked in libraries are LGPL. And some GNU pronents (including RMS, IIRC) advocate using GPL for libraries too - just so that code linked with it turns into GPL code.
Of course, this can lead to interesting situations. Suppose I write some code C, under license L, with L != GPL. C needs a library L. I use a non-GPLed implementation of L. Now, I give you the code. Your system has a GPLed implementation of L. Now what?
-- Abigail
Then it's still illegal to be or pay a cyber journalist. From the article, I got the impression that money is one of the driving factors of the production of news items. If you take away the money aspect, or at least, seriously reduce it by making it illegal, you take away a lot of cyber journalists. Sure, those who do it for the love of freedom will always find a way to distribute news - but for the government, it's a lot easier to claim that the "news" of a small group of people using illegal means, and foreign help is propaganda then having a battery of legal sites inside the country.
-- Abigail
Screwing up gives Linux and Unix a bad name, people not knowing what they do flood IRC and Usenet channels with noise, and they give script kiddies many opportunities.
-- Abigail
Well, duh, I don't.
I want to learn Linux, but because of the great wisdom of Abigail, I shouldn't install it, I should get experience as a user.
I dunno. Do you think the best way to learn how to fly is to buy a plane and just take off? Or would you start with making yourself more familiar with flying planes under the supervision of someone who knows how to fly?
-- Abigail
Whether or not a server needs more than one link is not a matter of just the server. Your network topology is very important as well. If you have a whole bunch of work stations, grouped on a handful of switches, and the switches tied together with a router, the majority of your server/workstation traffic is going via said router. By plugging your server directly into each switch, you avoid bottlenecks.
-- Abigail
-- Abigail
Unless you are in the "web business", none of Apache, mod_perl or PHP are necessary tools. And if I have third party packages that are "necessary tools", I will keep track of them, and upgrade when needed - why would I let my OS vendor decide? It isn't his (her?) product.
Sure. If you want to have to pull down an install a new package that isn't supported by the OS vendor every time you have a new need go for it. I'd rather pay for one support package.
So, which Linux vendor supports Perl, Python, Apache, GIMP, whatever? While I've seen Red Hats with broken, trial release, Perl packages, I've yet to see any Perl patches by a Red Hat, Debian or other Linux "vendor".
Products like Perl, Python, PHP, gcc, Apache, GIMP all have their release scedules totally independent from any OS vendor. And Red Hat or Debian ain't going around "oh, there's a new release of Perl, quick, we need to make a new release too". If I have a need to maintain Perl or Python, I'll install it, and keep track of their versions.
Saying that Linux is better than Solaris because of the existance of vendors that gather the freeware for you, and put it on a CD doesn't make much sense. Sure, in some case, it might be convenient. It usually isn't a big deal.
-- Abigail
I beg to differ. That would be just too damn annoying for people who do know what they are doing. And for people who don't, well, though luck. People with no Unix experience shouldn't admin a Unix box - let alone install a Unix system. Either get experience as a user, or just run Windows. That's why M$ exists.
-- Abigail
No, all you need to do is trick the user in running something as root. For instance, offering him some nice looking software, and infect the system during "make install". You might even wrap it in a PGP signed RPM, with available fingerprints, and do the same trick when the RPM is installed.
-- Abigail
Lots and lots and lots of money if the appropriate holders of the intellectual properties sue Sun. As explained in the article, Sun doesn't hold the IP of everything that makes Solaris. Even if Sun would be willing to Open Source Solaris, they can't.
-- Abigail