News for hackers. Stuff that matters.
Re:How not to write an API by jimlei on Sunday March 09, 2014 @09:50PM (#7370909)
You mean like Symfony, Laravel, etc? Frameworks that a lot of PHP developers use these days...
Re:How not to write an API by camus2 on Sunday March 09, 2014 @10:35PM (#7371035)
You dont need a framework to do PHP webdev, in every other languages,you do.That's my point, PHP IS a templating language,no Symfony,Zend or Laravel can change that. If i write "print" in Python it wont output the result back to HTTP like PHP does. Ruby or Java dont have <?ruby or <?java tags, you get my point.
Re:How not to write an API by smacktoward on Sunday March 09, 2014 @11:48PM (#7371193)
> Ruby or Java dont have <?ruby or <?java tags

I dunno about Ruby, but Java certainly does: http://en.wikipedia.org/wiki/JavaServer_Pages

Re:How not to write an API by core1024 on Monday March 10, 2014 @01:24PM (#7374287)
With PHP, unlike other languages, you have not two but three options - you can either run it as a web server module (That's your "templating" opinion and the most common use of PHP), you can run it trough the Common Gateway Interface (where even in Python or Ruby print DOES outputs to the HTTP) and in the end you can roll out your own HTTP server. In the last option, just like the common use of Python and Ruby, you have full control of what's going on with your code and you decide what to send over the socket and what (if anything) to print on the console.
Re:How not to write an API by mschuster91 on Sunday March 09, 2014 @11:50PM (#7371201)
If you use them in CGI mode, you very well have a "start" tag in form of a shebang first line like #!/usr/bin/env python.

Also, shellscripts and perl are considered programming languages, and these too need a shebang line. Your point is invalid.

Re:How not to write an API by pushrax on Monday March 10, 2014 @10:41AM (#7373132)
Well, many Ruby webapps use erb, which is basically the same thing.