Most open source code (be it C or PHP) is absolutely terrible.
It's a bummer, too. I think it's fun and challenging to write something that not only works well, but is coded *perfectly*. Of course, perfect never happens, but it's a constant process of trying to get there.:)
Many of your complaints about PHP have been corrected in PHP5 -- you might be interested in checking it out.
Yep, I definitely have been eyeing it, however, by the time it is in widespread use, I hope dearly that I will not be doing PHP anymore. As mentioned, I would not even deal with PHP if it weren't for work. Kinda something I have to deal with right now, so I end up lashing out like this whenever I get a chance.:)
Not a big deal. Just constants or globals that are prefixed with the class name (seriously, it works fine in practice).
I think that's a good point. These things do *work*, and it's what the PHP standard library does (and PEAR AFAIK), but honestly, it just feels way too nasty for me. I think I just want PHP to be Python, and anything short of that won't be good enough for me.
Honestly, I *personally* don't even give a crap about PHP. It's just that I'm stuck with it at work, which is a real bummer.
Also inheritance and constructors is a bit ugly. That will be fixed in PHP5.
Ironically, neither of those have caused me any real trouble.:)
I actually like the way it converts strings and numbers. Just be sure not to test them as booleans and you won't run into too many problems. Since your data is usually coming from outside, you better have pages of disgusting checks to begin with!
But I'm talking about stuff coming from internally. Question: How do you check if a string contains an integer? is_numeric() only checks for float *or* int. is_int() actually checks the type. You have to do if(is_numeric($foo) && (int)$foo == (float)$foo). Maybe I missed something on that one. It all feels convoluted to me, but I guess that's personal preference. I like things being somewhat strict.
PEAR (pear.php.net) is a nice library for PHP. I enjoyed looking through the source code for inspiration. Sure, it's not Python (or Ruby, my fav) but it's readable and uses good practices for php.
I really need to get around to looking at PEAR. I looked through the docs, and nothing there seemed all that appealing to me, but I'm sure there has to be *something* I can gain from it.
Also, there is a site with patterns in PHP, google for it.
phppatterns.(net?), yes, I have seen it before, actually I have read a couple interesting things there. Probably the best PHP site around, it's actually something other than mysql+php or "how to make an image gallery", etc.
I used to hate PHP because of the lax security, but I think it has a lot of potential as a "lite" language that can handle big projects. My boss loves it because he understands it, I like it because of the objects.
I think it makes a good "lite" language too. Great for handling html and whatnot. It's just when you want to write the whole *application* in PHP, that I feel it falls short.
To write clean, well structured PHP, you really need to do some good design, use OOP, seperate content/formatting/logic/etc, and basically at that point, you're left with a half-ass OOP implementation, annoying pass by value, messy syntax, no exception handling, etc.
PHP was meant for making relatively minor webpage hacks, and it shows. This still remains PHP's strong point; building enterprise applications (that are designed well) does NOT.
Here's my list of bitches about PHP:
* No class attributes, only instance attributes
* No namespaces (and they were dropped from PHP 5). include()/require()'ing a file just dumps its namespace into the big happy global namespace, and it's a freaking nightmare.
* OOP sucks. You have to litter &'s everywhere to get references, and lots of other problems that I'll refrain from typing out. Ok here's one -- how do you pass an instance method for use as a callback? Something like array($object, "method_name_in_a_string"). Good god.
* No exception handling. Want to "handle" an error? Toss a @ in front of it, then you'll never see it. How helpful.
* Type handling is a nightmare, sure, they make it real easy for the newbies to use numbers-in-strings as numbers, but when you're not a newbie, you begin to run into issues where it's expecting you to be stupid and as a result ends up being stupid itself, and causing you to write disgusting checks just to make sure things are sane.
And that's the root of the whole issue, I think. Things that bend over backwards to cater to newbies end up doing a shitty job for people who have a clue.
Also, if anyone knows of any projects (with source available) written in PHP that are designed well, I would be interested to hear of them. I looked at a tiny bit of PHPMyAdmin's code just for kicks and was horrified. But that's not a valid judgement by any means. Again, I'm just interested to see if there are any out there (and have a look at them).
And a last thing, I might be biased by knowing Python (but I knew PHP first!). Python tends to flow very naturally for me, and even big complex things just end up being big and complex, instead of big and complex and A COMPLETE FREAKING NIGHTMARE like big things in PHP tend to wind up (for me).
And to get to the point where Linux is a true alternative to Windows on the desktop, you have to put a massive X server on top of the kernel, and put a massive window manager and desktop environment on top of that. In the end, "Linux" is not a simple thing (and arguably even the kernel is not simple, but the API is), because you are looking at the combination of X+Qt+KDE, and that pretty much throws all philosophy out the Window. (Yes, I know you can use Blackbox or something else instead, but then don't go arguing that it's a suitable replacement for Windows.)
Huh? Make up your mind! If you want it Unix-like, then USE "Blackbox or something else." If you want it Windows-like, use KDE. How are you supposed to have something that can be an alternative to Windows (which would require it to be at least somewhat similar), while at the same time, staying Unix-like? There are plenty of window managers that I would say are fairly in line with the Unix philosophy.
I'm not sure that Python goes against the Unix Philosophy, either. It's perfectly fine, and not at all difficult, to pipe together shell commands in Python. You can also use Python to create said shell commands; nothing is forcing you to use Python to write another Bit Torrent or pyslsk or whatever. It's also worthy to mention that some tasks are just beyond the reasonable limits of shell scripting. So, assuming that your little program is too big for a (sane) shell script (or scripts), you should then write it in C? Why? You could write it faster, and easier, in Python (assuming your C skills aren't disproportionately better than your Python skills).
I installed gvim on windows lately, and in the installer, there was some option for something to do with visual studio. Perhaps you should check into that.
And really, size doesn't seem like so much of a problem. All of the media files are architecture- and OS-independent, so just libraries and program files would need to be duplicated. Not sure how much disk space those take up though (seems like it wouldn't be much, in comparison).
A window manager draws borders on your windows and possibly a menu and a dock and possibly some other small things -- it has absolutely nothing to do with the text size or widgets used in your applications.
How the fuck did something like this make it to the front page of slashdot? Oh wait..
Problem is, computer expertise is not a matter of intelligence, but rather a matter of practice. My mom can barely navigate through sending an email through yahoo mail, is it because she's an idiot? No, it's because she never uses a computer. Those ads are targeted towards people like her, who don't know better. Of course you and I know better.
But hey, who cares about making sense, you made your funny little post and you'll get your +1 Funny mods, that's all that matters!
It basically just depends on how much money you make. If you make $50/hr, then yes, perhaps buying cds is more efficient time/money-wise. In an hour, I could get probably 5 cds worth of music. Let's be generous and say that those cd's would have cost $8/each. 40 bucks worth of music in one hour. So if I'm making less than $40/hour, it is more economical for me to download music. Not that this "measurement" is supposed to be accurate in any way, I'm just trying to get the point across that not everyone makes a shitload of money, and for those that don't, downloading mp3s makes sense.
There's also a bunch of other factors:
- You can leave $mp3_stealing_app running forever after selecting a bunch of files, and you can let the music pour in while you're not even paying attention. - You have to spend time sorting the mp3s out. - You would have to spend time burning them if you wanted to listen to them in your cd player. - If you buy cds, you would have to spend time ripping them and encoding them if you wanted mp3s. - You can buy cds online and spend almost no time doing so, or you can drive to the store which takes who knows how long....so it's not exactly a cut and dry issue.
It's a bummer, too. I think it's fun and challenging to write something that not only works well, but is coded *perfectly*. Of course, perfect never happens, but it's a constant process of trying to get there. :)
Many of your complaints about PHP have been corrected in PHP5 -- you might be interested in checking it out.
Yep, I definitely have been eyeing it, however, by the time it is in widespread use, I hope dearly that I will not be doing PHP anymore. As mentioned, I would not even deal with PHP if it weren't for work. Kinda something I have to deal with right now, so I end up lashing out like this whenever I get a chance. :)
Not a big deal. Just constants or globals that are prefixed with the class name (seriously, it works fine in practice).
I think that's a good point. These things do *work*, and it's what the PHP standard library does (and PEAR AFAIK), but honestly, it just feels way too nasty for me. I think I just want PHP to be Python, and anything short of that won't be good enough for me. Honestly, I *personally* don't even give a crap about PHP. It's just that I'm stuck with it at work, which is a real bummer. Also inheritance and constructors is a bit ugly. That will be fixed in PHP5.
Ironically, neither of those have caused me any real trouble. :)
I actually like the way it converts strings and numbers. Just be sure not to test them as booleans and you won't run into too many problems. Since your data is usually coming from outside, you better have pages of disgusting checks to begin with!
But I'm talking about stuff coming from internally. Question: How do you check if a string contains an integer? is_numeric() only checks for float *or* int. is_int() actually checks the type. You have to do if(is_numeric($foo) && (int)$foo == (float)$foo). Maybe I missed something on that one. It all feels convoluted to me, but I guess that's personal preference. I like things being somewhat strict.
PEAR (pear.php.net) is a nice library for PHP. I enjoyed looking through the source code for inspiration. Sure, it's not Python (or Ruby, my fav) but it's readable and uses good practices for php.
I really need to get around to looking at PEAR. I looked through the docs, and nothing there seemed all that appealing to me, but I'm sure there has to be *something* I can gain from it.
Also, there is a site with patterns in PHP, google for it.
phppatterns.(net?), yes, I have seen it before, actually I have read a couple interesting things there. Probably the best PHP site around, it's actually something other than mysql+php or "how to make an image gallery", etc.
I used to hate PHP because of the lax security, but I think it has a lot of potential as a "lite" language that can handle big projects. My boss loves it because he understands it, I like it because of the objects.
I think it makes a good "lite" language too. Great for handling html and whatnot. It's just when you want to write the whole *application* in PHP, that I feel it falls short.
Yeah..
To write clean, well structured PHP, you really need to do some good design, use OOP, seperate content/formatting/logic/etc, and basically at that point, you're left with a half-ass OOP implementation, annoying pass by value, messy syntax, no exception handling, etc.
PHP was meant for making relatively minor webpage hacks, and it shows. This still remains PHP's strong point; building enterprise applications (that are designed well) does NOT.
Here's my list of bitches about PHP:
* No class attributes, only instance attributes
* No namespaces (and they were dropped from PHP 5). include()/require()'ing a file just dumps its namespace into the big happy global namespace, and it's a freaking nightmare.
* OOP sucks. You have to litter &'s everywhere to get references, and lots of other problems that I'll refrain from typing out. Ok here's one -- how do you pass an instance method for use as a callback? Something like array($object, "method_name_in_a_string"). Good god.
* No exception handling. Want to "handle" an error? Toss a @ in front of it, then you'll never see it. How helpful.
* Type handling is a nightmare, sure, they make it real easy for the newbies to use numbers-in-strings as numbers, but when you're not a newbie, you begin to run into issues where it's expecting you to be stupid and as a result ends up being stupid itself, and causing you to write disgusting checks just to make sure things are sane.
And that's the root of the whole issue, I think. Things that bend over backwards to cater to newbies end up doing a shitty job for people who have a clue.
Also, if anyone knows of any projects (with source available) written in PHP that are designed well, I would be interested to hear of them. I looked at a tiny bit of PHPMyAdmin's code just for kicks and was horrified. But that's not a valid judgement by any means. Again, I'm just interested to see if there are any out there (and have a look at them).
And a last thing, I might be biased by knowing Python (but I knew PHP first!). Python tends to flow very naturally for me, and even big complex things just end up being big and complex, instead of big and complex and A COMPLETE FREAKING NIGHTMARE like big things in PHP tend to wind up (for me).
Go Python! Death to PHP!
Replying to myself..
Ok, I fed it a screenful of IRC, and I got a 90 (99.973 on creativity, hah).
Ok, it says 70 is an average?
I just fed it a big long chunk of comments from some source code, with line numbers and all, and I got a 67.
Am I missing something here?
Two ethernet ports + linux + easily hackable = who cares about the modem jack?
Sure about that?
Erm, new? Fluxbox has been around for a long time now.
:)
On a side note, they're using my theme in that screenshot
Huh? Make up your mind! If you want it Unix-like, then USE "Blackbox or something else." If you want it Windows-like, use KDE. How are you supposed to have something that can be an alternative to Windows (which would require it to be at least somewhat similar), while at the same time, staying Unix-like? There are plenty of window managers that I would say are fairly in line with the Unix philosophy.
I'm not sure that Python goes against the Unix Philosophy, either. It's perfectly fine, and not at all difficult, to pipe together shell commands in Python. You can also use Python to create said shell commands; nothing is forcing you to use Python to write another Bit Torrent or pyslsk or whatever. It's also worthy to mention that some tasks are just beyond the reasonable limits of shell scripting. So, assuming that your little program is too big for a (sane) shell script (or scripts), you should then write it in C? Why? You could write it faster, and easier, in Python (assuming your C skills aren't disproportionately better than your Python skills).
You're a MADMAN!
I installed gvim on windows lately, and in the installer, there was some option for something to do with visual studio. Perhaps you should check into that.
Booleans were added sometime in 2.2... 2.2.2 I believe. But yes, very handy. :)
Wait a second... that gentoo comment was a JOKE! HAHA! I GET IT!!
I honestly doubt it's gonna have any noticeable effect on portage. Or maybe it will. Python 2.3 now has a great logging package built in :)
Is it REALLY that hard to just walk around and look at peoples' glasses?
Yes, ideally, someday, we can all just lay around half conscious, being tended to by robots. It'll be great, because robots are NEAT!
I think it's good to be a bit of a luddite.
And really, size doesn't seem like so much of a problem. All of the media files are architecture- and OS-independent, so just libraries and program files would need to be duplicated. Not sure how much disk space those take up though (seems like it wouldn't be much, in comparison).
A window manager draws borders on your windows and possibly a menu and a dock and possibly some other small things -- it has absolutely nothing to do with the text size or widgets used in your applications.
How the fuck did something like this make it to the front page of slashdot? Oh wait..
Exaaaaaaaactly.
Why is it that EVERY person that points out a spelling or grammar mistake makes one themself?
Problem is, computer expertise is not a matter of intelligence, but rather a matter of practice. My mom can barely navigate through sending an email through yahoo mail, is it because she's an idiot? No, it's because she never uses a computer. Those ads are targeted towards people like her, who don't know better. Of course you and I know better.
But hey, who cares about making sense, you made your funny little post and you'll get your +1 Funny mods, that's all that matters!
But they don't "take" the code, they just copy it. They sell copies for $100. Who cares? The original work has not magically disappeared.
It basically just depends on how much money you make. If you make $50/hr, then yes, perhaps buying cds is more efficient time/money-wise. In an hour, I could get probably 5 cds worth of music. Let's be generous and say that those cd's would have cost $8/each. 40 bucks worth of music in one hour. So if I'm making less than $40/hour, it is more economical for me to download music. Not that this "measurement" is supposed to be accurate in any way, I'm just trying to get the point across that not everyone makes a shitload of money, and for those that don't, downloading mp3s makes sense.
...so it's not exactly a cut and dry issue.
There's also a bunch of other factors:
- You can leave $mp3_stealing_app running forever after selecting a bunch of files, and you can let the music pour in while you're not even paying attention.
- You have to spend time sorting the mp3s out.
- You would have to spend time burning them if you wanted to listen to them in your cd player.
- If you buy cds, you would have to spend time ripping them and encoding them if you wanted mp3s.
- You can buy cds online and spend almost no time doing so, or you can drive to the store which takes who knows how long.
But I'm glad you have better things to do.
Get a different ISP, I suppose.
What a buzzkill.
You are today's lucky winner of the slashdot post predictability sweepstakes for your outstanding job of:
[ ] Preaching about Gentoo
[ ] Preaching about Debian
[ ] Overuse of buzzwords to conceal ignorance
[x] Bashing Microsoft
Your prize awaits you on the other side of the mountain dew can mountain in your basement.
Thanks for playing!