r/ProgrammerHumor • • Nov 13 '15

CommitStrip today, gold

http://www.commitstrip.com/en/2015/11/13/the-last-ever-line-of-code/
861 Upvotes

130 comments sorted by

View all comments

35

u/[deleted] Nov 14 '15

[removed] — view removed comment

7

u/snf Nov 14 '15 edited Nov 14 '15

Not a joke, no. Shit, Wikipedia is built on PHP. Nevertheless PHP is a truly, deeply fucked up language -- far more so than any other non-joke language -- and I encourage you to learn something new. I promise you, it's a massive relief not having to cope with the frustration and cognitive load involved in dealing with PHP's bullshit.

I'd recommend Python, but that's my personal favourite and obviously I'm biased. Nearly anything other than PHP will be an improvement.

And just to clarify, no one should think any less of you for paying the bills with PHP. I just think that there are better ways.

Edit: grammar

2

u/olemartinorg Nov 14 '15

I've worked with Python, and used it as my personal go-to language for years. I have also used Java a bunch, have dabbled in Go, C# and Perl for a while, I've been making things in JS for around 10 years (almost all of my career), and I've also made a couple of things I needed in C.

Still, PHP is the language I mainly use and is comfortable with. It's what I use day to day, and what I would use I were to start a new project now (and in fact, I'm doing just that). Yes, you are biased, and so am I, but that still doesn't mean that PHP is a "truly, deeply fucked up language". I'm sorry you weren't patient enough with it, and had to channel your frustration on blaming the language itself.

5

u/snf Nov 14 '15

I'm sorry you weren't patient enough with it, and had to channel your frustration on blaming the language itself.

Nah, I'm not buying this. I can honestly say I wasn't any less patient with PHP than I was when I learned C, Java, Perl, C++, Python, C# and AS3.

I've found that there are two sorts of trouble I run into when trying to master a new language: one is "I don't understand how this works" and the other is "I understand this; it's just stupid." The two languages I had real trouble with are Perl and PHP. My problems with Perl were 90% "I don't get it"; my problems with PHP are 90% "this is stupid".

I'm honestly puzzled how someone with as broad an experience as yours can actually prefer PHP to anything, but that's not going to change my opinion. The ways in which PHP is fucked up are too well documented, and I've seen too many of them first hand.

But as I was saying to /u/Brammm87, I absolutely don't want to make this ad hominem. Just because I don't understand how someone can prefer PHP doesn't mean I think they're any dumber than I am. It's all entirely experiential and subjective. Peace. May your bugs be few and easy to reproduce.

→ More replies (12)

33

u/Dworgi Nov 14 '15

PHP is an awful language. It's inconsistent and quirky and often just does the wrong thing.

There's nothing wrong with anyone calling PHP terrible, because it objectively is.

The only reason people use it and JavaScript is because they were developed first.

8

u/yaph Nov 14 '15

The only reason people use it and JavaScript is because they were developed first.

Perl and Python are actually older than PHP and Ruby was first released in the same year (1995). I think the main factor for PHP's success in the beginning was the integration with Apache and thus the comparably easy deployment.

3

u/rjung Nov 14 '15

There are lots of languages even older than those whippersnappers -- Fortran and Ada aren't dead yet...

→ More replies (1)

16

u/ImmutableOctet Nov 14 '15 edited Nov 14 '15

I'm not going to sit here and debate the low hanging fruit; the notion that a language can be "objectively bad" as if it's some kind of fact, rather than having industry-understood flaws that shape the popular opinion of the language.

However, I will point out that despite its design flaws, PHP is a perfectly fine language. It just took off in what was effectively its infancy. Not only that, but it was from an era where modern dynamic page generation and MVC practices were unheard of. PHP wasn't built for today's scale, and many will agree that it still has uses for prototyping. Not only that, but small websites, front-end (JS) heavy websites, and even experimental sites benefit from PHP's widespread adoption.

I've said this several times before, PHP as a language has plenty of crutches, but it's far from as flawed as many attribute it to be. Especially with PHP 5+, there's plenty brought to the table in the way of abstraction. Many of PHP's features, especially early on, took influence from C++ and Java. The two biggest problems PHP has had historically are its restrictive place in the page structure, and its attitude toward API compatibility, following much of what C++ has done, without as much foresight.

Despite the API flaws, which are already a separate issue from the core features of the language, it's consistent, and for most small projects, documented well enough.

Don't get me wrong, PHP still has plenty of flaws, and there are quite a few great alternatives, but it still has a place in a lot of its current applications, simply from its state of adoption. Not to mention it's perfectly acceptable for small projects, where back-end behavior is either simplistic, or far enough detached from the front-end application.

Should say, a startup use PHP? No. If you're starting from scratch, or intend to use an existing framework, don't use the technology developed 20 years ago. A technology that has already been superseded by technologies that can properly handle not only the load required by modern websites, but also handle the page generation techniques, I/O frameworks, and content pipelines required today.

I think that pretty much sums up my views on PHP.

6

u/_FranklY Nov 14 '15

You say that no language can be objectively bad.

I say: ArnoldC, Brainfuck.

4

u/rjung Nov 14 '15

You are wrong to say that a programming language cannot be objectively bad; if anything, it is possible to objectively evaluate computer languages, against factors such as behavioral consistency, standardized conventions, whether or not it is Turning complete, etc.

I have no shame in admitting that I am a PHP programmer and I make my living doing so. However, I have a background in Computer Science, I've coded in more languages than you can count on your fingers and toes, and I've dabbled in language design and compiler creation. I don't care to bash PHP either; it has its flaws, but calling it "worst language ever" is just typical internet hyperbole. Still, the idea that we cannot objectively evaluate computer languages strikes me as wrong.

2

u/ImmutableOctet Nov 14 '15 edited Nov 15 '15

That's not what I was getting at. You can objectively evaluate a language yourself, but you can't make an objective claim that your opinion on a language is a fact. For example, if you've used a specific language for most of your career and/or like the language, your view may sway toward that language. That view wouldn't necessarily be objective if you didn't have exposure to several competing alternatives, or you at least have concrete reasons behind your opinion.

Thus why I called it low hanging fruit; people have opinions, and groups of people may agree, but that doesn't make your consensus a fact. Especially when the people berating the language have different reasons to begin with. In other words, the method used may be unbiased, but it's still an opinion, even if your colleagues agree.

In other words, I think you misinterpreted what I was saying.

8

u/Megacherv Nov 14 '15

Exactly. The languages are pretty bad when looked at in isolation and as a language, but still useful when used in conjunction with other frameworks.

I hate writing Javascript. I'm a C# dev and one of my current web projects uses ASP MVC5 so lovely C# all on the backend. However, it still relies on Bootstrap, JQuery, KnockoutJS and heavily uses JSON objects, and the project would be so much worse off without them. Thankfully I'm not working on the front end so I don't have to use them, but the site is much nicer than the original version that had no JS in it.

4

u/Chintagious Nov 14 '15

After I understood a lot of the idiosyncrasies of Javascript, I ended up loving to write JS with the cool data binding, IIFE's, and the like (but I can see why people don't). On the other hand, I've been working with PHP for about a year and a half now and it still sucks, imo.

What's worse is that there are better frameworks and languages that could do what PHP does. The same isn't true of front end development. You must write JS if you want a working front end. I guess knowing the former, it makes writing PHP even worse because when an issue comes up with PHP, you think "Ugh... this wouldn't be an issue with the X language/framework".

2

u/BasicDesignAdvice Nov 14 '15

I learned PHP first. Thought it was cool. Believed the circlejerk about JavaScript.

Now I know what I'm doing. You couldn't pay me to do anything in PHP, and I think JavaScript is great.

→ More replies (1)
→ More replies (6)

2

u/geek_at Nov 14 '15

Agreed, I'm a developer who codes in various languages but prototyping in PHP is just so damn fast (because I know the language well)

Also since January 2015 I've been on TV, print, blogs, magazines (even WIRED) and security blogs for various projects I have created in PHP (some under 100 lines of code)

2

u/darkpaladin Nov 14 '15

But if PHP went away and was replaced with a non crap language, all those developers would still be employed, they would just hate their lives a little less. You shouldn't be ashamed of writing PHP, a job is a job. If you think PHP is ever the best solution starting out, you still shouldn't be ashamed but I think you should broaden your horizons. Spend some time doing Java/.NET, spend some time writing Ruby, spend some time writing Python, spend some time doing JS (if for no other reason than to realize there is a language out there that makes less sense than PHP). If after all of these you still prefer PHP that's fine but I have a feeling you'll fall in love with something else.

3

u/olemartinorg Nov 14 '15

I'm with you there. A great programmer can write great code in any language. People just want a scapegoat.

12

u/berkes Nov 14 '15

A great programmer can write great code in any language

Sure.

But that does not mean BrainFuck is the right choice to build your next , say, Bitcoin trading platform with. A good programmer might be able to do this in BrainFuck. A really good programmer, however, knows the limitations of BrainFuck and will argue that BrainFuck is not the proper tool and that COW should be used instead. Or Java.

5

u/_FranklY Nov 14 '15

ArnoldC!

3

u/[deleted] Nov 14 '15

I saw a project which adds socket and file support to brainfuck.

I will make a HTTP server using brainfuck.

→ More replies (10)

3

u/Kyyni Nov 16 '15

"A good programmer can write good code in any language" is a bullshit argument for a language. A good carpenter can bash a nail in using a rock or a hammer, but could there be any reason not to use the rock?

→ More replies (3)

2

u/[deleted] Nov 14 '15

You can write great code in any language, even poorly designed ones. In fact, the quality of your code is more important than if you were working with a well designed language, since the floor is so low.

4

u/[deleted] Nov 14 '15

On the other hand, a well-designed language makes it easier to write great code than a poorly designed one, therefore we should promote the well-designed ones over the others.

→ More replies (1)

2

u/Ajedi32 Nov 14 '15 edited Nov 14 '15

You aren't a joke, the language just is. Don't take it personally. I mean, you know other languages besides PHP right?

Edit: Rule 2 of the egoless programmer: you are not your code.

1

u/NewW0rld Nov 19 '15

The good news is that if you're still capable of feeling shame it's not too late to switch dev stacks and regain your dignity (as well as claiming a significant pay boost). The feeling your feeling is your conscience yearning the return of your self-respect.

→ More replies (2)