Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

PHP vs Ruby vs Python for Web

Name: Anonymous 2013-07-24 6:53

You are forced at gunpoint to choose. Which one, and why?

Name: Anonymous 2013-07-24 7:03

ERLANG

Name: Anonymous 2013-07-24 7:09

Python, because I would have chosen it without the gun.

Name: 3 2013-07-24 7:11

Now if I were forced at gunpoint to choose between PHP and Ruby for the web, I'd choose the bullet.

Name: Anonymous 2013-07-24 7:13

>>3
The proponents of Python cite 'indentation' as the worst problem, this is a strawman argument 'this is the worst problem and its not really a problem'. This argument has been voted up presumably by people who like the language, because it is certainly not a good reason not to use Python. I am far from an expert at Python, but I have done a couple of semi-serious projects in the language and will try to recall specifically what I didn't like.
- Broken scoping: Python, like many other scripting languages, does not require variables to be declared, as let (x 123) in Lisp or int x = 123 in C/C++. This means that Python can't even detect a trivial typo - it will produce a program, which will continue working for hours until it reaches the typo - THEN go boom and you lost all unsaved data. Local and global scopes are unintuitive. Having variables leak after a for-loop is confusing. Worse, binding of loop indices can be very confusing; e.g. "for a in list: result.append(lambda: fcn(a))" probably won't do what you think it would. Why nonlocal/global/auto-local scope nonsense? Such shortsighted scoping design leads to Python's faulty package system, which exposes everything, so that, for example, typing time.sleep=4 instead of time.sleep(4) would break the system-wide sleep function, while accidentally assigning some method to time.sleep, and you won't even give a runtime error - just a hard to trace bug. Moreover, dynamic scoping impedes encapsulation and compilation, so everything you write will be open source: no FASLs, DLLs or EXEs, while developer may want to have control over the level of access to prevent exposure of internal implementation, as it may contain proprietary code or because strict interface/implementation decomposition is required.
- Inconvenient syntax: FIOC or Forced Indentation of Code (aka "off-side" rule) impedes using CLI, automatically generating Python code and moving around large code blocks. Editing Python code requires special editors (forget about Word/Notepad), that expand tabs into spaces, while transmitting python code through a web post or email breaks indentation. Absence of block-terminator is so utterly confusing, that you'll find yourself ending blocks with #endif anyway. It's painful to deal with other things that need indenting, such as large SQL queries, or HTML when you're using things like mod_python. And why is there ":" when code almost always has a newline after it? Python's whitespace indentation indulges messy horizontal code (> 80 chars per line), where in Lisp one would use "let" to break computaion into manageable pieces: get used to stuff like self.convertId([(name, uidutil.getId(obj)) for name, obj in container.items() if IContainer.isInstance(obj)]), while logical connectives being lost in a pile of other symbols, like "and" in "if y > 0 or new_width > width and new_height > height or x < 0". Instead of usual "fold" and "map" functions, Python uses "set comprehension" syntax, which has a large collection of underlying linguistic and notational conventions, each with it's own variable binding semantics: good luck discerning [f(z) for y in x for z in gen(y) if pred(z)] from [f(z) if pred(z) for z in gen(y) for y in x]. In addition, you will enjoy cryptic expressions like z(*z(*m.i())[::-1]).
- Crippled support for functional programming. Python's lambda is limited to a single expression and doesn't allow conditionals. Python makes a distinction between expressions and statements, and does not automatically return the last expressions, thus crippling lambdas even more. Assignments are not expressions. Most useful high-order functions were deprecated in Python 3.0 and have to be imported from functools. Creating an object just to call a function, like ''.join(map(str, r)), is just annoying sign of bad language design. No continuations or even tail call optimization: "I don't like reading code that was written by someone trying to use tail recursion." --Guido

Name: Anonymous 2013-07-24 7:13

Python.
PHP is poorly designed and Ruby is overated

Name: Anonymous 2013-07-24 7:15

What's so bad about PHP? Are you not smart enough for it?

Name: Cudder !MhMRSATORI!fR8duoqGZdD/iE5 2013-07-24 7:21

PHP

Available everywhere, from free hosts to 4chan-scale ones.

Name: Anonymous 2013-07-24 7:23

Name: Anonymous 2013-07-24 7:31

>>8
Or you could not be a pleb and run your own servers.

Name: Anonymous 2013-07-24 7:34

>>10
PHP is not a server strawhat

Name: Anonymous 2013-07-24 7:36

The real question here is what framework?

Name: Cudder !MhMRSATORI!fR8duoqGZdD/iE5 2013-07-24 7:36

>>10
"forced at gunpoint to choose" sounds like being threatened to write a web app, and you probably have no choice of what it's going to run on.

Name: Anonymous 2013-07-24 7:37

>>13
You got a point..

Name: Anonymous 2013-07-24 7:40

>>13
So really, your additional comment was completely pointless.

Name: Anonymous 2013-07-24 7:43

>>13
"forced at gunpoint to choose",  sounds like being threatened to write a web app and if you're not a pleb, you would run it on Rails or PyPy

Name: Anonymous 2013-07-24 7:44

>>16
I meant Pylon not PyPY. fuck

Name: Anonymous 2013-07-24 7:45

>>16
>>17
Github, pls go

Name: Anonymous 2013-07-24 7:48

>>16, 17
Why not Django?

Name: Anonymous 2013-07-24 7:50

>>17 I believe you means Pylons

Name: Anonymous 2013-07-24 8:17

I'd choose python, because I could just write a daemon that sits on port 80 and then has bindings to a real language for any and all computation.  I'm sure I could do that in Ruby or PHP as well, but I've had to use those two misshapen atrocities in the past, and the devil I don't know can't be worse than the ones I do.

Name: Anonymous 2013-07-24 8:19

Ruby is the only sane answer. I don't want to deal with Hypertext nonesense and FOIC

Name: Anonymous 2013-07-24 8:33

Perl, because I'm bulletproof.

Name: Anonymous 2013-07-24 8:44

>>23
Nothing to lose. Fire away, fire away!

Name: Anonymous 2013-07-24 9:29

>>1
Ruby, for the chicks, brah.

Name: Anonymous 2013-07-24 9:33

PHP bbecause its the only solution which works well on web.

Name: Anonymous 2013-07-24 11:08

>>16
Go back to /g/ where you can call everyone a ``pleb''.

Name: Anonymous 2013-07-24 11:24

I choose "vs"

Name: Anonymous 2013-07-24 18:55

>>27
Why not just stay here and call you a pleb?

Name: Anonymous 2013-07-24 18:59

>>29
Because I'd lel so hard, my sides would fly into the reddit orbit. I hope you're not >implyin/g/ you want >mfw to look like that in le >2013, /g/roski.

Name: Anonymous 2013-07-24 19:19

>>27
>>28
>>29
IF YOU HAVE ANYTHING TO SAY THAT IS NOT ABOUT PROGRAMMING, SAGE.

Name: Anonymous 2013-07-24 19:28

>>31
Optimise you are quotes.

Name: Anonymous 2013-07-24 19:39

>>31
Fuck off.

Name: Anonymous 2013-07-24 20:06

Javscript.  I'd be shot at once but feel total and absolute freedom for the last seconds of my life...

Name: Anonymous 2013-07-24 20:10

>>34
Hi there, David.

Name: Anonymous 2013-07-25 6:57

>I'd be shot at once but feel total and absolute freedom for the last seconds of my life...

YOU MENA LISP?

Name: Anonymous 2013-07-25 7:30

Python, because I love the look clean whitespace syntax.

Don't change these.
Name: Email:
Entire Thread Thread List