Stats: 3,186,466 members, 7,929,547 topics. Date: Friday, 23 August 2024 at 04:25 PM |
Nairaland Forum / Science/Technology / Programming / Let's Be Honest Php Sucks When Building Enterprise Applications (5360 Views)
Let's Be Honest, The Number Of Programmers We Have In Nigeria Is Exagherrated / Nigeria Sucks On Programming. (2) (3) (4)
Let's Be Honest Php Sucks When Building Enterprise Applications by islam1001: 5:12pm On Oct 04, 2016 |
I REALLY THINK PEOPLE SHOULD STOP MAKING NOISE ABOUT PHP , TO ME PHP SUCKS AND THIS ARE MY REASONS :---- The ternary operator In most programming languages the ternary operator is right-to-left assocative. This allows you to write things like this: print((foo == 1) ? "uno" : (foo == 2) ? "dos" : "tres" ![]() print("\n" ![]() This chunk of code obviously outputs the word uno. PHP's implementation of this operator has left-to-right. I dare you to guess what the following PHP snippet outputs: <?php $foo = 1; print(($foo === 1) ? "uno" : ($foo === 2) ? "dos" : "tres" ![]() print("\n" ![]() # (I use the === operator out of good habit.) ?> Hint: it's not the word uno. The || and && operators In non-retarded programming languages, they return either the result of the left operand or the result of the right operand. In PHP, 5 || 4 returns 1. 0 || 6 returns 1. While most people use || as a "default value" operator: $foo = $bar || "default value"; this cannot be done in PHP. Invoking external programs PHP does not provide multi-argument forms of system(), exec(), or other built-in functions. There is the pcntl extension, which is not enabled by default. Higher-Order Programming If you're forced to use a version of PHP older than 5.3, you don't get closures. Other Issues In PHP, the names of built-in functions are inconsistent. Is it isset() or is_set()? Is it isnull() or is_null()? Is it sort() or array_sort()? Is it merge() or array_merge()? Even I don't remember. I have to look up the PHP documentation to answer these. I'll let you do the same. The arguments to built-in functions are inconsistent. The built-in functions' return values are inconsistent. The number of built-in functions is too large. Do we really need 11 sort functions (scroll down)? Function names are case-insensitive, but variable names are case-sensitive. WHY? As I've stated above, the vast majority of official and user-contributed documentation is poor. PHP's authors have made a few non-backward-compatible changes to the language. Not just between PHP4 and PHP5, but in minor point releases of PHP4. Magic Quotes There is also the fact that PHP ever had the magic_quotes feature in the first place. While it's been turned off by default for quite some time, and will be removed from PHP 6, it will still affect you for some time to come in the following situations: When writing programs to distribute to other people who may be running PHP4 or PHP5. Such as yet another forum or CRM package. When writing programs you may port from one operating system to another someday. Even if both are running the same version of PHP... ...You see, there's one particular PHP feature called magic_quotes_gpc, where things get "interesting". It is on by default in PHP4. It is off by default in PHP5 on certain Linux distributions; on in others. You can probably stick "php_flag magic_quotes_gpc" off in apache.conf or .htaccess. But some shared-hosting providers make this impossible. In the worst case, you may very well have to pollute your code with things like this. (There are common techniques such as ereg_replace("/\\/", "" ![]() 1 Like |
Re: Let's Be Honest Php Sucks When Building Enterprise Applications by kingofthejungle(m): 5:26pm On Oct 04, 2016 |
the php e warriors are arriving 1 Like |
Re: Let's Be Honest Php Sucks When Building Enterprise Applications by Nobody: 5:33pm On Oct 04, 2016 |
For me the only time I learnt PHP was when I first started out programing, actually web development, after I learnt html and CSS I had to learn PHP to manipulate data on the website, to me it's only good for beginners because it has a low level learning curve and easy to set up. <?php echo "Hello World!"; ?> ![]() Python and ruby is the main thing. 1 Like |
Re: Let's Be Honest Php Sucks When Building Enterprise Applications by Raypawer(m): 6:24pm On Oct 04, 2016 |
let me call them.. frankklampard php lord, guru01 php spokesman, loading... 1 Like |
Re: Let's Be Honest Php Sucks When Building Enterprise Applications by directonpc(m): 6:58pm On Oct 04, 2016 |
Do you know any web based enterprise application that process heavier data than Facebook? @OP Extra Developers in Benue Please like this page to sign up for the first ever Benue state developers meet-up. Page: www.facebook.com/bntechforum Come let's build a better tech ecosystem in our dear state. |
Re: Let's Be Honest Php Sucks When Building Enterprise Applications by islam1001: 7:02pm On Oct 04, 2016 |
Ehm.... May be you have not heard of Google before Like wise facebook use many languages and a fully modified version of php 1 Like |
Re: Let's Be Honest Php Sucks When Building Enterprise Applications by toheebDOTcom(m): 9:23pm On Oct 04, 2016 |
You have your points. However, you should know php did not start out as a programming language. It was just for Personal Home Page. It wasn't planned to be a programming language, hence some inconsistency. To add more salt, $_SERVER['HTTP_REFERER'] did you noticed referer? Instead of the correct spelling of referrer. What about HELO in smtp? Those are not php. While the first was certainly an error but people are already used to it for it to be changed. So, yes, shit happens. I read a quote of Rasmus Lerdorf where he confessed of being a coder that poorly writes code that works perfectly. Bottom line, php has come to stay. With php 7, it is the fastest scripting language. I don't need to tell you that you can harness it for a world class app. Php may suck to you but that doesn't mean a language that sucks! 1 Like |
Re: Let's Be Honest Php Sucks When Building Enterprise Applications by Nobody: 10:51pm On Oct 04, 2016 |
islam1001: I want this to be as constructive as possible, no derailing. I'm a pretty experienced PHP programmer, I've used PHP for things ranging from Websites to Daemons and CLI applications (just for the experience, wouldn't use it professionally for such a task) and I know the trouble I had to go through with the pcntl extension (PHP processes can't last long without a hell of a tweak)...pcntl_fork()'ing like crazy also another thing you didn't mention is the PHP-GD extension which is not available by default on some versions of PHP, I had to add it manually for a hobby steg project I was working on (never completed it). PHP wasn't built for OOP from the start, it was simply a templating language and it still is and since there are many "wuru-wuru" ways of making a PHP script run successfully, a lot of bad developers roam around boasting of proficiency at the language. Listen carefully: (Read on) You are not a complete PHP dev if you: 1. Haven't (at least) heard of unit testing or written unit tests 2. Haven't (at least) heard of or used CI (Continuous integration) 3. Haven't (at least) heard of or used ERD (Entity Relationship Diagrams) tools such as MySQL Workbench 4. Haven't (at least) heard of or used version control. 5. Haven't used a framework before. How many PHP devs use debuggers? I can't blame them because PHP isn't a compiled language, the binary that interprets it is, so the debugging stage is skipped till the final hour of deployment then all errors and bugs unleash themselves. This does not mean there are no good PHP devs that actually write good code, there are people that have built frameworks/plugins that cover up for PHP's "ugly-ness/deformities", take a look at smarty, PHPQuery e.t.c, they allow you code PHP the beautiful way, so no worries about funny in-built functions at-least and a more presentable code-base. @OP I don't think you should just throw away the language, PHP has some pretty good advantages. I will suggest to anyone to learn Python and [url=stackoverflow.com/questions/20428414/sending-data-to-python-script-from-php]interact with Python from PHP[/url] and vice-versa or maybe just go fully into JS development (using Node) but before you go into Node, check [url=reactphp.org/]this[/url] out (I also use Node in some cases/projects for specific personal reasons). Finally, @OP it's preg_replace() ; not ereg_replace() ; 2 Likes 1 Share |
Re: Let's Be Honest Php Sucks When Building Enterprise Applications by guru01(m): 1:42am On Oct 05, 2016 |
islam1001:From what you have written so far, I can tell you are in experience using php. You better stick with what is you know how to use and let php be. |
Re: Let's Be Honest Php Sucks When Building Enterprise Applications by islam1001: 7:24am On Oct 05, 2016 |
guru01: Sorry to burst your bubble, I actually started out wit php and most of my initial projects were usually CRUD based, bet now tat I Ave to work on larger projects where I have to manage a lot of background jobs, process scheduling, garbage collection, communicate wit system kernel and sorts of other things, PHP is no where near those fields and those fields are some of the basics of operating systems........ @OP sincerely speaking men php sucks and is for. School kids to g things done, not for enterprise projects |
Re: Let's Be Honest Php Sucks When Building Enterprise Applications by Nobody: 8:01am On Oct 05, 2016 |
islam1001: It's not that PHP can't do all what you listed, It's just not the right tool. I thought you must have changed this mentality after my first post here, PHP can be used for almost anything any other language such as Python can do. From a complete web-server, communication on drones, to running on embedded devices (e.g: raspberry pi) and many other stuff. I think it's high time people changed their mentality of PHP, read PHP Beyond The Web by Rob Aley and I bet you won't come back with the same mentality. That being said, doing most "non-web" related stuff with PHP can be an overkill compared to using a language built for such task. |
Re: Let's Be Honest Php Sucks When Building Enterprise Applications by FincoApps(m): 8:34am On Oct 05, 2016 |
DanielTheGeek: Haven't you noticed that in Nigeria, when something becomes too popular, people start to discourage it Example PHP WordPress BlackBerry ![]() Even WhatsApp at a point Windows OS etc If something get's too much attention, people would start looking for reasons it shouldn't.... @OP, I agree with some of the points but PHP IS NOT JUST FOR SCHOOL KIDS. That's blasphemy 3 Likes |
Re: Let's Be Honest Php Sucks When Building Enterprise Applications by A7(m): 12:09pm On Oct 05, 2016 |
islam1001: Nesting using a ternary operator messes your code, you can have more than 10 nested "if" statements indented below one another. You can even add comments and will be appealing to read. The switch statement also give neater code than the ternary operator. The || and && operators I didn't quite grasp your grouse with the "||" and "&&". Fact is I have no idea what you're trying to demonstrate. If there's any other example and explanation in your arsenal to prove they lag as compared to other languages please grace us with it. In PHP, the names of built-in functions are inconsistent. Is it isset() or is_set()? Is it isnull() or is_null()? Is it sort() or array_sort()? Is it merge() or array_merge()? Even I don't remember. I have to look up the PHP documentation to answer these. I'll let you do the same. Those functions could be easily looked up on Php documentation, or Php website. Just by sparing few minutes to read through, you can get your head around them pretty well. If you're confusing Php functions with other languages's, you have none other to blame but yourself.. Function names are case-insensitive, but variable names are case-sensitive. WHY? You will do just fine if you call a function by its proper wording and casing, same with variable names. And even If the case sensitivity is tweaked the other way round people will still complain. As I've stated above, the vast majority of official and user-contributed documentation is poor. The people that deprecate "magic_quotes" say we're good to go with "mysql_real_escape_string" and "htmlentities" or "htmlspecialchars" or just the prepared statements. In the worst case, you may very well have to pollute your code with things like this. (There are common techniques such as ereg_replace("/\\/", "" Regular expressions will also give us a level of protection with tons of functions like the preg_replace, str_replace, strtr e.t.c and in case of arrays the preg_grep before imploding. If you know the right characters to escape and a good knowledge of regular expressions you will sanitize incoming data with your custom regex codes. |
Re: Let's Be Honest Php Sucks When Building Enterprise Applications by A7(m): 12:20pm On Oct 05, 2016 |
DanielTheGeek: There's actually a function by that name, but it's deprecated. But still Php have other search and replace functions that are more effective than ereg_replace, I listed some above. Somebody is crying wolf where there's none, I think this OP is a "wailing programmer", he complained Php sucks but is against reasonable upgrades and deprecation by Php. 3 Likes |
Re: Let's Be Honest Php Sucks When Building Enterprise Applications by guru01(m): 6:05pm On Oct 05, 2016 |
islam1001:Good for you, if you know php no longer serve you well, move on. No need to criticize the language, when you know it no longer meet your needs. Don't forget it brought you this far. |
Re: Let's Be Honest Php Sucks When Building Enterprise Applications by FrankLampard: 6:27pm On Oct 05, 2016 |
Keep hating eh! The 2 biggest tech firm in history are using it. http://builtwith.com/google.com http://builtwith.com/facebook.com Even Microsoft. http://builtwith.com/bing.com In 9ja here http://builtwith.com/naij.com I forgot to add. PornHub is built with PHP and it is getting 2 billion request/hour. Keep hating eh!!! |
Re: Let's Be Honest Php Sucks When Building Enterprise Applications by Cooldude68(m): 7:45pm On Oct 05, 2016 |
FrankLampard: |
Re: Let's Be Honest Php Sucks When Building Enterprise Applications by ANTONINEUTRON(m): 10:27pm On Oct 05, 2016 |
FrankLampard:wait!! Google using php ![]() |
Re: Let's Be Honest Php Sucks When Building Enterprise Applications by FrankLampard: 10:36pm On Oct 05, 2016 |
ANTONINEUTRON: Stay for there, contiue reading larisoft rubbish articles. Even Amazon uses it too http://builtwith.com/amazon.com |
Re: Let's Be Honest Php Sucks When Building Enterprise Applications by ANTONINEUTRON(m): 10:44pm On Oct 05, 2016 |
FrankLampard:but Wikipedia and All Those Their Engineers for Quora says They use For server-Side{python/for like gmail Java} and JavaScript for front-end one say use other language like php,ruby e.t.c for just prototype |
Re: Let's Be Honest Php Sucks When Building Enterprise Applications by FrankLampard: 10:52pm On Oct 05, 2016 |
ANTONINEUTRON: It is still possible Python is among the language used to build Google because that site builtwith.com can't really show info of site built with Python. You can see that Google runs on pure PHP |
Re: Let's Be Honest Php Sucks When Building Enterprise Applications by kingofthejungle(m): 11:50pm On Oct 05, 2016 |
Google runs on python and java see links abeg https://www.quora.com/What-technology-stack-does-Google-use https://www.quora.com/Does-Google-use-PHP-at-any-part-of-its-technology-stack https://www.quora.com/Which-programming-languages-does-Google-use-internally why will Microsoft leave their asp.net platform to use php 1 Like |
Re: Let's Be Honest Php Sucks When Building Enterprise Applications by seunthomas: 11:53pm On Oct 05, 2016 |
FrankLampard:PHP is not even in use google. From what i know, they use several languages like c/c++,java,python,golang. This are just a few i know of. PHP is really used by big companies, even facebook does not use php, they use hack which is a superset of the php we know. 1 Like |
Re: Let's Be Honest Php Sucks When Building Enterprise Applications by islam1001: 12:10am On Oct 06, 2016 |
FrankLampard: Boss there is not one big company that runs on "Pure" PHP, the day a big company tries it, that day blackhat hackers would hold a big Bash!! |
Re: Let's Be Honest Php Sucks When Building Enterprise Applications by Nobody: 1:01am On Oct 06, 2016 |
seunthomas: It's still PHP man, Facebook had no choice than to find a way to make PHP work for them so they made HACK and the Hip-Hop Virtual Machine. I'd call it PHP on steroids. |
Re: Let's Be Honest Php Sucks When Building Enterprise Applications by Nobody: 1:07am On Oct 06, 2016 |
islam1001: Well WordPress is one big company that have survived with "pure PHP", if you know what you're doing, you'd survive and scale, it'll only be more difficult compared to another programming language. |
Re: Let's Be Honest Php Sucks When Building Enterprise Applications by seunthomas: 5:18am On Oct 06, 2016 |
DanielTheGeek:ITS NOT PHP, is like you saying scala is still JAVA because it runs on the JVM. |
Re: Let's Be Honest Php Sucks When Building Enterprise Applications by seunthomas: 5:23am On Oct 06, 2016 |
For those of you who like to shout "Facebook is using php". Go online and do more research ohh. By the way, if PHP is as good as many of you say, then companies like Facebook wont need to have created Hack. Its because of the deficiencies of the former(PHP) thats why the latter was created(Hack). Me just they think sha. |
Re: Let's Be Honest Php Sucks When Building Enterprise Applications by FrankLampard: 5:49am On Oct 06, 2016 |
kingofthejungle: I know for sure that people love to argue a lot in this forum. builtwith.com can't tell lies, computer can't tell lies. In All those link you posted there is no Google engineer, both past and present answered it. Lastly, so you don't think more than one programming language can be used for a specific purpose. I tire for our mentality self. Slave to oyibo small boys. Nawa. |
Re: Let's Be Honest Php Sucks When Building Enterprise Applications by FrankLampard: 5:53am On Oct 06, 2016 |
seunthomas: It is still called PHP, Hack is just strict PHP. What Facebook did was to create a runtime, that will make their system a faster one. Get your facts. |
Re: Let's Be Honest Php Sucks When Building Enterprise Applications by FrankLampard: 5:56am On Oct 06, 2016 |
seunthomas: So you are saying builtwith.com is lying. Why would you say so? You are disgracing the profession oh. Don't say this outside here. |
Re: Let's Be Honest Php Sucks When Building Enterprise Applications by FincoApps(m): 6:11am On Oct 06, 2016 |
FrankLampard: Wetin larisoft do naw ![]() |
Building A Word Scramble Game With Javascript (text Based) / Academind Course Collection By Maximilian Schwarzmuller / What Is The Future Of Nigeria's Software Industry?
(Go Up)
Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health religion celebs tv-movies music-radio literature webmasters programming techmarket Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 112 |