This is a horrible design for a large webapp, but even as an experienced programmer, sometimes I just want a quick hacky self-contained script, like the many, many .py files in a subdirectory of my home directory (but on the web, Python does not provide this convenience in commonly used setups). A beginner can similarly benefit from simplicity: even if Rails tutorial code is pretty, there is still a lot going on behind the scenes; sometimes, the smaller conceptual model required to really understand what's going on, the better.
Cause as a designer who programs (mainly php) that is the number one reason why I haven't been learning a new language.
They all require way too much. Php just works for my needs. If I get bigger needs then I am sure I will make the switch to another language.
It's been done times and times again. Look at Sinatra for an example in the ruby world (http://www.sinatrarb.com/), I'm sure python has something similar. Maybe a static site generator such as octopress or push would be an option as well.
The problem is that the simple php approach does not scale. Sticking files in directories will only get you a small step, you'll need includes to share code soon. And then the mess starts if you're not using a framework. And good PHP frameworks go a long way beyond sticking a file in a directory - you'll have the same steep learning curve as with rails or something similar.
What? I understand for a beginner, but come on. If you're really a programmer programming for many hours aday... you really won't take the time to learn how to wire up wsgi to a python process? It's no harder than wiring Apache up to mod_php5 and telling it where to serve out of. It just takes a very modest effort on your part to learn it.
And then you get all the benefits of... not having to use PHP and getting to use... anything else.
From my perspective, Ruby on Rails is really, really difficult so far. You have to learn to use the terminal (which I've seen other people in my position use to totally mess up their computers); to make a simple application you're already looking at maybe a dozen files, many of which you don't understand; most importantly for me, because there is a lot of stuff going on that you can't see, it's very hard to extrapolate from examples.
I have learned what programming I know from breaking apart example programs and then using the pieces to build other things. I'm not good at learning from textbooks or tutorials. This has proved very difficult with RoR so far. I'll take components that look like they should make something happen, and then they'll throw an error that I don't understand and can't seem to locate.
Doing otherwise is like trying to learn PHP by looking at the Drupal codebase.
I don't mean to be saying that I'm doing it right, or that mine was a good way to learn programming. Just mean to be giving a data point about the relative approachability of PHP and RoR for actually making stuff as a beginner.
Eventually, I heard about Sinatra, and decided to try it out. It's a great way to learn about web apps. You'll learn the HTTP verbs if you haven't already, and you'll understand the routing process.
When you jump into Rails, you'll already understand Controllers and Routers, since Sinatra is basically the router and controller of Rails combined. You'll probably learn about views too.
Basically, learn sinatra, then go to Rails.
- Making better languages more accessible to utter newbies (PHP is unarguably the easiest to "get working", if nothing else of the prevalence of hosting).
- Showing newbie PHP developers how to do it better
- Introducing "better" languages to advanced newbies
The fact that PHP is used so widely as a gateway language, and the web is stuffed full of bad advice, is a systemic failure in those of us who know how to program well...
The ease of php (as mentioned repeatedly) is that you get global access to hundreds of functions. If you know how to call a function, you can probably hack together what you're trying to do. Others (python, ruby, go) are meant for more mature applications because real problems are not that simple. You "have to" do imports and write more boilerplate, but it's also more explicit as to what's happening in the context of HTTP and enables and encourages better design.
I feel like it's a compromise and I think creating something new that is as well thought out as Go but as simple as `<?php header("Location: http://google.com) ?>` would be difficult to do. See other things like PHP: JSP, etc.
From what I can see and aside from the ease of install, it is the namespace. You type <?php and you have hundreds of functions at your disposal. Not the case with Python or Ruby where you need to understand imports and global objects.
Sometimes everything not being an object helps, but only in the short run.
It's not great, but it's the easiest to grasp.
Maybe new devs should learn Perl, instead... http://search.cpan.org/~adamk/Acme-Everything-1.01/lib/Acme/...
Outside of the wide availability of PHP servers for cheap, what makes PHP so great for beginners? With Ruby, Python, Go, hell, even JSP for the "instant", in-HTML effect, I just don't see PHP as some gloriously "easy" language to use.
On top of it, there are hundreds of thousands of PHP tutorials all across the Internet that just have poor, poor, poor suggestions and design patterns that lead to people storing passwords unhashed, or unsalted. Sure, it's not unique to PHP, but it's really, really easy to get wrong in PHP and that's painful for a beginner and it's hard to progress and mature as a PHP developer without an existing code base to learn from.
tl;dr: I'm not convinced is as great as many here make it out to be. (To note, the first thing I sold was written in PHP in highschool. Since then I've used JSP/J2EE stack/python/ruby and now am infatuated with Go, so my opinion is not simply based on group-hate for PHP)