lollllll is it not consistent? I'm not familiar with PHP, only ever wrote a few lines, I've heard that it's a "really bad language" (especially on tech youtube) and that i should stay away
I'm a indie software developer. That means I'm running solo. I create WordPress/WooCommerce plugins and some Android apps. Hope to learn more from awesome people here on dev.to
Totally agree! See my response above. It was a joke. I'm not a PHP export by any means so don't listen to me. It was many years since I last used it :)
Tech Lead/Team Lead. Senior WebDev.
Intermediate Grade on Computer Systems-
High Grade on Web Application Development-
MBA (+Marketing+HHRR).
Studied a bit of law, economics and design
Location
Spain
Education
Higher Level Education Certificate on Web Application Development
You can think on it as Python example, it was released in 1991 yet it was considered garbage by many people, something that you know it exists but don't even consider using.
Two decades after it became one of the top languages to consider.
Trends are trends and community hype is present as well, check your sources, search for information, try it yourself and take your own conclusions.
Remember that is better to say "I don't like Java because it's verbose" than saying "Java is a shit"
Well you just lack experience if this is your biggest pet peeve. I agree, it's not a perfect system, but if you only pass an array to array filter it will filter out falsey values without you having to specify a callback. There's benefit in that
this is not the biggest but it's the context of what I replied to.
and if array_filter have benefit of using array first, why not all other functions do the same?
Either way, if you are coding in anything other than Notepad, your IDE will most likely help you with the argument order so in that regard, it really is a moot point. Most frameworks have all of this abstracted already. They also abstract strings. I don't see it being much different than Java world. Nobody codes in plain Java nowadays. Everybody simply learns the spring framework and "the spring way of doing things" and that is it.
Don't take people's opinions on programming topics too seriously, form your own opinion. Not that you should look into PHP, but if you don't understand the reason why someone thinks a technology is bad, it often means the person stating that actually doesn't know either.
I graduated in 1990 in Electrical Engineering and since then I have been in university, doing research in the field of DSP. To me programming is more a tool than a job.
I have some experience with PHP, although I wouldn't call myself an "expert." However, the inconsistency of the API is the first thing I noticed. Ruby has been designed with the principle of "minimal surprise," PHP seems designed to maximize the surprise.
Fortunately, there is a nice manual online, without that programming in PHP would be a nightmare.
It does have inconsistent api for functions, however the reason is that function names are same as underlying libraries function names.
So there is strpos and str_replace (str meaning string), but they differ in naming because strpos is from one library and str_replace from other.
That is the short explanation at least.
@dhravya Don't trust simply on the basis on what you hear, There is a lot of hate going around for php, but there is a reason It is still going so strong. Also These hate comes from old php (php <=5). The php that you would learn today is completely different language, not just an incremental upgrade. From personal experience, PHP-8 is almost as good of experience as Java J2EE for large scale Application ( now known as Jakarta EE, not to be confused by similarly named Apache Jakarta).
About language inconsistencies, it will make sense when you learn that it was borrowed from underlying system (c or perl depending on module. ). And regarding the community inconsistencies like different framework had different coding guidelines ( mostly for those which existed before PSR), That is true for almost any language (except for Java, Those guys created strict coding guidelines from the day 1). ANSI-C is quite different Turbo-C, Comodor basic was quite different than atari-basic even though they are both based on MS Q-basic. Now, almost all frameworks are getting streamlined in coding guidelines by adopting PSR at some level.
I highly recommend you to watch 25 years of PHP from its creator Rasmus Lerdorf, During lunch on some weekend, as a casual watch recommendation.
Those who say "It's a really bad language" has never learned php properly enough. Sometimes not all book should be judge by its cover alone. PHP as a language might feel weird at first, But it is a very practical language. Going through the underlying c code, is also an awesome experience, you will learn a lot of micro-optimization tricks which can be translated into any language you work with.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
lollllll is it not consistent? I'm not familiar with PHP, only ever wrote a few lines, I've heard that it's a "really bad language" (especially on tech youtube) and that i should stay away
Making decisions based on the opinions of so-called "expert" is risky
Totally agree! See my response above. It was a joke. I'm not a PHP export by any means so don't listen to me. It was many years since I last used it :)
People say the same about almost any language.
You can think on it as Python example, it was released in 1991 yet it was considered garbage by many people, something that you know it exists but don't even consider using.
Two decades after it became one of the top languages to consider.
Trends are trends and community hype is present as well, check your sources, search for information, try it yourself and take your own conclusions.
Remember that is better to say "I don't like Java because it's verbose" than saying "Java is a shit"
Yep, I agree. I think I heard a saying on the lines of "If a language isn't hated, it's bad"
example from built-in function of core php
array_map receive callback first, array second
array_reduce receive array first, callback second
there are quite a number of this kind of inconsistency around
Well you just lack experience if this is your biggest pet peeve. I agree, it's not a perfect system, but if you only pass an array to array filter it will filter out falsey values without you having to specify a callback. There's benefit in that
this is not the biggest but it's the context of what I replied to.
and if array_filter have benefit of using array first, why not all other functions do the same?
Either way, if you are coding in anything other than Notepad, your IDE will most likely help you with the argument order so in that regard, it really is a moot point. Most frameworks have all of this abstracted already. They also abstract strings. I don't see it being much different than Java world. Nobody codes in plain Java nowadays. Everybody simply learns the spring framework and "the spring way of doing things" and that is it.
Don't take people's opinions on programming topics too seriously, form your own opinion. Not that you should look into PHP, but if you don't understand the reason why someone thinks a technology is bad, it often means the person stating that actually doesn't know either.
+100. Don't listen to me :D I made a joke. PHP is (was?) known for having inconsistent API but I am not an PHP expert by any means.
I have some experience with PHP, although I wouldn't call myself an "expert." However, the inconsistency of the API is the first thing I noticed. Ruby has been designed with the principle of "minimal surprise," PHP seems designed to maximize the surprise.
Fortunately, there is a nice manual online, without that programming in PHP would be a nightmare.
There's also some good replacements, for example the laravel helpers. I very rarely use the standard library.
It does have inconsistent api for functions, however the reason is that function names are same as underlying libraries function names.
So there is strpos and str_replace (str meaning string), but they differ in naming because strpos is from one library and str_replace from other.
That is the short explanation at least.
@dhravya Don't trust simply on the basis on what you hear, There is a lot of hate going around for php, but there is a reason It is still going so strong. Also These hate comes from old php (php <=5). The php that you would learn today is completely different language, not just an incremental upgrade. From personal experience, PHP-8 is almost as good of experience as Java J2EE for large scale Application ( now known as Jakarta EE, not to be confused by similarly named Apache Jakarta).
About language inconsistencies, it will make sense when you learn that it was borrowed from underlying system (c or perl depending on module. ). And regarding the community inconsistencies like different framework had different coding guidelines ( mostly for those which existed before PSR), That is true for almost any language (except for Java, Those guys created strict coding guidelines from the day 1). ANSI-C is quite different Turbo-C, Comodor basic was quite different than atari-basic even though they are both based on MS Q-basic. Now, almost all frameworks are getting streamlined in coding guidelines by adopting PSR at some level.
I highly recommend you to watch 25 years of PHP from its creator Rasmus Lerdorf, During lunch on some weekend, as a casual watch recommendation.
Those who say "It's a really bad language" has never learned php properly enough. Sometimes not all book should be judge by its cover alone. PHP as a language might feel weird at first, But it is a very practical language. Going through the underlying c code, is also an awesome experience, you will learn a lot of micro-optimization tricks which can be translated into any language you work with.