8 ms·
I come from a C++ background, and early last year tried my hand at web development. After hearing about all the stuff about how PHP was an "old", kludgey langu
by kjackson2012 14y ago
I come from a C++ background, and early last year tried my hand at web development.
After hearing about all the stuff about how PHP was an "old", kludgey language, I tried to learn python, and go the webpy. It was doable, but I kept running into issues all the time.
I gave up and switched to PHP, and I have to say that it was a much easier experience. For the most part, everything just worked. Regardless of how kludgey its history is, how inconsistent the syntax is, etc, it really does work well. I'm now doing PHP development at my current job and it's been fine.
One thing I learned from a previous job was the saying "Your customers don't care about your technology. They care about you solving their problems." If you are solving their problems, they will pay you, regardless of whether or not your back-end is CGI, perl, PHP, or whatever.
- venomsnake 14y agoThe problem with php is that is scales terribly with the size of the codebase. Try to move away from the comfort zone of the language and the size of the project and it changes a lot.
- michael_miller 14y agoIf this is the case, then maybe PHP's role is a rapid prototyping language which is replaced when the codebase gets to a certain size.
- fleitz 14y agoGenerally that size is not more than about 5 files.
- icelancer 14y agoYeah good one. Wordpress is a great example of a huge failure written in PHP over 5 files, right?
- jessedhillon 14y agoYes, it is a "good one." Wordpress' source looks like spaghetti with shit sauce. The fact that it runs is a testament to something, but not the readability, maintainability, or usability of the code base. Those people wouldn't know a well-designed API if, well, fill in the rest here.
- icelancer 14y agoGood point. Must be why no one uses it.
- jessedhillon 14y agoWhatever else you are, you're not too stupid to see what's wrong with this argument. So the fact that you're forwarding it anyway means you can't make a real point, or you are trolling.
- flyosity 14y agoThe codebase of Wordpress is an utterly terrible, offensive, kludgy, hacked-together mess of spaghetti code. The last time I looked at the internals it still lacked a coherent MVC structure. There are big, good things built with PHP, written the right way with solid software engineering principles, but Wordpress is not one of them.
- Sander_Marechal 14y agoThe opposite, actually. PHP's shared-nothing architecture makes scaling a breeze. Just add more hardware.
- mercurial 14y agoI believe you misread parent. The size of the codebase has little to do with the resources needed by the software.
- fleitz 14y agoPHP works fine as long as you're never exposed to a better way. In a year or two start using rails. You'll come back to PHP and wonder why anyone would ever make a hammer with two claws.
- jtreminio 14y agoYou're confusing a language with a framework. A more apt comparison is rails with symfony2 or zend framework2.
- LaRakel 14y agoYou're right. Still I can compare doing web development using ruby on rails with doing it in php without a framework. I've done both, rails was much more pleasurable. See? I just compared the overall experience of a language with that of a framework.
- jtreminio 14y agoYou just did it again. Why would you compare Ruby on Rails with PHP? Do you realize what you're saying? edit: replied to you as if you were fleitz. Point stands as you basically parroted what he said.
- citricsquid 14y agoAre the sort of people writing straight PHP the sort of people who would be using rails? Try a PHP framework like Laravel and then compare that to Rails.
- fleitz 14y agoI took a look at that, it appears that you unzip the framework and then start modifying it directly. After you "upload it to your webserver". Deployment? Source Control? No, not in PHP, you just modify shit right on the webserver. I'm sure this process makes upgrading painless, just unzip the framework and... wait... all your changes just got overwritten. This kind of crap is exactly why everyone with a clue laughs at PHP.
- pippy 14y ago"PHP Should Be Implementation Neutral, and Support All Paradigms Equally". This is what I like about PHP. When you want a 4 page site, you can use procedural and functional programming. When you're working on an enterprise level CMS you can whip out the OO paradigm and you're set. PHP is a messy soup but it does web better than most other languages.
- taylorbuley 14y agoOne nice side affect of this is that PHP can suit both novice and experienced programmers. Newbies don't have to learn OO before they write Hello World.
- laurent123456 14y agoThat's also a problem because anyone with a day experience in PHP can claim to be PHP developer, and often companies can't really tell the difference between an experienced and non-experienced programmer. If they can do PHP, they can build our website and we end up with horrible unmaintainable code. I think that's why PHP has such a bad reputation.
- drusenko 14y agomaybe we should all switch to brainfuck for web development then so we can weed out the stupids [/sarcasm]
- rybosome 14y agoI get your point, but being easy to pick up AND easy to make dangerous mistakes is a bad combination. The goal isn't necessarily to "weed out the stupids", but rather to prevent bad practices from propagating. "Too easy", in my view, means having a rotary saw with no guard and a hair trigger.
- nnq 14y ago...naah, any kid can learn Brainfuck in a weekend ..."real" programmers don't even need a 100% Turing complete language to get the job done: choose Malbolge instead! (http://en.wikipedia.org/wiki/Malbolge http://en.wikipedia.org/wiki/Malbolge)
- BenoitEssiambre 14y agoI don't do much PHP anymore but I can see the appeal coming from a c/c++ perspective. When I was doing PHP I felt closer to the metal than I feel with Python now. A lot of the PHP libraries looked like thin wrapper over well known c libraries. Instead of shoehorning everything to make it PHPonic, the function calls were similar to their c counterpart. You could sometimes even read the man pages for the c libraries if you needed extra details on how the internals worked. There was a simplicity to this that was appealing to me. The lesser amount of magic and abstraction meant I could more easily visualize what was happening under the hood and find bugs quickly.
- shawn-butler 14y agoIf you have experience in c++, I have used Wt [0] previously for webdev and found it pretty straightforward (it's like Qt for the web) and extremely performant. Dual license GPL/commerical. [0]: http://www.webtoolkit.eu/wt#/features http://www.webtoolkit.eu/wt#/features
- rplnt 14y ago> everything just worked. That's the scariest thing about the language. The php will run whatever you write in the script; assuming things, hiding errors, etc..
- jtreminio 14y agoIt sounds like you've never properly programmed in php a day in your life. Stop spouting nonsense. If you're going to develop in php, you do so in strict mode with all errors turned on. Doing otherwise makes you part of the problem.
- TylerE 14y agoI'll accept this argument when PHP starts shipping with sane defaults. It's only quite recently that register globals got turned off in the default config.
- jtreminio 14y agoGlobal registers were deprecated in 5.3.0, and completely removed in 5.4.0 http://php.net/manual/en/security.globals.php http://php.net/manual/en/security.globals.php 5.3.0 is 2 and a half years old.
- TylerE 14y agoand many shared hosting providers are still on 5.2, and many crappy old scripts require register_globals on.
- jtreminio 14y agoI'm not sure what you're saying here. Are you faulting PHP for versions that are nearly 3 years old? Would you find it a fair comparison if I talked about how bad Rails (framework) is if I was talking about a version that was 3 years old? Every language has its share of horrible programmers. PHP simply makes it easy for those horrible programmers to flourish. Making it easy does not mean the language itself is bad, because when you're ready to stop being horrible, the language is willing and ready to get you out of the muck.