5 ms·
And this is why I always use PHP as an introductory language if I have to teach web dev; the setup part is much more straightforward than it is for Rails/Django
by GuiA 12y ago
And this is why I always use PHP as an introductory language if I have to teach web dev; the setup part is much more straightforward than it is for Rails/Django/etc., and you don't have to spend a ton of time teaching dozens of concepts (MVC, routes, templating, git, unit tests, ORMs, etc.) before the students can have mini web apps written.
Some programmers balk at the idea of teaching PHP with plain HTML/CSS instead of teaching using Rails + Angular + all the fancy crap they like, but I've taught web dev to over 500+ students in the past 7+ years (and programming/CS to about twice that), and it's worked like a charm (and the people who get the most upset by that notion are often those who have taught 0 students).
My girlfriend is an art teacher, and when they teach new students they don't start right away with watercolor or oil paints; rather, they start with materials that are easier to handle for beginners (e.g. plain pencil), so they can focus on the basics before tackling the more subtle and advanced techniques. Why are we trying to teach programming using all the fancy tools and technologies used in production systems?
- roywiggins 12y agoFlask. Flask Flask Flask. It's well-documented, in Python, and you can push it to Heroku easy as pie. You can add things like templates (they're built in, and can be really simple) or just concatenate HTML the old-fashioned way. You can program very imperatively and work up to abstractions. It's very friendly. I haven't seen it used as an introductory "language" but I feel like it would work well.
- agumonkey 12y agoAlso blueprints, a good exercise in separation of concerns, flexibility etc
- vegggdor 12y ago> and the people who get the most upset by that notion are often those who have taught 0 students Does that apply to you?
- recursive 12y agoRead the rest of the sentence. > but I've taught web dev to over 500+ students in the past 7+ years
- roywiggins 12y agoTo me? Yes and no. Yes I've taught precisely 0 students. No, I'm not at all upset with teaching PHP, I coded up my fair share of awful PHP web apps. My first favorite language was ActionScript which everyone loves to hate! But at the time, nothing beat PHP and ActionScript/Flash for simple, fun web development for beginners. I think something like Flask might be a worthy successor. Heck it even includes a webserver, no need to fiddle with installing Apache to test stuff locally. And with services like Heroku the barrier to getting it online is almost as low as PHP.
- vegggdor 12y agoI somehow missed your actual arguments for flask, so my impression of you over-enthusiastically praising flask was all wrong, sorry. Still, if Flask does everything for you, what are students left to learn? A lot, i guess :)
- macNchz 12y ago>you can push it to Heroku easy as pie Having worked with absolute beginners, this isn't nearly as easy as you think for someone just getting started. You're adding ssh keys, getting set up with git, installing the heroku client, running things from the command line, dealing with dependencies, dealing with heroku config file issues... These are the things that get extremely frustrating very quickly to someone who doesn't have a technical background, and they cause people to give up. Compared with: start a shared hosting account for $2/month, connect with a gui FTP client and the password you made during signup, drag and drop files to the server, go to http://www.yourserver.com/foo.php http://www.yourserver.com/foo.php and see if it works. If it's about learning the most basic fundamentals, PHP just works. It will be some time before these people start building things where security, scale, separation of concerns, version control etc start to count. Introducing too many things at once is frustrating, and the fun starts when you can use the things you're building, and share them with others. There's not much that's better than PHP in that regard.
- teach 12y agoYes, anyone that says "you can push it to Heroku easy as pie" clearly hasn't spent hardly any time teaching anything to actual beginners.
- roywiggins 12y agoI was working on the assumption that environment would be already set up for them. Setting up Apache to test stuff locally, getting FTP set up to get into your remote server, etc is all a pain with PHP too. Once everything is set up, it's two-ish commands to commit and push to somewhere like Heroku. And no, I haven't taught beginners at all, I'll fess up to that. I've learned alongside them, though. PHP is a perfectly cromulent language/framework for this sort of thing, but something like Flask could be just as accessible.
- boyaka 12y agoWindows: Install Xampp, copy your files to C:\xampp\htdocs Right click xampp icon and start services Ubuntu: sudo apt-get install apache2 php5 mysql-server php5-mysql sudo service apache2 start/restart sudo service mysql start/restart copy files to /var/www/ "getting FTP set up to get into your remote server" sudo apt-get install ssh sudo service ssh start
- Grae 12y agoWe use Flask at Thinkful in our Python course for precisely this. Ran into some disappointment from folks who'd prefer to dive directly into Django, but from an instructional perspective we'd much rather introduce something comprehensible than ask students to memorize magic words or incantations.
- collyw 12y agoI can imagine Heroku being easy as pie when everything works, but it is a pain in the arse when it doesn't (I have pushed 3 small Django apps to Heroku, its not easy to debug errors).
- wyager 12y agoIt's also easy to teach programming with BASIC. That doesn't mean it's particularly good for the students. Setting up a web server with e.g. Python's SimpleHTTPServer is absolutely trivial, and teaches them a lot more about what a web server actually does (routing requests and building responses), and also prepares the students to use whatever hip python stuff people are doing servers in these days.
- jiggy2011 12y agoThe advantage for typical PHP here is that the webserver runs the programs somewhat transparently rather than the other way around with your program creating the webserver and then managing requests. PHP/Apache provides a very simple routing model that correlates 1:1 with the filesystem.
- wyager 12y ago>PHP/Apache provides a very simple routing model that correlates 1:1 with the filesystem. Might that give students a false impression of what a webserver does and is capable of doing? The students can implement the same thing themselves in a few lines of python, rather than offload most of the functionality to a monolithic and unapproachable black box like apache or nginx.
- jiggy2011 12y agoIt's useful to black box some of the things when you are first learning. The specifics of serving a request are probably not the first thing you want to teach, especially when it requires some notional understanding of threading/blocking which Apache can take care of automatically. Also mod_rewrite and .htaccess provide powerful methods of adjusting behaviour of routing and the like.
- vegggdor 12y agoWriting web apps or servers are two different things. well, mostly ... almost, at least if you teach for productive use. especially for anyone who just started coding, a few lines of python can be a lot, so KISS.
- vegggdor 12y ago> Why are we trying to teach programming using all the fancy tools and technologies used in production systems Wait, either a) PHP isn't a production system, :) or b) you are blaming yourself for using it, or c) ...
- teach 12y agoAnother teacher with real-world experience teaching ACTUAL, normal students? We're a rare breed. I agree with everything you wrote, of course. Kids need to learn how to CODE first with simple, non-magical tools. Experience with the other bells and whistles comes later.