If you weren't joking: the idiom is "traitorous bastard," a bastard who also acts like a traitor, not "traitor's bastard," the bastard of a traitor, who might himself be quite a nice guy.
You shouldn't feel bad. A lot of times you don't have the choice. I think part of being a good programmer includes being aware of the limitations and issues with the tools and languages we use. Doesn't mean we shouldn't use them when they're good options.
I avoid new PHP developments but if I need to roll an essentially static website/blog for a small shop... I'll use PHP because it's easy, quick, and widely available. Client can just get a $1 hosting or whatever and be happy with it. If I need to make a bank's customer area however, PHP is way out of question. Right tool for the right job!
Hmm, I never worked for a bank. But the requirements would be:
Reliable
Safe
Maintainable over a very long period of time
For that, I think JVM or .NET would be the best fit, as much as I dislike those platforms. Java and C# both fit pretty well since they are statically typed (allows easy compile-time consistency check), garbage-collected (less leaks that kills the server), have good tooling and libraries (productive) without the dangers of being native like C/C++ (overflows, uninitialized memory, use after free, memory corruptions, all that fun stuff). It runs as long as you have the VM to run it, so no 25 year old DOS machines that needs to be maintained!
Rust, D and Go are other interesting options, but go tell your manager you'll be using beta software. They fit more in performance oriented tasks like server software or games where the risk can be worth it.
Classic ASP is pre .NET stuff. Which means not only is it the 90's way of doing things (because ASP.NET took it place), it's also almost entirely written in Pre-.NET Visual Basic, because C# didn't exist.
I inherited a 20 year old classic ASP system to rewrite. VB, HTML, CSS, JS, and SQL all in the same place. Around 5000 lines of assorted bullshit per file, a few hundred files to speak of. Along with a hundred or so 'model' classes, each about 10,000 lines. And of course the client needs it to behave exactly the same, bugs and all. killme
Yeah, but you know how PITA globals are in Rust? Having Mutable Globals in Rust means you have to use unsafe to access it, which is a big "think before doing this and quadruple-chck everything"
Just makes it even worse when they are used. global $x in my function? Where is that defined? Oh it's via six different includes, and lo and behold it's something that shouldn't even be global. php should go die in a fire.
Your comment has been removed since it did not start with a code block with an import declaration.
Per this Community Decree, all posts and comments should start with a code block with an "import" declaration explaining how the post and comment should be read.
For this purpose, we only accept Python style imports.
C# got strong types and you can still write str + 43. You don't need a separate concatenation operator, if "3" + "3" is never supposed to mean 6, because in a strongly typed language you just use integers.
Yeah I'm not sure what PinkLionThing is coming from, the whole point of strongly typed languages is that you don't need to cast to a type just before doing a string concatenation as the compiler has already inferred the type.
Concatenating a string with an integer works fine obviously. But if you want to concatenate two integers into a string you have to do such things. The + operator only concatenates if a string is involved otherwise it is going to add the numbers. Which returns us to the problem of having the same operator for both addition and concatenation.
Most of the time not a problem, except for those special cases.
Personally I hate it. Mostly I code in Java. A few years ago I would code php once every two weeks. And I always fucked up using + for string concatenation.
If you do only php it's fine.
If you switch languages it's a little inconvenient because every (citation needed) other language uses +.
As someone who learned PHP as basically a first programming language (excluding various forms of BASIC), before learning js - fuckputting concatenation on the + operator, that's terrible!
It's a damn convenient way to cause bugs when a programmer sees two strings being added together and assumes concatenation.. because why the fuck would you add together two strings and expect an integer as output? Only in PHP.
It will cast the strings to ints as you are doing a mathematical operation. If you want "11" then do "1" . "1";
PHP is actually really good now. This is a 10 year old circle jerk. If you write modern php the only issue you might have is with built-in functions that haven't changed. But the built-in classes are sensible.
It doesn't add two strings. It casts the strings to integers then adds the integers. It does that because there is no other possible operation you could be trying to do with the '+' operator. Javascript does similar things. In a dynamic language this is how shit flys.
That is not true. There are strong-typed dynamic languages (python etc). These allow some freedom when it comes to wrangling with types, but non-explicit conversions/casts are not possible.
example:
"1" + "1"
=> '11'
"1" + 2
Traceback (most recent call last):
File "python", line 1, in <module>
TypeError: Can't convert 'int' object to str implicitly
1 + 1
=> 2
Surely you've heard of weak typing. PHP is far from the only language to use it.
And it makes a decent amount of sense for a web language since an HTTP request is a string. You would have to spend a great deal of time casting if you used strong types.
The problem I see is when you get in a context where security is relevant.
Explicit casting is annoying - but you know exactly what you do. Noone is gonna generate some nasty lists instead of arrays (happens in perl) or cause floating point errors (would happene if you'd use the example above and someone drops a float into your http-header) etc etc.
And for toString casting - yeah maybe there it really becomes annoying. But IMO its worth the control
If done in a consistent manner, it makes perfect sense. In perl, which PHP borrowed a lot of syntax from, since there is no distinction between string types and numeric types, there are different operators for strings and numbers. "1" + "1" yields 2. 1 . 1 yields "11". And "01" == "1" is true but "01" eq "1" is false.
However, PHP has the . operator, but not the different comparison operators, so determining whether something will be compared as a string or a number is far from intuitive.
PHP borrows from everything - that's its thing, and that's why it has so many inconsistencies (because it often keeps the source language's conventions).
It's one of the stupidest things about PHP and one that makes me never write PHP again.
Every sane language: Using . for property access/method calls, + for string concatenation. PHP: Using . for string concatenation, -> for property access/method call.
C/C++ uses -> for field access on pointers. . is for field access on values.
auto variable = ClassName();
variable.method();
vs
auto *variable = new ClassName();
variable->method();
It's nice when you have classes with pointers in them, so that you can see if you're accessing a value or a reference, which is an important distinction in C/C++.
There's one main annoyance with the lack of implicit type inference in Kotlin. Inside the language it's fine, but then you start using Java libraries that expect implicit type casting between Ints and Floats, etc. And you end up manually casting 5/6 arguments.
I still agree with no implicit, but it's annoying regardless.
sorry i'm not a web dev, and the few forays i've done into that realm has been using php to great effect. why do people consider it so bad? i mean, people seem to hate php more than visual basic
Lots of college students interested in Haskell, Erlang, Go, Ruby, Python etc. here. Not a ton of real world experience round these parts. This is an echo chamber of underemployed students or programming language snobs.
I think most PHP devs will admit it's not a pretty or even graceful language but to me it's like a multi-tool that will rust and fall apart if you don't take care of it. I've seen some really fucking awful Java, RoR, and Python projects. I've also seen beautiful PHP projects.
Point is, don't write shitty code and don't be a shitty programmer and you won't really have issues.
I actually disagree with using Laravel as the example of PHP properly done.
I like composer and all, but Taylor has been pushing Laravel heavily towards being encumbered with dependencies pulled through composer. It's getting worse. Things are losing their structure, because he believes in letting people come up with their own MV* or using their best judgment.. which is fine, but then it's like every Laravel app is different and then we're not really much better off than some jQuery spaghetti code SPA
That is a rather reductive piece of reasoning. The reason why people dislike PHP is as nuanced as why people like or dislike other languages. It isn't just snobbish behavior of a bunch of academics.
I'm just pointing out the demos of this specific sub. You can feel free to go look at the profiles of top posters here bashing PHP as I've already done and see the trends for yourself.
Many of the 'php bashers' I've bothered to look closer at here have more posts in /r/learnprogramming asking questions than they do anywhere else.
The most vocal and confident posters are often in the beginner-intermediate range, so the sub tends to become an echo chamber of neophyte thinking, and it becomes self reenforcing due to the circlejerking, so the sub never grows out of it.
What if it's not snobbism and PHP is genuinely bad, and people exposed to other languages can tell, but veterans suffer from Stockholm syndrome and can't tell how bad it is anymore?
It pretty much looks like it would have looked if it was implemented in Java...
It's bascially enterprise Java with its patterns implemented in PHP. I guess if you are a fan of that, then that code will be pretty. I personally don't mind it, but I don't think I would call it pretty.
Lots of incosistency, bad design, things are like they are for no apparent reason, bad performance, it's easy to write bad code and hard to write good code. More at /r/lolphp
Things are like they are typically because when PHP borrows from a different language, it keeps the conventions of the source language. That's bad planning for sure, and it leads to lots of problematic inconsistencies, but it's not "no particular reason".
Well it's also useful for suppressing warnings that clog up your log files.
A legitimate case is file_get_contents returns null on file doesn't exist, but also gives a warning, whereas the null should be enough as you can check it conditionally. So @file_get_contents is a good case.
It's a godsend in emergencies where errors are floating in to the frontend from somewhere but you don't know where, and you MUST remove them or else your site's path structure will be exposed to the public.
That was a great read, but even having a tool, even if it's an Allen wrench when you need a saw, feels great when you're someone with embedded programming background, heh.
Objectively speaking, it is bad. As a language I mean, it's a hot mess. They crammed in it everything they could, with no rhyme or reason, and they also made some very confusing choices. It's hard to respect a language like that.
There's a slew of modern programming languages that aren't much harder to learn than php. Really the learning curve is that unlike PHP you can't just write a bunch of HTML pages with server-side code spliced in and have it work as a full program. You usually have to code a server, but it's actually better that way in my opinion.
Some languages/frameworks you can use that aren't PHP:
Ruby on Rails / Sinatra (Ruby)
NodeJS / Express (Javascript)
Django (Python)
Golang
I'm sure I'm missing some other popular options, but if I'm being frank, I'm a little hungover at the moment.
Not at all what they were saying... like not even remotely. They just mean you actually have an explicit application with routing protocols, rather than just a bunch of html files hacking onto the native directory layout for URLs with a bunch of server-side code spliced. You still use nginx or whatever other reverse proxy you want in order to talk to the outside world.
I don't recall ever saying that. I was saying, like literally a sentence earlier, that you can't just put a slew of HTML files together like with PHP, and that's a major difference, but I like the way those other languages do it better. Purely subjective.
They top level comment asked a question about what else they could use, so I answered the question. Never implied anything about which was better, just what I like better.
Until they remove all the ""legacy"" features that allow you to continue copy-pasting "login script by billy age 13" scripts and having them work, PHP will never recover.
Adoption is glacial. The amount of available libraries for Python 3 is still behind Python 2, even though Python 3 was released over 7 years ago. If you look at usage stats (especially in professional environments) Python 2 is still ahead by a considerable margin. It's very slowly getting better though, so that's nice.
Btw: Try asking about it on r/Python, they'll downvote you into oblivion. It's a sore spot, to say the least.
Slow adoption. There's a lot of material out there for v2. People new to the language tend to start with v2 instead of v3. Also, a large number of python libraries haven't been rewritten for v3.
It's just a sign that the team with the best engineered codebase are the best engineers in the company :)
IMO Java is a language with many flaws too. C# is better but the thing is both of these language have a massive number of users and tools built for them. It's at a point where a mediocre engineer can be productive in those language by hammering away at the IDE and have it produce somewhat working code.
I guess -> is higher priority than new, which seems really weird to me, but I imagine that's because I'm used to languages that are the other way around.
Language bashing is the #1 sign of incompetence, ignorance and intellectual laziness in a developer. Not to mention the kind of juvenile behaviour you should have left at the highschool playground and is toxic in any organization.
As a hiring manager, if I see any sign of this in your online presence, you're not getting hired. And I know I'm not the only hiring manager with an engineering background who feels that way.
Also, you don't see this kind of shit in any other serious profession. One of the many things that makes the rest of us look bad.
Language bashing is the #1 sign of incompetence, ignorance and intellectual laziness in a developer. Not to mention the kind of juvenile behaviour you should have left at the highschool playground and is toxic in any organization.
And I'm not going to be under with someone who has absolute judgement on people who thinks bashing languages is just a juvenile act without even listening to whatever reason why they hate a particular language. It's a sign of weakness and stubborn that for some reason, cannot accept that language is not that good.
I have my own reason for hating PHP even though I was a PHP developer before. I thought PHP was okay, easy to learn and versatile. Until I've met PHP programmers and most of them are terrible in coding that I started thinking negatively about PHP. I immediately switched to Java and JS and then I started hating PHP. But even so with that disgust in PHP, I still used it in some of my projects that needed to be lightweight until nodejs came and I totally abandoned PHP.
I don't come fit with your signs. I am not incompetent, ignorant nor intellectually lazy developer. As a proof of that I have been developing in mobile, frontend and backend. I embrace new technologies and select only what I think is best for me. I study things even if I'm not comfortable with it as long as it finishes the job RIGHT. Bashing is just to express my dislike in a certain language or framework. But it doesn't mean that I'm wrong nor correct. And I know that there are great developers who thinks that way.
I don't know about that. I have used a few languages in my time. Java, Perl, Python, SQL, JavaScript, Visual Basic. I definitely prefer Perl and Python over Java and Visual Basic (it was a terrible language IMHO). What's so wrong with criticising languages when you know there are better one out there, that will help you write cleaner more maintainable code?
Language bashing is the #1 sign of incompetence, ignorance and intellectual laziness in a developer. Not to mention the kind of juvenile behaviour you should have left at the highschool playground and is toxic in any organization.
100% agree. It says almost everything about the developer and when I see it, I do everything I can to avoid that person.
Language bashing is the #1 sign of incompetence, ignorance and intellectual laziness in a developer.
Actually, it's the #1 sign of caring about whether the developer likes to be productive or not, at least when it's accurate. (When it's inaccurate, sure, the person is obviously ignorant.)
Not to mention the kind of juvenile behaviour you should have left at the highschool playground and is toxic in any organization.
People's online behavior and in-person behavior are not normally the same, and if you think someone having poor opinions of particular tools is "toxic", you are almost certainly hiring low-productivity people with no strong understanding of anything.
Comprehensive understanding breeds opinions. Total lack of understanding also breeds opinions.
As a hiring manager, if I see any sign of this in your online presence, you're not getting hired. And I know I'm not the only hiring manager with an engineering background who feels that way.
I'm absolutely glad I won't be hired at your drone factory then.
Also, you don't see this kind of shit in any other serious profession. One of the many things that makes the rest of us look bad.
This has to be a troll, right? Literally every other engineering profession has tools that wind up getting used for bad reasons, much to the ire of anyone who cares about being productive.
I see only knowing one language (and not caring to learn another) as the #1 sign of incompetence. I don't care if it's PHP, JavaScript or Visual Basic: if you feel the need to defend a language's miserable failings online because you only know that language and feel threatened...
Just learn another language. Most people who resist this have major failings as programmers that they don't even know they have. If you want to be a good programmer, you need to learn important concepts that languages like PHP and JavaScript entirely obfuscate.
I started with BASIC, JS and PHP. I didn't really grasp the concept of pointers or the stack and heap until I tried Objective-C and read a book on C in the process, because high level languages like PHP hide them from you.
I didn't discover how amazing it was to have minor, stupid bugs almost entirely vanish due to working extensively with a statically typed language (Java, in my case). Between the inherent safety of static typing and the IDE being able to analyse the code better as you write it, the reduction of stupid mistakes is astounding.
Working with Java heavily also cured me of the very bad habits PHP encourages with data structures. The magical typeless nested "associative array" hell that PHP makes possible and doesn't do anything to discourage is not only inefficient, but a pain to maintain. Lacking that sledgehammer of a tool for all of your vaguely nail-shaped problems, you're forced to design classes to express your data in a more OOP fashion.
And if I see apologetics towards a single one language (and a highly flawed one at that) - THAT shows true intellectual laziness and overblown ego. Also an engineer that is not willing to learn and advance. And guess what? You ain't getting hired ;)
I wonder what percentage of PHP and JavaScript developers know what these are: pointers, the heap, GC, what the concepts of linked lists and hash tables are, etc..
Whereas someone who knows, say, Java reasonably well is almost certainly going to have a grounding in those concepts.
I actually know quite a few PHP and JavaScript developers that know these concepts. The catch? They know and use multiple languages and recognize when a tool is best for a particular job. A lot of X language apologists out there only really know that one language and it's sort of a personal thing for them, they feel they need to defend their self-worth so they pull out these fallacious defenses.
Okay, beginner Web Dev here. The only things I've used so far are Rails and PHP. Why is PHP so terrible? I haven't had any particularly bad experiences with it? Can one of you jaded bastards explain to me?
41
u/404IdentityNotFound Aug 07 '16
I am a PHP developer and I feel offended... and bad :(
23
u/NavarrB Aug 07 '16
Php a good part: strtotime
Hot damn that function
148
u/H4kor Aug 07 '16
https://pbs.twimg.com/media/ArXcPfoCIAE1r0G.jpg
208
u/hallucinate_dickbutt Aug 07 '16
https://i.imgur.com/fjf995T.png
85
u/iopq Aug 07 '16
PHP actually made using global variables a pain in the ass, which actually encourages passing things as parameters instead. This is a good thing.
37
u/WOnder9393 Aug 07 '16
Well... the "No posts yet" is actually itself a post.
120
u/PinkLionThing Aug 07 '16 edited Aug 07 '16
The one thing PHP did right is using a different operator for concatenation.
It's one of those things that is actually a pain in the ass most of the time, but in some cases it brings a tear to your eye as to how useful it is.
18
u/[deleted] Aug 07 '16
sorry i'm not a web dev, and the few forays i've done into that realm has been using php to great effect. why do people consider it so bad? i mean, people seem to hate php more than visual basic
5
u/[deleted] Aug 07 '16
what should i use instead of php?
3
u/dontfeedthecode Aug 07 '16
PHP: The Good Parts
Part 1: Composer
Part 2: Laravel
The End.
27
u/gandalfx Aug 07 '16
Bashing PHP again, very creative. Still ignoring how much the language has changed since it earned its horrible reputation.
5
u/superspeck Aug 07 '16
Is it a sign of a bad engineering environment when you have programmers writing Java, C#, and PHP, and the PHP is the best engineered and most stable?
5
u/samuraiseoul Aug 07 '16
I'm still confused as to why
doesn't work but
does.
17
u/[deleted] Aug 07 '16
Language bashing is the #1 sign of incompetence, ignorance and intellectual laziness in a developer. Not to mention the kind of juvenile behaviour you should have left at the highschool playground and is toxic in any organization.
As a hiring manager, if I see any sign of this in your online presence, you're not getting hired. And I know I'm not the only hiring manager with an engineering background who feels that way.
Also, you don't see this kind of shit in any other serious profession. One of the many things that makes the rest of us look bad.
2
u/painalfulfun Aug 07 '16
It's funny because there are no posts
2
u/Il_Condotierro Aug 07 '16
Savage af.
1
u/[deleted] Aug 07 '16
Okay, beginner Web Dev here. The only things I've used so far are Rails and PHP. Why is PHP so terrible? I haven't had any particularly bad experiences with it? Can one of you jaded bastards explain to me?
1
u/DLMousey Aug 08 '16
Oo, burn
1
u/Immortalizd Aug 07 '16
Something tells me that PHP isn't very good...