PHP's Bad Reputation

  • (9 Pages)
  • +
  • 1
  • 2
  • 3
  • 4
  • 5
  • Last »

123 Replies - 34383 Views - Last Post: 15 January 2013 - 12:14 PM

#31 jon.kiparsky  Icon User is offline

  • Pancakes!
  • member icon


Reputation: 7630
  • View blog
  • Posts: 12,866
  • Joined: 19-March 11

Re: PHP's Bad Reputation

Posted 10 January 2013 - 10:36 PM

Okay, I'll take the bait.

I've read that Graham essay before. For those who don't read extended texts, he claims that, since Lisp makes you a better programmer, it only makes sense to program in Lisp. (severely truncated, I admit, but if you're afraid you missed something you can read it yourself)

So, Lemur, my question to you is this: Why do you bother writing code that isn't Lisp?
Was This Post Helpful? 0
  • +
  • -

#32 Lemur  Icon User is offline

  • Pragmatism over Dogma
  • member icon


Reputation: 1359
  • View blog
  • Posts: 3,425
  • Joined: 28-November 09

Re: PHP's Bad Reputation

Posted 10 January 2013 - 10:42 PM

Currently I write faster in Ruby, and I don't have a deep enough grasp on LISP to use it effectively quite yet. In professional environments I tend to use Ruby, but home based experimentation is primarily in Scheme or LISP. As soon as I get to a level in which I can effectively use it.

For the most part I tend to be facetious and heavily satirical in talking about it because I find it entertaining. Currently I'm building my skill in the language, and I can already see how it will be immensely useful at work, but to write amateur level code in a better language at this point would not be good for a production environment.

For ease and entertainment value, we will call this the Lemur Phenomenon. The Lemur Phenomenon is the occurrence in which an entire thread is derailed into a discussion on the superiority of LISP in any and every environment.

(Note - I will be legitimately entertained if I get enough rep from this thread to earn a PHP contributor for the month without posting a lick of PHP.)

This post has been edited by Lemur: 10 January 2013 - 10:51 PM

Was This Post Helpful? 2
  • +
  • -

#33 jon.kiparsky  Icon User is offline

  • Pancakes!
  • member icon


Reputation: 7630
  • View blog
  • Posts: 12,866
  • Joined: 19-March 11

Re: PHP's Bad Reputation

Posted 10 January 2013 - 10:46 PM

Interesting. I ask because I suspected the answer would be something of the sort, since most people seem to find something similar happens - myself as well.

I'd like to be a better lisp hacker, but I'm not more than a dabbler at the moment, and I don't know if I'll ever get there. But every time I dabble, I learn some new stuff, so it's always worth it.
Was This Post Helpful? 1
  • +
  • -

#34 ishkabible  Icon User is offline

  • spelling expret
  • member icon




Reputation: 1622
  • View blog
  • Posts: 5,709
  • Joined: 03-August 09

Re: PHP's Bad Reputation

Posted 10 January 2013 - 10:53 PM

I looked at learning common lisp, even bought a book, but didn't stick with it. I want to look into and stick with scheme too but have only done some very basic stuff with it. Haskell is a really neat language but it doesn't have anything like macros (at least not without Template Haskell).

Currently I only have 2 languages that I would say I'm "fluent" in: C/C++ and Lua. I can write viable applications in other languages but they would be somewhat poor(PHP is among these languages).
Was This Post Helpful? 0
  • +
  • -

#35 jon.kiparsky  Icon User is offline

  • Pancakes!
  • member icon


Reputation: 7630
  • View blog
  • Posts: 12,866
  • Joined: 19-March 11

Re: PHP's Bad Reputation

Posted 10 January 2013 - 10:58 PM

You might want to look at Friedman and Felleisen's Little Schemer and its sequels. The Little Schemer is all about recursion in the lisp style, and it's deep. Probably one of the best books on programming that I've come across yet.
Was This Post Helpful? 0
  • +
  • -

#36 AVReidy  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 65
  • View blog
  • Posts: 431
  • Joined: 17-February 11

Re: PHP's Bad Reputation

Posted 11 January 2013 - 06:04 PM

It's because computer science hipsters think they're way above the mainstream and can't be associated with the most ubiquitous (and useful) server-side web scripting language. It's much cooler to use Node.js or Rails or Django because the newbs "probably never heard of it"
Was This Post Helpful? -2
  • +
  • -

#37 jon.kiparsky  Icon User is offline

  • Pancakes!
  • member icon


Reputation: 7630
  • View blog
  • Posts: 12,866
  • Joined: 19-March 11

Re: PHP's Bad Reputation

Posted 11 January 2013 - 06:19 PM

Again with the name-calling. Nobody seems to want to say anything good about PHP, even when they're defending it.

Why's that, do you think?
Was This Post Helpful? 1
  • +
  • -

#38 Lemur  Icon User is offline

  • Pragmatism over Dogma
  • member icon


Reputation: 1359
  • View blog
  • Posts: 3,425
  • Joined: 28-November 09

Re: PHP's Bad Reputation

Posted 11 January 2013 - 06:26 PM

View PostAVReidy, on 11 January 2013 - 07:04 PM, said:

It's because computer science hipsters think they're way above the mainstream and can't be associated with the most ubiquitous (and useful) server-side web scripting language. It's much cooler to use Node.js or Rails or Django because the newbs "probably never heard of it"


Hardly. Have you not read ANY of the topic?

Rails is far more solidly built and far more powerful, Django I have no experience in, and Node.js is a mess. Javascript is just as bad as PHP if not worse now that someone's tried to port it to server side.

Why not Node.js? Javascript fell into the same trap of patching that PHP did, and the creator did not like the Unix philosophy and decided to reinvent everything which made a mess. I won't touch that with a 50 ft pole...
Was This Post Helpful? 0
  • +
  • -

#39 Atli  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 3716
  • View blog
  • Posts: 5,976
  • Joined: 08-June 10

Re: PHP's Bad Reputation

Posted 11 January 2013 - 07:01 PM

View PostLemur, on 12 January 2013 - 01:26 AM, said:

Javascript fell into the same trap of patching that PHP did, and the creator did not like the Unix philosophy and decided to reinvent everything which made a mess.

How so? What makes it such a mess, exactly?

I often hear this from people, but very few seem to be able to come up with a reasonable response when asked for an explanation. - Not that I doubt you can't. Just curious why you see it this way.

I agree with you about Node.js though. Even though I like Javascript as a client-side language, Node.js always feel "wrong" to me. (There are only so many nested callbacks you can create before it becomes weird...)
Was This Post Helpful? 0
  • +
  • -

#40 xclite  Icon User is offline

  • LIKE A BOSS
  • member icon


Reputation: 902
  • View blog
  • Posts: 3,163
  • Joined: 12-May 09

Re: PHP's Bad Reputation

Posted 11 January 2013 - 07:31 PM

Javascript:

http://blog.codekill...-in-javascript/
Was This Post Helpful? 0
  • +
  • -

#41 Lemur  Icon User is offline

  • Pragmatism over Dogma
  • member icon


Reputation: 1359
  • View blog
  • Posts: 3,425
  • Joined: 28-November 09

Re: PHP's Bad Reputation

Posted 11 January 2013 - 07:33 PM

It's the only language that I've felt even worse about than PHP is my initial knee-jerk reaction.

  • Nan == Nan => False
  • Null is an object
  • Almost required use of global variables for obscure scoping
  • Lack of integers (I believe it was some odd double float) which makes bitwise operators annoying and gives some odd obscure 1 in the millionths place or further out (like .00000001 to every addition)
  • A crap ton of null equivalents


I'd have to look back through it some time, it's been a few years since I've touched it but if I did go back and do some research for a few weeks I'd have a far more extensive list.
Was This Post Helpful? 0
  • +
  • -

#42 Atli  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 3716
  • View blog
  • Posts: 5,976
  • Joined: 08-June 10

Re: PHP's Bad Reputation

Posted 11 January 2013 - 08:17 PM

I'm not sure your being entirely fair there.

Nan == Nan => False
Yea, I'll give you that one. The NaN type and isNaN function are both very odd.

Null is an object
What is the downside to this? Pretty much everything in Javascript is an object, so this doesn't seem that odd to me.

Almost required use of global variables for obscure scoping
How so? Scoping in Javascript isn't that tricky, really. I don't think a single non-constructor object in any of my recent Javascript projects has been a global.

Lack of integers (I believe it was some odd double float)
That's true. There is only one numeric type, and that's "Number"; a 64 bit float. There are very few issues associated with this though. The Number type does perfectly represent all integer values in the 32 bit range. I don't think I've ever run into an issue with the Number type that wouldn't have been exactly the same on any language that does have integers; floating point calculation errors tend to happen only when you are using Number to store fractions, which would never be solved with an integer type.

I'll admit, though. I am no mathematician, so there are probably issues with this that escape me. The bitwise issue, for instance, I had heard of before, but never really took the time to understand properly. (It never affected anything I was doing.) - I can only say that issues with this are rare exceptions, not the norm. In almost all cases, the fact that there is no integer type is of absolutely no consequence.

A crap ton of null equivalents
I don't think this is accurate. As the table xclite shows, only "null" and "undefined" equate to each other.
Was This Post Helpful? 0
  • +
  • -

#43 xclite  Icon User is offline

  • LIKE A BOSS
  • member icon


Reputation: 902
  • View blog
  • Posts: 3,163
  • Joined: 12-May 09

Re: PHP's Bad Reputation

Posted 11 January 2013 - 08:25 PM

However, as the table I show shows, what the fuck casting.
Was This Post Helpful? 0
  • +
  • -

#44 jon.kiparsky  Icon User is offline

  • Pancakes!
  • member icon


Reputation: 7630
  • View blog
  • Posts: 12,866
  • Joined: 19-March 11

Re: PHP's Bad Reputation

Posted 11 January 2013 - 08:28 PM

To be honest, what I've seen of Javascript doesn't seem so very annoying, and there is some room for functional program fun, so it gets a little +1 there.

Mostly I think it's annoying because if the context I encounter it in, which is to say embedded in with a lot of HTML and PHP and suchlike, which is usually a godawful mess because, frankly, the HTML/PHP/JS stack is hard to manage nicely.

This is what I'm enjoying about Django so far: I have fewer opportunities to take stupid shortcuts and drop in "well, it works, and I can fix it later" hacks. So while it's still a little confusing to me, the confusions make sense: it's me not understanding the framework, which I can resolve. It's not the framework trying to confuse me, which is more difficult.
Was This Post Helpful? 0
  • +
  • -

#45 Atli  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 3716
  • View blog
  • Posts: 5,976
  • Joined: 08-June 10

Re: PHP's Bad Reputation

Posted 11 January 2013 - 08:42 PM

Well, yea. If you are combining HTML, JS and PHP all in one big mess.. it'll be a big mess. But it's not at all complicated to manage PHP applications so that this doesn't happen. No more, in my experience, than with any other language.

There are plenty of good PHP frameworks that do the exact same thing for PHP as Django does for Python, or what Rails does for Ruby. Building crappy code with "well it works" hacks is on the developer, not the language.
Was This Post Helpful? 0
  • +
  • -

  • (9 Pages)
  • +
  • 1
  • 2
  • 3
  • 4
  • 5
  • Last »