[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

why is php real

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 32
Thread images: 4

>$this-> in front of every instance variable reference or method access
>$ used at all not in reference to jquery
> -> what the fuck is this
>variable_and_function_naming_scheme
>constants referenced with self::
>strings concatenated with .

i've spent more time looking up syntax than i have actually writing code. i thought java was bad
>>
It's possible you're retarded
>>
>>61549779
Its probably based on perl and created by a complete retard
>>
php predates jquery idiot
>>
>>61549779
>help I am physically unable to learn programming languages that are even slightly different from the one I'm used to
t. brainlet pajeet
>>
>>61549779
Of course PHP is shit. Why do you even want to use it?
>>
>>61549779
>$this-> in front of every instance variable reference or method access
Because there's no variable declarations it's impossible to tell whether the variable you're referring to is in function scope or in obbject scope otherwise. Python has the same problem.
>>$ used at all not in reference to jquery.
Perl used it. JQuery is younger than PHP
>> -> what the fuck is this
It's C/C++.
>>variable_and_function_naming_scheme
C again.
>>constants referenced with self::
This one is kind of weird, but it's still C++.
>>strings concatenated with .
That's a good thing, it means stupid shit like adding numbers and strings won't be unpredictable as in Javascript. Also this is the reason the -> operator is used for member access rather than .

PHP is a poorly designed language, but not for any of the reasons you listed.
>>
>>61549779
PHP sucks, and anyone who says otherwise is a braindead Indian, but Jquery deserves to die far more. It's a pile of shit used by people too dumb to just learn how to actually write JavaScript immediately. It's like training wheels for web development.

> -> what the fuck is this
In any sensible language, it's used for anonymous functions, but PHP is a language for the retarded and by the retarded; therefore it uses it where it should use it's character for string concatenation.
>>
>>61551223
>In any sensible language, it's used for anonymous functions
lmao
>>
>>61551197
>Perl used it.
One of the many reasons it shouldn't be used is that Perl used it, but at least it had syntactic meaning in Perl.

>That's a good thing, it means stupid shit like adding numbers and strings won't be unpredictable as in Javascript.
You haven't used many non-C family languages, have you? That means normal things that '.' does can't be done anymore. Plenty of decent languages use ^ for string concatenation, or just use an actual function for it and not an infix wannabe binop. PHP lets you add float and int with + though, may as well let you add strings with it too. At least go all in if you're going to go pajeet.

I'm pretty sure nearly all uses of PHP's string concatenation are cases where string concatenation wouldn't be needed in a normal language, like one that isn't just an overcomplicated template engine.

Valid PHP code:
echo ['xddd'][0.666 - 0.420]


OP's opinions are mostly those of a brown little JS man, but he made some good points. He feels his obvious struggle with the language, yet is too dumb to realize it's not the awful syntax that troubles him, but the awful language as a whole.
>>
>>61551413
>One of the many reasons it shouldn't be used is that Perl used it, but at least it had syntactic meaning in Perl.
Agreed, I just needed to point out that comparing $ in PHP to JQuery was retarded. $ in PHP is an inconsistent piece of shit as soon as you get to OOP.
> PHP lets you add float and int with + though, may as well let you add strings with it too.
Being able to add two numeric types means you should be able to concatenate a numeric type to a string with the same operator? I don't see your point. Maybe a better choice of operator would have been better, but I'm glad that a weakly typed language with many implicit conversions choice to make addition and concatenation unambiguous.
>>
>>61549779
>be early 2000s
>internet is taking off
>not many standards exist yet, very few people know how to actually do stuff, but everybody wants to be part of it
>everybody wants a website for himself, his company etc.
>they don't even have basic computing knowledge, most of them only started to use computers for a few months
>guy who hates programmers and thinks they are cancer creates a programming language for the web designed for non-programmers
>somehow everybody starts using it, and it's still alive in 2017 even though it was cancer then and cancer now

It needs to die.
>>
op here.

>retard
probably

>brown little JS man
actually only used JS once, mentioned jquery bc it's the only place i remember $ being used frequently. pretty new to programming, only experience is in java and python for the most part.

>He feels his obvious struggle with the language, yet is too dumb to realize it's not the awful syntax that troubles him, but the awful language as a whole
been reading more into php and i fucking hate it even more. the syntax is pretty broken as is, like i feel there's a lot of unnecessary shit (in whatever other languages use it too) but yeah fuck php
>>
>>61551700
good, stay away. PHP is only good today for basic HTML templating and there are better solutions for that anyway.
>>
>>61551644
Actually, PHP/fi (personal home page/form interpreter, yes, really) dates back to the mid-late 1990s.
The magic ingredient, the crack rock what made PHP successful, was the ability to embed code in HTML, for free. How could CGI.pm ever compete, especially when Cold Fusion and Netscape Server were doing it and charging for it?
I think logic-less templates of the curly-brace family are helping PHP sit down.
>moral of the story: never trust a language designed entirely on irc

>>61551716
This, right here. Express.js just makes this stuff so easy.
>>
>>61549779
I don't like or even use PHP, but these are all non-arguments.

"It's not the way other languages look."

Ok.
>>
File: back to reddit.jpg (174KB, 712x1024px) Image search: [Google]
back to reddit.jpg
174KB, 712x1024px
>le php is shit xD meme
>>>/r/programmerhumour
>>
>>61551818
A reasonably orthogonal standard library that isn't wordy and puts needle and haystack parameters in a consistent order isn't just a luxury for the working programmer.
Also a SQL db access library that doesn't support prepared statements and bound parameters needs to be thrown from a helicopter along with its author.
>>
>>61551877
You have to be some kind of braindead retard to even remotely consider defending php in any way.
>>
>>61551895
lmao php is for crappy kids I code in java like a real coder
>>
>>61551925
In the street, pajeet.
>>
File: kid on computer.jpg (36KB, 500x362px) Image search: [Google]
kid on computer.jpg
36KB, 500x362px
>>61551937
>look mom I totally roasted that poo in loo!!!!
>lel xD stupid pajeet praise kek
>>
>>61551925
There is like a billion languages less shitty. Pick any.
>>
>>61552006
I mean, I like java a lot but rust sounds pretty interesting.
>>
>>61549779
PHP is objectively shit, but you're fucking retarded.
>>
>>61551197
>Python has the same problem.
Wut? Python could have implicit self/this without breaking variable scope.
Java does it, you just have to explicitly refer to instance if local variable shadows instance variable. It would mess up decorators though.
>When a method definition is decorated, we don't know whether to automatically give it a 'self' parameter or not: the decorator could turn the function into a static method (which has no 'self'), or a class method (which has a funny kind of self that refers to a class instead of an instance), or it could do something completely different (it's trivial to write a decorator that implements '@classmethod' or '@staticmethod' in pure Python). There's no way without knowing what the decorator does whether to endow the method being defined with an implicit 'self' argument or not.
>>
>>61552086
>Java does it, you just have to explicitly refer to instance if local variable shadows instance variable.
The local variable starts shadowing the instance variable once it is declared. Because Python does not have declarations, it must always assume you're referring to a local variable unless you use self.
>>
>>61551197
So is -> used for pointer members as well in php?
>>
File: sillywabbit.png (360KB, 1080x1080px) Image search: [Google]
sillywabbit.png
360KB, 1080x1080px
>>61549779
>$this-> in front of every instance variable reference or method access
Mostly because PHP isn't a pure object-oriented language and as such the scoping is bullshit.
>$ used at all not in reference to jquery
Who cares, shit's cash.
> -> what the fuck is this
C/C++ as some anons have mentioned by now.
>variable_and_function_naming_scheme
The bigger issue is the inconsistency between their usage of snake_case, camelCase and fuckallcase. But that's why you have autocomplete.
>constants referenced with self::
Weird C++ shit.
>strings concatenated with .
At least now you know when you're dealing with strings in this loosely typed language.
>>
>>61552228
PHP does not have pointers.
PHP does have references with & (somewhat like C++) but they're fucked.
>>
>>61549779
PHP is pretty bad, but most of your reasons are not valid.
Your instance variable complaint is not valid.
Your jQuery complaint is not valid because >>61549878 and PHP has little to do with jQuery.
Your arrow complaint is not valid because it's juat the syntax and you can get over it.
The naming scheme complaint is a valid complaint because there is within the core functions
The self:: complaint is valid because it was not a well-thought out feature.
The string concatenation complaint is not valid because that's the syntax, deal with it.
>>
>>61552316
Whoops I fucked up a sentence. The naming complaint is valid because the core API cannot decide on one and instead chooses to use multiple styles.
Thread posts: 32
Thread images: 4


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.