Is it? mod_php is faster than perl via CGI of course, but is mod_php faster than mod_perl too? Just curieus; I would think more websites would run php instead of perl if perl was indeed much slower than php.
I don't mean to quantity of the functions; it's ok if there are a lot of them (though I'd like some kind of module system, so they wouldn't pollute the namespace as much).
What I mean is, for example, this section in the manual:
Why is $foo[bar] wrong?
You should always use quotes around a string literal array index. For example, use $foo['bar'] and not $foo[bar]. But why is $foo[bar] wrong? You might have seen the following syntax in old scripts:
This is wrong, but it works. Then, why is it wrong? The reason is that this code has an undefined constant (bar) rather than a string ('bar' - notice the quotes), and PHP may in future define constants which, unfortunately for your code, have the same name. It works because PHP automatically converts a bare string (an unquoted string which does not correspond to any known symbol) into a string which contains the bare string. For instance, if there is no defined constant named bar, then PHP will substitute in the string 'bar' and use that.
It's wrong, but it works, presumably because once upon a time it seemed like a good idea to convert unknown symbols to strings. To me, that's bad design. Frankly, I don't understand why there's a need to explain why $foo[bar] is wrong in the first place. It's as obvious as can be, unless you're an absolute beginner, in which case the language should help you to learn the basic concepts instead of trying to double-guess what you meant.
There are more things like this; small details perhaps, but they give me a bad feeling about the whole design. But, to each his own of course.
I Googled for it and it seems more proprietary than Perl or Python (didn't find a free download and docs).
Downloads are at http://www.php.net/downloads.php, docs at http://www.php.net/manual/en/.
I have read the criticism comments that PHP is in the Visual Basic category of encouraging weak minds to tackle strong tasks.
Today I read a comment somewhere (sadly I can't find it anymore) that compared PHP with MySQL: very forgiving for errors. If often fails silently, and potentially does something completely wrong without so much as a warning.
Personally, I don't like it partly because of that, and partly because I feel the language is very inconsistent. Everything feels extremely ad-hoc in some way. When I first learned PHP, I didn't feel that way; I even used it as a non-web scripting language for some simple system administration tasks. Some time later I started to learn Python, and the more I learned Python, the more I disliked PHP. In Python everything fits very neatly together, completely the opposite of PHP IMO.
Is this like Visual Basic in that it is cobbled together and lacks consistency and a uniform vision,
IMO, yes.
Is there some application domain where you really need to know this?
I don't think so.
Are there better substitutes?
I don't do any web programming anymore; as a language I prefer Python, but I have never used it for web programming. There exist differen solutions to use there tough.
Does it have interesting ideas of its own worth emulating?
- You don't need X on a server - If you want X for some reason, don't install Gnome or KDE; use Fluxbox or some other light window manager. X itself doesn't have that large a foot print
I thought so too, but now I'm not so sure anymore.
On Windows XP, I started Windows Explorer. The Help|Info dialog box (it's a Dutch Windows, I guess that's Help|About in English) says Windows Explorer. I typed http://slashdot.org. As expected,/. appears alongside the folder tree. Now Help|Info says Internet Explorer.
The reverse is also true: start Internet Explorer, Help|Info says Internet Explorer. Type C:\ in the address bar and press enter, now Help|Info says Windows Explorer.
In contrast, when viewing a PDF, Help|Info still says Internet Explorer, not Acrobat Reader.
I can't speak for the term in general, but in Python it means variables can have different types on different times, while still being strongly typed.
a = 1 Now a is an integer (actually what happens is this: an integer object is created, with the value 1, and the name a is bound to it)
a == '1' Returns False: objects with different types can not be equal.
a = '1' A new object is created, containing the string '1'. a now binds to that new object.
a == '1' True.
Somewhat more useful: file objects implement a number of methods. If you write a class that implements those methods (often a subset is enough), you can use it any place where you can use a file object. No need to derive from file class. Of course this doesn't work only for files, it can be used for anything.
It's not defined that way. The reason is also wrong: if you wanted to define the density of water this way, you would choose that temperature because at that temperature (and standard atmospheric pressure), the density of water is at its maximum, and closest to 1 kg/l (but still less, with the difference showing at the 4th or 5th place after the decimal point IIRC). Both at heigher and lower temperatures, the density increases.
They could be useful to some group of people, just like k = 1042 can be useful to a group of people. To me, that's not enough to warrant the use of existing prefixes with a different meaning.
In science, when an existing unit is not very useful, people in the field often use different units. That's fine, since they don't use existing names for their new units. They invent their own, so one doesn't have to know each and every possible context to know that something you see might have a meaning different from what you think it is.
But why stop there? Let's travel that roat some further; from now on:
Kilometer = 1609 meter. Can be abbreviated to km. Not kilo meter = 1000 meter. Kilogram = 453.6 gram. Can be abbreviated to kg. Not kilo gram = 1000 gram. Kilojoule = 4186.8 joule. Can be abbreviated to kJ. Not kilo joule = 1000 joule. Kilowatt = 745.7 watt. Can be abbreviated to kW. Not kilo watt = 1000 watt.
I don't think computer science needs those foolish names and unit changes to ensure complexity in the units. It is not a commercial game.
Computer science started by changing the names (the meaning of the names, actually). In order to reduce complexity, we need to undo that change.
KISS is the rule.
Exactly. What is the simplest:
- k equals 1000, Ki equals 1024
or
- k equals 1000 in all sciences, except in computer science where it means 1024, most of the time. If followed by 'B' it mostly means 1024, when followed by 'b' it means 1024 when talking about memory sizes and 1000 when talking about transmission speeds. It all depends on the context.
In telecommunications, it is standard practice to use 10-based prefixes. 10Mbps means 10^6 bits per second, and 56 kb/s means 56000 bits per second. In serial communications, it is normal to use a startbit and a stopbit ber byte, so you use effectively 10 bits to transmit one byte.
BTW, I've seen 56kbps modems working at 44 and even 48 kbps. The speed you get depends on the quality of the phone line. Also remember that those modems work assymetrically: the 56 kbps is only downstream. Upstream is the same speed as a 33k modem.
In SI, the value of M, k, G etc. are not dependent on the unit it prefixes. True, 'byte' is not a standard SI unit, but consistency is still a Good Thing. And orthoganility too: it means the unit defines what you are talking about, and the prefix indicates how many of them you've got. It means that if you could fit 42 bytes per meter on a fictive tape, you can fit 42 kilobyte on a kilometer and not 41.015625 kilobyte per kilometer.
Is the SI prefixes are not useful for a speficif purpose, fine, don't use them. But don't take them and give them another meaning. If you want to use your own prefixes, go ahead and use new names for them.
Now, I agree kibi, mibi etc. sound pretty lame; perhaps someone should come up with better names, but we should stop using M when we don't mean 10^6.
Well-known and universally accepted? In all sciences and technological applications except for IT, MB (and kB, GB, TB,...) are accepted to mean 10^6 (and 10^3, 10^9, 10^12,...). Lots of scientists and engineers all over the world use them in that meaning, and they have been doing it before someone overloaded them for different use in computer contexts.
The thing is, the author claims it's fast enough, but I don't buy it. In any commercial setting, many customers will have machines with 1 Ghz and slower machines. Couple that with slower hard drives, larger images and other stuff running on the machine, and there's nothing left of your nice framerate.
Perl is way too slow
Is it? mod_php is faster than perl via CGI of course, but is mod_php faster than mod_perl too? Just curieus; I would think more websites would run php instead of perl if perl was indeed much slower than php.
What I mean is, for example, this section in the manual:
It's wrong, but it works, presumably because once upon a time it seemed like a good idea to convert unknown symbols to strings. To me, that's bad design. Frankly, I don't understand why there's a need to explain why $foo[bar] is wrong in the first place. It's as obvious as can be, unless you're an absolute beginner, in which case the language should help you to learn the basic concepts instead of trying to double-guess what you meant.
There are more things like this; small details perhaps, but they give me a bad feeling about the whole design. But, to each his own of course.
I Googled for it and it seems more proprietary than Perl or Python (didn't find a free download and docs).
Downloads are at http://www.php.net/downloads.php, docs at http://www.php.net/manual/en/.
I have read the criticism comments that PHP is in the Visual Basic category of encouraging weak minds to tackle strong tasks.
Today I read a comment somewhere (sadly I can't find it anymore) that compared PHP with MySQL: very forgiving for errors. If often fails silently, and potentially does something completely wrong without so much as a warning.
Personally, I don't like it partly because of that, and partly because I feel the language is very inconsistent. Everything feels extremely ad-hoc in some way. When I first learned PHP, I didn't feel that way; I even used it as a non-web scripting language for some simple system administration tasks. Some time later I started to learn Python, and the more I learned Python, the more I disliked PHP. In Python everything fits very neatly together, completely the opposite of PHP IMO.
Is this like Visual Basic in that it is cobbled together and lacks consistency and a uniform vision,
IMO, yes.
Is there some application domain where you really need to know this?
I don't think so.
Are there better substitutes?
I don't do any web programming anymore; as a language I prefer Python, but I have never used it for web programming. There exist differen solutions to use there tough.
Does it have interesting ideas of its own worth emulating?
Not that I can think of.
You can always use X remotely, over SSH or whatever. Then you only need the clients on the server machine.
I quote: "I install all my servers with out any kind of X environment because it pigs up too much space."
To me, that implies he would install X if it didn't take so much space.
- You don't need X on a server
- If you want X for some reason, don't install Gnome or KDE; use Fluxbox or some other light window manager. X itself doesn't have that large a foot print
Yes, but that's not the point: if you do that, the dialog box text doesn't change.
... switch to Firefox. I have also got several non-computing friends to use it.
Now *that* is an accomplishment!!
I thought so too, but now I'm not so sure anymore.
/. appears alongside the folder tree. Now Help|Info says Internet Explorer.
On Windows XP, I started Windows Explorer. The Help|Info dialog box (it's a Dutch Windows, I guess that's Help|About in English) says Windows Explorer. I typed http://slashdot.org. As expected,
The reverse is also true: start Internet Explorer, Help|Info says Internet Explorer. Type C:\ in the address bar and press enter, now Help|Info says Windows Explorer.
In contrast, when viewing a PDF, Help|Info still says Internet Explorer, not Acrobat Reader.
I can't speak for the term in general, but in Python it means variables can have different types on different times, while still being strongly typed.
a = 1
Now a is an integer (actually what happens is this: an integer object is created, with the value 1, and the name a is bound to it)
a == '1'
Returns False: objects with different types can not be equal.
a = '1'
A new object is created, containing the string '1'. a now binds to that new object.
a == '1'
True.
Somewhat more useful: file objects implement a number of methods. If you write a class that implements those methods (often a subset is enough), you can use it any place where you can use a file object. No need to derive from file class. Of course this doesn't work only for files, it can be used for anything.
But not the evil bit.
Ah, that's what those oxygen masks are for!
Maybe they really meant to say that Linus actually is... the *mother* of Linux!
It's not defined that way. The reason is also wrong: if you wanted to define the density of water this way, you would choose that temperature because at that temperature (and standard atmospheric pressure), the density of water is at its maximum, and closest to 1 kg/l (but still less, with the difference showing at the 4th or 5th place after the decimal point IIRC). Both at heigher and lower temperatures, the density increases.
They could be useful to some group of people, just like k = 1042 can be useful to a group of people. To me, that's not enough to warrant the use of existing prefixes with a different meaning.
In science, when an existing unit is not very useful, people in the field often use different units. That's fine, since they don't use existing names for their new units. They invent their own, so one doesn't have to know each and every possible context to know that something you see might have a meaning different from what you think it is.
Glad you noticed :)
OK, you convinced me.
But why stop there? Let's travel that roat some further; from now on:
Kilometer = 1609 meter. Can be abbreviated to km. Not kilo meter = 1000 meter.
Kilogram = 453.6 gram. Can be abbreviated to kg. Not kilo gram = 1000 gram.
Kilojoule = 4186.8 joule. Can be abbreviated to kJ. Not kilo joule = 1000 joule.
Kilowatt = 745.7 watt. Can be abbreviated to kW. Not kilo watt = 1000 watt.
Ok well, firstly you probably meant "asymmetrically", not "assymetrically"...and uh...no...your wrong.
You're right.
Dialup is NOT symmetric, but IS asymmetric.
Isn't that what I said?
I don't think computer science needs those foolish names and unit changes to ensure complexity in the units. It is not a commercial game.
Computer science started by changing the names (the meaning of the names, actually). In order to reduce complexity, we need to undo that change.
KISS is the rule.
Exactly.
What is the simplest:
- k equals 1000, Ki equals 1024
or
- k equals 1000 in all sciences, except in computer science where it means 1024, most of the time. If followed by 'B' it mostly means 1024, when followed by 'b' it means 1024 when talking about memory sizes and 1000 when talking about transmission speeds. It all depends on the context.
In telecommunications, it is standard practice to use 10-based prefixes. 10Mbps means 10^6 bits per second, and 56 kb/s means 56000 bits per second. In serial communications, it is normal to use a startbit and a stopbit ber byte, so you use effectively 10 bits to transmit one byte.
BTW, I've seen 56kbps modems working at 44 and even 48 kbps. The speed you get depends on the quality of the phone line. Also remember that those modems work assymetrically: the 56 kbps is only downstream. Upstream is the same speed as a 33k modem.
In SI, the value of M, k, G etc. are not dependent on the unit it prefixes. True, 'byte' is not a standard SI unit, but consistency is still a Good Thing. And orthoganility too: it means the unit defines what you are talking about, and the prefix indicates how many of them you've got. It means that if you could fit 42 bytes per meter on a fictive tape, you can fit 42 kilobyte on a kilometer and not 41.015625 kilobyte per kilometer.
Is the SI prefixes are not useful for a speficif purpose, fine, don't use them. But don't take them and give them another meaning. If you want to use your own prefixes, go ahead and use new names for them.
Now, I agree kibi, mibi etc. sound pretty lame; perhaps someone should come up with better names, but we should stop using M when we don't mean 10^6.
Well-known and universally accepted? In all sciences and technological applications except for IT, MB (and kB, GB, TB, ...) are accepted to mean 10^6 (and 10^3, 10^9, 10^12, ...). Lots of scientists and engineers all over the world use them in that meaning, and they have been doing it before someone overloaded them for different use in computer contexts.
Each user can install plugins to his own profile directory.
The thing is, the author claims it's fast enough, but I don't buy it. In any commercial setting, many customers will have machines with 1 Ghz and slower machines. Couple that with slower hard drives, larger images and other stuff running on the machine, and there's nothing left of your nice framerate.
Yes, I know, I just thought it was funny.