3 ms·
It'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 SimpleHTT
by wyager 12y ago
It'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 agoRouting is done by a router, not a server. a server serves. Does that really need to be said? Edit: to clarify, I read about "routing" in "web-apps" now and then. I have problems figuring out, although it seems to be clear to anyone. And then you come and mess up terms even more, while routing is absolutely not essential to a web-server. Also, if your idea of routing is anywhere near apache's rewrite-rules, I don't wanna know it. If on the other hand routing is essential to an ftp server, I'd be curious.