I find it surprising that no one has mentioned, what I consider to be, the best source of information and help with the PHP language out there.
The ##php IRC channel on freenode (1) is an absolutely incredible resource. I've idled in there for many years now and the amount of good, relevant, and accurate information that can be obtained in there is incredible. Whether you have been programming for 5 days or 5 years, simply hanging out in the channel for a couple of days can offer insights and tricks that you may have never known about.
Over time, the folks there have compiled an absolutely excellent Wiki (2) for developers; old and new. In addition, there is a wonderful list of general do's and don'ts for PHP application development. (3)
Time and time again, we get folks in there who are using outdated technologies (hello mysql_* functions) or just awful tutorials or resources and they get turned around in no time.
Disclaimer: as the author states, there are many self-described experts in PHP and they do, occasionally offer bad advice. However, it is rare for the bad advice to go unchecked in this IRC channel so I can still recommend it without worry.
This may be deeply stupid, but I'm new to IRC, and I'm getting a message on Freenode saying "Cannot join #php (Channel is invite only)". Am I missing something? Or is it possible to just watch the discussion without participating and that doesn't require an invite?
Freenode uses ##<channel> to refer to "non-primary" channels. Regardless of what that means (I don't really know), the channel you're looking for is ##php.
>It attracts people too stupid to realize that their own level of knowledge should make them avoid teaching others.
There are many very, very smart people that try to teach others as a form of their own expression and learning. People coming from other programming languages that are extremely talented in that language, often take on this role as they are confident in their abilities. That doesn't make them stupid, nor should it disqualify them from attempting to teach or help others.
> As soon as someone points out an issue they almost immediately switch to "LALALALALA I CAN'T HEAR YOU!!!".
I don't think that's a fair assessment at all. In my experience dealing with precisely that situation, I find that most are actually very willing to accept and admit to their fault. Even in the chat room, over the many years I've been there, there are far more people willing to accept their incorrectness over people who take offense.
> People coming from other programming languages that are extremely talented in that language
PHP wouldn't be this worse if this was what would actually be happening, because these people would assess the situation and take away the control from the PHP team, due to its inability to do its job.
More realistically, people see PHP and run away screaming. The only people using PHP are those unable to see how unbelievably bad the language and its libraries are designed and implemented.
> I find that most are actually very willing to accept and admit to their fault.
- So why is the standard library in such a bad shape?
- Why is the documentation in such a bad shape?
- Why aren't there any established processes in place to prevent repeating mistakes (see above)?
- Why are large parts of the implementation barely maintainable?
- Why is the ecosystem still in such a bad shape?
- Why is the core team spreading bad practices instead of good practices?
- Why is the language so unbelievable slow?
- Why is the runtime and the garbage collector of such bad quality that it is completely impossible to run sufficiently complex applications over a larger period of time?
soc88, dude, can you stop with your personal anti-PHP agenda. You are bringing NOTHING to the table.
> - Why is the documentation in such a bad shape?
The documentation is up-to-date AND in good shape.
> - Why aren't there any established processes in place to prevent repeating mistakes (see above)?
What kind of processes? The documentation clearly lays out pitfalls and problems to watch out for.
> - Why are large parts of the implementation barely maintainable?
What parts?
> - Why is the ecosystem still in such a bad shape?
What part of the ecosystem? It seems fine to me.
> - Why is the core team spreading bad practices instead of good practices?
Seriously, give me some examples of these bad practices, please.
> - Why is the language so unbelievable slow?
In comparison to what? For the class it is in, it is very fast.
> - Why is the runtime and the garbage collector of such bad quality that it is completely impossible to run sufficiently complex applications over a larger period of time?
Erm, I've run long running processes for years. There was once a problem with circular references but this has long since been resolved.
Also, you showed your lack of understanding of PHP in a previous response (http://news.ycombinator.com/item?id=4198984) to mine where you where unable to distinguish between the Apache and Cli PHP SAPIs.
In comparison to what? For the class it is in, it is very fast.
PHP is what I would an intertwined language as quite often people don't separate PHP the language, PHP the included battery (aka the standard library), PHP the easy deployed script and PHP the web tool at core.
It's both a curse and a blessing IMHO. It easy to ignore the differences but hard to learn about them later and the official doc not really teach about it doesn't help. I am not say the doc is bad, just trading off clearly for easiness. It probably helped PHP grow so popular.
As for the quote, PHP the language _is_ slow but the mitigated by a fast standard library (mainly C function wrappers). That said, PHP 5.4 is faster than ever.
> - Why are large parts of the implementation barely maintainable?
What parts?
------------
Possibly the part that essentially required \ as a namespace separator. This was because ZE2 simply couldn't be coaxed to deal with a different separator, and no one has yet spearheaded a ZE3 to take the lessons learned over the last decade and revamp the internals to allow for more modularized growth/modifications.
Most other languages have had underlying VM changes which allow for better language enhancements. Every PHP language change in the last 12 years has had to work within the confines of the existing VM, and I've not seen any substantial changes to it in 12 years.
It may be splitting hairs, but I don't see anyone able to step up and address the mods necessary to ZE2 to support any new features, ever. We're basically stuck with ZE2, and we (as a community) make the best of it. ZE isn't 'maintained' actively, it just exists, and I haven't heard of any plans for an overhaul or new version. Compare that progress to the JVM and .NET CLR over the last 12 years.
Uh, I haven't seen PHP-ers go to conventions with pornographic slide decks, unlike some users of some more fashionable language.
There are some real problems in the PHP community, like the terrible mismatch between the PHP core and PEAR developers, and the fact that nobody's got the guts to declare PEAR a failure, put it down, and start something new. However, other than that, the people I know involved with PHP are reasonable people.
For me the trouble w/ PHP is that it works too well.
I've got a small project w/ 40 hours budgeted for it, 20 of those are software dev, and 20 are corporate identity and marketing.
I have libraries that smooth over the worst flaws of PHP and answers to error handling, sysadmin, and all that. I know the odds are very good I can slap this thing onto one of my production servers, push the 'go' button, and have it work for 2 or 3 years before I need to look at it again.
Ruby may be nicer, and Java is better for computationally complex and intensive stuff (not this) but adding a new language to the mix probably means more hosting costs (maybe abother $60-120 a month) and probably turns that 20 hours to 60. It will take me a long time to have faith in the stability of another hosting system too.
The reality is I nail out quite a few of these mini projects, some of which succeed, and many of which just smoulder. With PHP I can get them done quick and done well and have low hosting costs and little maintenance burden.
To get me to switch you need to quit complaining about the faults of PHP and build my faith that your hosting system is a 'wooden round' that won't cause my 20-hour project to cost me 50+ hours a year in maintenance costs.
I don't know if that's a fair comparison since you have a lot of experience in PHP and it sounds like, less in Ruby. It would be more fair to compare your productivity and costs in PHP against a seasoned Ruby developer.
Some of the experienced PHP developers have recently started a PHP mentoring program with the aim of helping beginners and intermediate PHP developers. Info: http://phpmentoring.org/
They have known and been doing things about bad Perl advice for a lot longer than a year. There have been idiots who have made reputations based on some of the worst possible code you can imagine and it has taken a lot of time to convince newcomers that they should read and ask questions else where. The good news is that the communities like PerlMonks do an excellent job of good advice (occasionally with really good flame wars :) ), the trouble being that it may take a little bit of luck for the beginner to stumble across the resource.
There, a perfect opportunity for language designers to shine. Nothing fancy, just fork and fix. No need to come up with new paradigms. Nothing to make you sweat. Just fork the damn thing and fix the warts with a scalpel.
It is and will be the most used language for web development. If that is not a shiny medal in your chest and a place in history books, I don't know what is.
Drop the dollar
Use + for str concat
Use . for class members
Use . for dicts
Use . for namespaces
Use : for key:value pairs
Fix needles and haystacks
Use camelCase for functions
Use arrays and dicts literals
Use list genereators
Use request and response objects
Objectify strings, lists and dicts
While most of it is syntactic sugar, this will solve 90% of the problems for 90% of the people.
That's the thing. Once you have "fixed" PHP, you're left with a brand new language that few people know, won't run your existing code, isn't included in Linux distributions or hosting packages, have no books about it and no answers on StackOverflow.
Of course these things will all happen in time if the fixed version takes hold. But if you're willing to throw out PHP and start anew, you can have all of the above right now by learning Node, Rails, Django, etc.
I think the comment above about needing a Jeremy Ashkenas (that is, a CoffeeScript for PHP) is the only realistic way for a "fixed" PHP to succeed. There needs to be a smooth transition, and a FixedPHP-to-PHP5 compiler could provide it.
Seriously, if the first forked revision simply normalized the parameter order of core functions, and standardized on verb_noun() (or noun_verb(), I don't care) function naming, I'd be happy. Yes, it's a cosmetic failing only, but it would go a long way to making the whole language seem coherent.
People telling you to do the wrong thing is undoubtedly a large problem. For example, one of the things I don't like about the CakePHP framework is the advice you find when searching for seemingly simple questions, like how to use the database's current timestamp with Cake's ORM.
You typically see one of two responses - either call one of your columns "modified" or "created" and hack it in like that. Or, use PHP's built-in date() function, ignoring the issues that brings (e.g. the current timezone could be anything - not always what the database is operating under).
This is an ongoing problem, and is likely related to PHP's ease-of-use; for new users, it's easy to get a sense that you know more than you think you do, and give advice accordingly.
The bigger problem is that it keeps building upon itself. People who don't know better, taking advice at face value, then giving that advice increases the number of people writing crap code. Try searching for password storing advice, and you'll see masses of varients of md5('salty_' . $password);
A couple ways to do that date thing in CakePHP (ymmv and of course you may not like the options):
- Use the db schema to enforce a value: "ON INSERT/UPDATE CURRENT_TIMESTAMP". Note that doing so will not allow you to simply set an arbitrary column to the current timestamp
- Use the php `date()` function. Your server time should be UTC, your app time should be UTC, your datastore time should be UTC. Doing anything else is poor practice. And if you can't do this because your Sysadmin is stupid, fire him and get a new one. This is how the created/modified fields work.
- Use created/modified fields. These obviously won't work if you want some random field to be the current time that isn't actually the created/modified field, but I cannot for the life of me think of such a use-case.
- Use "DboSource::expression('NOW()');" as the value of the column. A little more verbose than just doing "NOW()", but at least it won't be interpreted as a string when saved by the "ORM".
I think the biggest problem with PHP is developers not truly understanding the API they are using, and then writing spaghetti code that happens to work. Ease-of-use backfires, since your code actually works and you have no intention of learning to improve it.
Also, I recommend doing "md5($salt) . $password" to hash passwords. Set $salt to 4, I guarantee that is a random number. ;)
Use the php `date()` function. Your server time should be UTC, your app time should be UTC
I think that this is advice that should never be given; it's too easy for someone else to change the timezone PHP uses somewhere else in the code. I agree that the servers should all be on UTC - and sync'd at that! - but it's unrealistic to hope that this will be the case in all instances; I've seen all kinds of weirdness from clients' codebases after taking their first steps off shared hosting / "my first VPS."
Use "DboSource::expression('NOW()');"
Basically, the only realistic option - and last time I searched (I admit, a while ago) really buried away ;)
I think the biggest problem with PHP is developers not truly understanding the API they are using, and then writing spaghetti code that happens to work.
Agree 100% with you. From some of the client code I've repaired, I've also stumbled over PHP developers apparently not understanding the very basics of programming, and crossing their fingers when it comes to running it ;)
> either call one of your columns "modified" or "created" and hack it in like that.
Hack it in like that? CakePHP is convention over configuration, and the framework manages "modified" and "created" for you which is pretty nice. Not something I expected somebody to complain about, but perhaps I'm misunderstanding the issue.
The TRUE problem with PHP is that you can prototype extremely fast in it, and then you are stuck in PHP. Django and the like have a lot of setup time to really get started, even if after a few hours into it you're already saving time compared to PHP.
I've found it hard to argue against PHP with my former bosses, due to this fact.
Alas, the rapid prototyping is a trap I fall into all the time. Spinning up an ol' Symfony 1.4 application to mock-up a REST API so I have something to build a Backbone.js app against is the practice that keeps leaving me tethered to PHP.
If there were something that would allow me to spin up local application and work with my existing, already running Apache processes, I could move away from PHP.
Then I just invoke it with "shotgun rest.rb" and hit http://localhost:9393/ and I'm up and running. It's not running through Apache, but it's not really significantly more difficult than PHP prototyping.
I can set up a new Django environment in virtualenv, using Pip in about 15 minutes (using sqlite) without using a 'skeleton' template. Having not touched PHP in years, it would almost certainly take me longer to get PHP up and running with Nginx/Apache.
With Django 1.4's templates, you get more speed boost on setting up each app. With 'manage.py runserver', you don't even have to mess with Apache/Nginx to get running.
Regardless, comparing "PHP" to Django isn't particularly fair, even though I would argue that it isn't as one-sided as you make out. You can get started in Flask in slightly more than the time it takes to type 'pip install flask'.
If you're baselining PHP to Python, then know that Python has a much greater penetration on Unix servers, though arguably 'web hosting providers' are also very likely to have PHP installed (if it isn't dedicated).
Since you brought up Django, how long does it take to get started with CodeIgniter or Symfony (a better comparison to Django)?
If you're a real newbie, terms like "virtualenv" and "Pip" are much harder to wrap your brain around than "unzip this ZIP file into your web root", which is the way you set up, say, CodeIgniter.
If you're a real newbie, then perhaps PHP is the better choice -- not because of complexity, but because of the lack of proper rigidity enforced in getting started.
Though I will say that I read 'getting started' as the cost of getting started on a new project, not 'your very first' project. In that regard, sure, PHP is easier. It gets that way by encouraging programming idioms that most other languages actively discourage.
I understand the argument for would-be developers to get started with PHP. That's not too far off from how I got my introduction into web programming, but I have a hard time believing that developing developers choose PHP over Python or Ruby because it's easier to install.
I actually am a full-time Django developer (pip and virtualenv included), and I hate PHP.
But if, say, I want to try out a new JS library or widget, I'm pretty likely to just throw a PHP script in my webroot and use that, instead of firing up a full-blown Django project.
The time from deciding to write some HTML or JavaScript or whatever to actually writing it in a PHP script? Basically nothing.
I'm not trying to be snarky, but I feel like I'm missing something. How would creating an 'index.php' be any faster than an 'index.py' with Flask or just using Python directly?
Again, comparing it to Django isn't exactly fair. I wouldn't see many people standing up a full CodeIgniter setup for that either.
It's one problem and those are two more, but I would argue these problems look minor compared to the obstacles standing in front of some other languages.
It seems the HN community tends to over-value language design and under-value low barriers to adoption.
If I'm picking a language for a new project, I don't care about barriers to adoption, as long as they're low enough that I and anyone else I'm trying to work with can get through them. I do care about the language having at least something vaguely resembling reasonable behavior.
Why would I optimize for barriers to adoption? I don't need my language of choice to be popular to get away with using it, especially if I'm building one of those Web thingers everyone likes to make these days.
What I do need is a language I can be productive in. All else being equal, the less a language surprises me with inconsistent or outright broken behavior, the more productive I can be with it.
"Robert and I both knew Lisp well, and we couldn't see any reason not to trust our instincts and go with Lisp. We knew that everyone else was writing their software in C++ or Perl. But we also knew that that didn't mean anything. If you chose technology that way, you'd be running Windows. When you choose technology, you have to ignore what other people are doing, and consider only what will work the best."
So, yes: I can't speak for everyone, but I would rather use a well designed language with poor adoption than a poorly designed language that's been widely adopted.
Wow, I had no idea w3schools was so inaccurate. I turn to it all the time for a quick reference. I suppose I'd be classified as one of the lunatic fringe if I was actually writing tutorials. http://w3fools.com/
While stupid people keep using blinking tags and lolcats, and while astronauts keep thinking about concurrency and monads, php will grow stronger than ever.
Astronauts need to come down to earth and help stupid people build better blinking tags for their lolcats, not push them to write lolcats in monads with concurrency.
So, whether astronauts like it or not, a simpler un-evented node.js would sell like hotcakes (because it is js, not because it is evented), while a cleaner, facelifted php will sell even more.
Fork php, use + for string concatenating, . for class members, fix haystacks and needles, add [1,2,3] and {a:1,b:2} as simple data structs, that's all lolcats need.
Learn to serve your customers, even if they are stupid.
It's not very nice to refer to people as being stupid for wanting to use PHP, or likewise for those who code in PHP themselves.
My Erlang isn't bad, but it would be madness for me to suggest it to a client. What happens if I get run over by a bus tomorrow, or we need to bring extra coders on board?
Erlang, for all its many, many favours, is just not appropriate for the average-client-on-the-street.
I realise that you didn't use Erlang as an example, but there's a reason why there's so much work for competent PHP programmers, and it's not stupidity.
Most of the fs calls have sync equivalents, but you only want to use them at application startup.
IO is slow, Node is evented IO, the requests come in and the requests (to the database) go out, the data comes in and the result is rendered to the client. Node deals with requests.
But let's say it was made to work like you request, and the docs were changed to reflect that. People learn they could throw some code in a file and call it node.js. (I've done that, using a fastcgi server implementation and adding a hander for it on a bluehost account.)
So now you have PHP but with Javascript as it's syntax, your developers build applications the way they do in PHP, you call Node slow and a thread like this launches on HN saying how bad the language is and how somebody should fix that.
I've never heard of people complaining of PHP being slow. They don't care, they just want to glue some HTML, CSS and JS together and run it on the browser easily.
So yes, simplify JS on the server to act like PHP and use node for servers and other stuff. Name it differently if you want so they don't call node slow. V8CGI is the closest to a deliciously simple JS implementation on the server I've seen. Take a look at it for some ideas.
This is definitely a problem, and not just for PHP. Check out this section from a C++ tutorial: http://www.functionx.com/cpp/examples/returnpointer.htm. The author is very clearly confused by even the basic rules of C++, yet he's out there trying to teach others. It's the blind leading the blind.
(Incidentally, I found it again by Googling for "worst C++ tutorial"—for me, it was the first match.)
So yes, someone, please do throw some good advice out there to help drown out the bad!
I'm getting tired of these posts, but he brings up a good point.
You only have to browse code on phpclasses.org (the most popular PHP code contribution site I think?) to see that there is something very very wrong with how PHP code is developed.
Also the comments left in the PHP documentation don't seem to be moderated on code quality and a lot of bad practice has slipped in.
You only have to browse code on phpclasses.org (the most popular PHP code site I think?) to see that there is something very very wrong with how PHP code is developed.
To be fair, there are plenty of junk code sites out there. I'm amazed that http://www.codeproject.com still appears to be going strong.
> the most popular PHP code contribution site I think?
Popular in that everyone knows its name and knows not to ever use it. It's an absolutely awful site that's been awful for an entire decade. Most of the code being uploaded there these days is from indian and brazilian developers.
All the good PHP libraries are on github and shared socially.
That just means that there are bad programmers outside, not necessarily bad languages. Nevertheless, I don't know a single perfect programming language anyway, so you can write tons of article titled "what's wrong with xxx". But, apart driving a lot of readers to your blog, these posts do not help at all.
I think I've been miss understood. My point wasn't that PHP is a bad language, I'm a hardened PHP dev and have been fighting it's corner here on HN for months.
It really doesn't help PHP that a site as popular as phpclasses has such a large degree of inferior code.
If everyone spent as much time promoting alternative languages, as they did bashing PHP, then Python would have been the most popular language 3 years ago!
>But on the fringes, there are a lot of people who are writing articles, tutorials, and posts designed to help beginners learn the language (and usually how to program). The problem with this is that the majority of those authors frankly don't have a clue what they are talking about
Argue all you want, but all this PHP bashing isn't solving anything, it's just dividing the coding community.
I'm going to get back to work and continue coding in my chosen tool, PHP, see you all at the finish line because whatever your tool, we'll all get there in the end.
Was just commenting on how I'm currently using it, feel free to replace work with anything you like. I guess like you, I'm baffled too, as comments like "Work isn't everything" baffle me as it's based entirely on assumption and failure to see beyond your scope of understanding.
Whilst I agree critical analysis is great, general discussion can be somewhat impressionable on newcomers. Whether you realize it or not, PHP bashing / over praising will been seen by newcomers and they won't know where the foundation lies.
Why must we push ideas and concepts onto people, why can't we give our points and let people make up their own mind. Personally I don't want to drift through life with people telling me what to use or what not to use, I'd prefer to see the points and make up my own mind without being preached to.
Like those who can't program a sane line of code in the language PHP is written in? "OMG, this calculation overflows, let's replace the int by an float!"
You can't make that shit up. I have nothing against stupid people, but against stupid people who fight against every kind of process who could prevent their own stupidity like
- "learning from mistakes",
- "learning the language they actually program in",
- "handling bug reports in a way it doesn't alienate reporters" or
- "having a decent test coverage".
Instead of thinking about yet-another-documentation site, what about fixing the devastating quality of their API documentation (especially the comments)?
The PHP team is bad, and has very little to do with the PHP community - Anthony (I think his name is Anthony) is talking about Fabien Potencier and John Wage and Sebastian Bergmann - people who are writing great software in spite of PHP's interpreter.
The question is why they don't move on to a working language, knowing that the PHP team will _never_ fix all these bugs. It is like those people who keep penny-stocks they bought years ago for a lot of money, trying not to realize that their investment is worthless now.
I think it comes down to the fact that PHP does a lot of things right, and its still more efficient all around than most other tools for the problems most people need to solve in the real world.
You can point out all the flaws, but that's like pointing out the flaws in McDonald's. Sure it's cheap food, but it's consistently cheap and there's a much larger market for cheap food than gourmet food.
Perhaps "other language" developers should start thinking of themselves as gourmet chefs. And like gourmet chefs, not many people can afford their products in the real world.
The McDonald's analogy is pretty good since you can also go to any other fast food joint or even cook for yourself more cheaply and nutritiously than you eat McDonald's.
People have sentimental feelings about McDonald's, prefer the style of fries, etc. - it isn't that McDonald's products are incomparable or irreplaceable and that the only alternative is expensive, difficult "gourmet" food.
>and its still more efficient all around than most other tools for the problems most people need to solve in the real world.
How exactly? I always see vague assertions that PHP is somehow better for "stuff I do in the real world", but nothing concrete. Guess what, the rest of the world is real too. I am not writing haskell code for my imaginary friend, I am writing it for real users to use in the real world, and a real business relies on it to provide real people with real incomes to feed their real families. How exactly would PHP be "more efficient all around"?
When I say efficiency, I mean in the economic sense. That the ratio of input it takes to develop some things in PHP is lower than it would be for other languages.
When I say exactly, I mean a precise, concrete example. I've used PHP for over a decade. I have yet to encounter a case where using it was optimal, only cases where using it was required by customer demands. That is why I am asking for a real example of something that is easier in PHP, instead of a vague "some stuff".
The problem with English is that most of the people speaking it, writing it, or teaching it - collectively what I shall call the 'fringe' - could not so much as pen a tolerable introduction to a Penguin Classics paperback.
This is 2012, people. Programming isn't just a profession, it's an everyday skill that everyone should learn, regardless of how badly. PHP is a great enabler for this - and I endorse this direction completely.
But you teach them to write using well-written prose. You don't grab random comments off the internet and use that as a foundation for writing education.
The problem is programming is still hard, even in 2012. PHP makes it look easy enough on the surface, but people skip learning all the other stuff you have to know to be a competent programmer. They're often completely unaware that they need to learn anything else, or completely uninterested in doing so—they think they're experts already because they can string some lines of PHP together to make a Web site that mostly seems to work, as long as no one's trying to break it.
Then they go on to teach others—other who, just starting out themselves, have no idea they're learning from someone who knows barely any more than they do. Or, they go on and get jobs doing this, and their very amateur code end up out in the wild.
I hate this effect because I'm definitely a fan of anyone who wants to being able to experiment with programming. I got my own start screwing around with code on my family's computers, probably like a lot of us here. Thankfully, I started so young that it was more than a decade before I got a job writing code. I even learned a thing or two in that time!
Of course, I also started with BASIC, then jumped to assembly for two different CPUs before moving onto C and a handful of other languages. Enough curiosity and dedication can get you through less newbie-friendly languages.
Maybe requiring that curiosity and dedication as a barrier to entry is a good thing. I think both are absolutely required, even in 2012, to become even a competent programmer.
Not everyone who programs wants to be a competent programmer, or even a programmer at all. Some people just want to build a contact form for their website, or work out how to pull a list from a database and display it in the sidebar of the their blog.
PHP lets them do that without having to learn anything more complex. Why spend days or weeks learning something when you can work out how to do what you need to do in hours?
If we're going to have amateurs doing things like this, we should at least give them the tools to do it safely without having to know too much, since they're not going to learn more than they have to in order to make something that looks good enough. PHP still requires you to know to avoid HTML/script injection and SQL injection vulnerabilities just to write a safe guestbook.
I am not `its_so_on` but I would agree that it should be some sort of basic skill that people should probably take for granted.
The first reason is because it's at the bottom of one of the most contentious issues facing modern man: the question of whether we are ultimately mechanical in nature, and what that means moving forward. To understand this you have to understand what machines are, and what they do. It also helps on other contentious matters like understanding how natural selection works -- and that natural selection is possible -- to explain simple genetic algorithms and how 'fitness functions' can be used to indirectly design complex structures.
The second reason is that everybody today owns several computers. The single biggest thing that I use JavaScript for is GreaseMonkey scripts to make my favorite web sites do what I expect them to do. I think a lot of frustration comes from tiny things which we can't control -- and that computers give us a tremendous opportunity to control those tiny things.
Smoking isn't just a profession, it's an everyday skill
that everyone should learn, regardless of how badly.
A cigarette is a great enabler for this - and I endorse
this direction completely.
-- Your friendly tobacco association.
I have worked with a lot of people and mentored quite a few at companies I've worked at. Some were designers, some weren't even in the IT departments. Any that wanted to learn something about we programming I lead in the direction of PHP which I cut me teeth on before moving onto other things (currently Scala). They could get a dev environment up and running in no time, and better than that they could actually host something they did on shared hosting for practically nothing (or actually nothing as I sometimes gave people sandboxes in my hosting).
PHP is a gentle introduction to server concepts and have a fairly simple and not-too abstract syntax. Yes yes, when you really look at it there are some fairly glaring inconsistencies but the reality these people were not at the stage where they would notice or care.
It's also embarrassing to me as a professional who, like most, believe that some knowledge in programming will be of great use to people (in business or otherwise) and try my best to support anyone I know wanting to learn something or better themselves that this attitude is so common and outspoken with no logical justification or attempt at rational counter argument. Programming is hard. Good programming is harder, and the levels at which some of us seem to hold everyone around us (and yet somehow I doubt they hold themselves to every minute at work) are unrealistic and can push people further away than do what we should be aiming for which is bringing people in.
I'm really proud of every one of the people who stuck with learning and letting me help them and I think it's appalling to belittle their efforts indirectly with comments like this.
This is always going to be the case with PHP – it's got the lowest barriers to entry of any web language, so it's going to have the largest share of bad coders. It's not a problem; people have to start somewhere and you can't, in an authoritarian manner, stop people from writing blog posts if they're not expert.
That said, I don't think it's about this. I think it's about respect. And people, right now, just don't respect PHP.
> But on the fringes, there are a lot of people who are writing articles, tutorials, and posts designed to help beginners learn the language (and usually how to program). The problem with this is that the majority of those authors frankly don't have a clue what they are talking about.
It's the most ubiquitous language, which leads to being the easiest to start with. Thing is, if people learn it wrong they're going to churn out crap. That's a vicious cycle.
Seriously, it's the very real hacker news circlejerk.
I would be more interested about an article titled "From Zend Framework to Django" (or whatever language/framework) than the thousandth article "Your language is bad and you should feel bad".
Does not sound like you have read the article. The article was not programming language bashing but bashing of the PHP community by a member of said community.
The true problem with PHP is that people waste enormous amount of time writing about what's wrong with PHP. And others - on reading this stuff and voting it up on news sites so that it occupies precious front page real estate.
The ##php IRC channel on freenode (1) is an absolutely incredible resource. I've idled in there for many years now and the amount of good, relevant, and accurate information that can be obtained in there is incredible. Whether you have been programming for 5 days or 5 years, simply hanging out in the channel for a couple of days can offer insights and tricks that you may have never known about.
Over time, the folks there have compiled an absolutely excellent Wiki (2) for developers; old and new. In addition, there is a wonderful list of general do's and don'ts for PHP application development. (3)
Time and time again, we get folks in there who are using outdated technologies (hello mysql_* functions) or just awful tutorials or resources and they get turned around in no time.
Disclaimer: as the author states, there are many self-described experts in PHP and they do, occasionally offer bad advice. However, it is rare for the bad advice to go unchecked in this IRC channel so I can still recommend it without worry.
[1] - http://freenode.net/
[2] - http://wiki.hashphp.org/Main_Page
[3] - http://hashphp.org/