r/Python • • Nov 11 '08

Why the hatred for functional programming?

0 Upvotes

86 comments sorted by

View all comments

5

u/Wiseman1024 Nov 11 '08 edited Nov 11 '08

Okay, I don't think I need to tell why I'm asking this. While Python supports functional programming to a reasonable extent, there's a widespread stubborn hatred of functional programming and anything related to it in the Python community (probably starting with the BDFL), and any proposals for extending Python into something more useful for functional programming (without taking out any of the other ways to use Python, of course, that's the good thing about multi-paradigm languages) is received with ruthless hostility and perceived as an attack against Python.

The Python community is generally a good one (especially compared to others), yet this generalized hatred for functional programming and anything related to it seriously turns me off. While Python is currently my overall favourite programming language (considering the quality of the standard and non-standard libraries, support, and features), I'm currently considering putting my effort and time investments somewhere less hostile to functional programming.

Hostility to functional programming is a form of hostility to abstraction, theoretical correctness and cleanliness. I hope I'm wrong, but this seems like pulling the PHP way. Consistently meeting proposals such as tail call elimination with nothing short of "that's liek difficult to understand d00d ha ha no freaking way" doesn't say much about the health of this community; in fact it looks like something straight out of the average PHP documentation comment.

-7

u/neoform3 Nov 11 '08 edited Nov 11 '08

You would like to know why people hate functional programming..

I would like to know what the hell is wrong with python programmers that they feel the need to constantly attack PHP. It truly makes no sense whatsoever. No other group of programmers (other than python coders) attack any other language, they way they do to PHP.

The only conclusion I can come to is it's because of jealously. Python coders wish more people used python instead of PHP..

The best part is, despite my having asked/commented in logical way.. I already know this reply will be modded -20 within an hour, which does nothing but proving my point.

11

u/earthboundkid Nov 11 '08

I think it's because we've all used PHP and when we think back on it, we think, "Sheez, why did I waste time on that?" There's a bit of shame at how bad our PHP code was mixed in with the conviction that you can't possibly write good code in PHP (since I didn't, QED).

Plus, just as a matter of fact, PHP is a very poorly "designed" (to use the term loosely) language. Which gives us an element of fact to hang our hate on.

-3

u/neoform3 Nov 11 '08 edited Nov 11 '08

You know, I've coded in VB.NET before, I think it sucks and wouldn't use it, but.. I also never talk about it. I don't like it, I move on and learned something I did like instead.

Seems like the same thing happens in the Postgre community as well (now that I think about it most python users are postgre coders), and they never stop railing against mysql.. I never hear mysql users attacking postgre, or complaning about how it's far more complicated and more difficult to set up or learn..

Why the dwelling and hate?

Also, saying you can't write good code in PHP is just false.

5

u/earthboundkid Nov 11 '08 edited Nov 11 '08

Also, saying you can't write good code in PHP is just false.

I think you need to attend to my argument more clearly:

  1. I tried to write good code in PHP.

  2. I failed.

  3. Therefore, no one can write good code in PHP.

QED ∴

It's logically indisputable.

1

u/neoform3 Nov 11 '08

Can't fight that logic.

3

u/[deleted] Nov 11 '08

I think it's largely in part that no one is going to defend PHP. If you bash perl in a python group, you're going to get replies claiming perl has it's place. You have to be stupid to defend PHP.

3

u/neoform3 Nov 11 '08

I like PHP. I like Python.

Both have their place.

PHP is good for rapid development. Python is good for well organized development.

I can bang out a PHP site quite a bit faster than I can a python site with identical capability.

3

u/Singletoned Nov 11 '08

You need a single page with a form on it that a user fills out and it returns a thank you message. It might need to scale to a million users in a few days.

What would you build it in? You would need a very, very good reason not to say php. (And I say that as someone who hates php).

1

u/[deleted] Nov 12 '08 edited Nov 12 '08
import cgi
form = cgi.FieldStorage()

name = form.getvalue('name')
msg  = form.getvalue('msg')

if None in (name, msg):
   displayform()
else:
   processcomment(name,msg)

1

u/[deleted] Nov 12 '08

What would you build it in?

It doesn't matter, because your language isn't going to be the bottleneck here.

1

u/Wiseman1024 Nov 11 '08

I would like to know what the hell is wrong with python programmers that they feel the need to constantly attack PHP.

I'm a long-time PHP user, and I know of its strengths and relative strengths. I still think one can write acceptable code with it, provided you build a good framework to interface the standard library. What I'm attacking, though, is that the language seems to be designed by inexperienced programmers who are in no position to design a programming language and keep coming up with crap and have little idea of how to implement a proper language and standard library, and what's even worse, a horde of PHP "programmers" who write the worst pieces of shit my poor eyes have ever seen, making use of every single bad practice I can think of with whatever PHP gives them. To make matters worse, this horde of Pretty Horrible Programmers is actively encouraged to keep working this way.

No other group of programmers (other than python coders) attack any other language, they way they do to PHP.

I attack Java more than I attack PHP. I enjoy writing PHP more than I enjoy writing Java. It's just that I know how PHP is the butt end of jokes here, and I wanted to show how some Python programmers are gravitating towards what they supposedly loathe.

The only conclusion I can come to is it's because of jealously. Python coders wish more people used python instead of PHP..

Yes, but please, not the idiots who use includes like functions, work in the global scope, constantly enter and exit PHP in the middle of anything, don't indent code, do all sorts of crap with extract and variable variables, completely misunderstand the type system (especially the concepts of truth and existence), write PHP like they write C, and so on.

3

u/neoform3 Nov 12 '08

don't indent code

I doubt you'd get far in python if you don't indent.. ;)

1

u/[deleted] Nov 12 '08

Perhaps it's because a lot of python programmers started using python for websites, and found it to be vastly better than php?