109 points · by niekmaas · 15y ago · 163 comments
I think good TDD/agile/architecture cultures are more prevalent in ruby/python but as those languages have become more mainstream the quality of the average dev in those environments has dropped quickly. A few years ago only really good devs ventured into ruby stuff. Now everyone is trying it as the tools have made the language much more accessible for the average developer. I am seeing more and more programming mistakes in the ruby code I dive into than I used to.
Language choice doesn't matter too much from a technical perspective. It matters from a practical perspective. Consider the jQuery/prototypejs war. Prototypejs was technically superior for a long time, yet due to jQuery's more accessible plugin culture and prettier web site they were over time able to build a more robust community and took the mindshare lead in the js space. I still think one of the core reasons ruby/rails and python/django got big is that for a long time there was only one major framework available for the language and this caused a better community than the php landscape, which pre-dated frameworks by a long time (this happened to perl as well). So there wasn't "one true way" in php to build apps quickly, and this hurt the php community when rails got big. I think as a community we lost a lot of talent to ruby/rails in the last few years.
Bottom line is that accessibility, pervasiveness and low-learning-curve are critical to the initial and continued success of any platform, whether it's a language (ruby > php > perl), OS (ios > android > rim), etc.
Language advances in PHP (circular gc, traits, closures, etc) have brought php's language capabilities forward enough that it's a respectable platform for sticking with. However, you can't fix the community really since it's so fragmented. Fortunately some frameworks are getting enough traction to have rich ecosystems, and that's definitely a great thing for the language and the community.
I am not a super-dev, but I can write code in an unfamiliar language in a day or two (non-idiomatic, of course). Better people than I can do better, I am sure.
I am sure you will be able to find great engineers if you open up your playing field.
I am amused by the perception that a pro software engineer is assumed to only be proficient in the programming language they used in their last job. If an engineer is applying for your job, talk to them and make sure they are a good personality fit for your team. They are probably going to take more time understanding your dev tools and procedures than boning up on PHP.
Anecdotally, I took a job as Rails developer some years back. I had zero experience with it before starting (Having worked mainly with PHP before), but because the environments are so similar (http is the same, gnu/linux is the same, mysql is the same, architecture and oop is the same etc. etc.), I was creating value after about three weeks and I would say that I was fully up to speed after something like 3 months. Consider that it can easily take the same time to get the business, the problem domain and your new colleagues to know, I'd say that the cost for my employer was close to nothing.
Now, I'm not saying that anybody can do this - I consider myself a fairly good developer and beside PHP, I have tinkered with a broad spectrum of languages, which surely helped my transition. And the point isn't that Ruby is such an easy language that it can be learned in 3 weeks either (In fact, I think it is a rather complex language). What I take from my experience is that a good (and diverse) developer, with a motivation can jump from related technologies with relative ease.
I do agree with your sentiment that it might be easier to sell a jump from php than to, but that is a different problem. If your project is interesting in it self, I'm sure you can find good developers who don't fret too much over what particular language they write in.
If somebody's got the attitude that 'Java sucks, I only want to code Ruby', that person's not a pro in my book.
Can you expand on that at all? What made Protoype technically superior?
(this is all with the understanding that prototype adding methods to standard objects was dangerous...)
I believe I meet your criteria but can only work remotely. I am currently looking so if remote is an option please let me know and I can send you more details.
I'm talking about Wordpress and vBulletin.
While MVC isn't the only valid design pattern, some varient of it is rather nice when working with websites and these two seem to ignore it through and through. Testing? What's that?
I know that better can be written in PHP, but for apps that I've had to deal with, PHP normally looks like an overpowered scripting language that's just a mess. I'll stay with Rails and Sinatra when I can.
MediaWiki is all over the place and the themes included in the install are just horrifying. Whoever made the original (monobook) theme should get slapped in the face.
Why am I calling "validate_purchase" on the server?
Client Clicks Buy -> JSONP to Payment Gateway -> Gateway to Server (with all the info) -> Server to Client Confirming Transaction
All my server is doing is recording the transaction and forwarding the info to the client. The gateway is trusted, since they are processing payments.
I'm serious. This is where we're headed. Yes, you will have a hell of a lot of server-side code on the gateway, but that's a service, not the application.
Matters for a single 15 years-old developer. Deployment is never easy when you get do anything non-trivial, and the cheap hosting... hosting for other languages start at $5 or $10... The only cheaper hostage PHP has is free.
> good documentation
That's highly debatable. I've also seen the PHP doc comments being pimped, I could never find anything worth more than a laugh in that cesspool.
Node.js wins for deployment if you ask me. Node.js + riak handily beats the pants off of the LAMP stack. It's so easy I'll tell you how to do it right now:
1. Install node, ./configure && make && make install
2. Install riak, make all rel && mv rel/riak /usr/local && export PATH="/usr/local/riak/bin:$PATH"
3. Install your app: scp -r remote:/my/app /web
4. Install dependencies: cd /web/app && npm install
5. Run your app: node /web/app/do/something/cool.js
Back to my coffee.(I'm being somewhat facetious and these instructions don't get you startup services and such, but I do believe that Node.js stacks are much simpler than traditional stacks and easier for devs that have to wear the sysadmin hat too)
It's just as easy to get mod_python working as it is mod_php.
Let's take your VPS example. Install nginx, gunicorn, and your database of choice. Set up gunicorn to serve your app, set up nginx to serve static and proxy to your gunicorn instance. Do any app-specific setup.
That doesn't take any longer than deploying a PHP app, at least not for me.
Can't speak for rails, but for Django we're talking 15 lines and a pair of commands for a clean setup:
* Create a virtualenv with all your dependencies and your django application checked out (0 lines)
* Extract static files to whatever directory you're serving static files from (1 command in 1.3)
* Create your wsgi handler script (4 lines, because you have to setup the DJANGO_SETTINGS_MODULE env)
* WSGIScriptAlias and the relevant directory allow (5 lines)
* WSGIDaemonProcess and WSGIProcessGroup configuration directives (2 lines)
done.
* Arrays are created with array() as opposed to a more modern [].
* Arrays are not objects, so you have a ton of functions in the global namespace starting with array -- array_join() as opposed to $array->join().
* The functions are not consistent. Half of them don't have "array_" as a prefix. The order of arguments isn't consistent with other parts of the standard library.
I'm really curious about why you consider this a strong point of PHP.
When people want to pick nits about this or significant whitespace it makes me think that there must very little variance between the languages if THIS is the issue that deserves scrutiny. Am I missing something about array() vs [] ?
if you really hate typing array(), http://codepad.org/ASREdjTK
When I work with an unfamiliar class in Ruby, or come back to something familiar (say, Array) after a long time away, I'll often not "know" the exact method signatures for what I want, but I'll just guess something reasonable based on my knowledge of the language and idioms. And, lo and behold, most often it works!
Having to "remember" (does this method use array_?) or "translate" is a mental tax; there's cycles wasted that could keep your mind in the business logic.
> When people want to pick nits about this or significant whitespace
> it makes me think that there must very little variance between
> the languages if THIS is the issue that deserves scrutiny.
For the record: this is not the issue that deserves scrutiny. The other issues are more significant.However this "short array syntax" is representative of PHP's sluggish internal development process. [] is very nearly the de-facto solution for creating arrays, and yet the PHP core devs have, for two years, rejected[1] patches that implement it on ridiculous grounds.
Finding the argument order for a method takes ~3-5 seconds. Its irrelevant. array() vs [] is actually a bigger deal as its indicative of php's verbose syntax. But its not a killer.
People like JS because it got the fundamentals right. The bad parts are just details. PHP is bad because it got the fundamentals wrong. But people still harp on the details.
What? Why is [] better? Because it saves you typing 5 extra characters?
A lot of little details make a big difference.
In my view the only problem with PHP array functions is the fact that the naming scheme is an absolute disaster (as it is all over PHP, for historical reasons).
For example, let's say you've got a string like 4|1|45|343|22. You want to return a string with the last three numbers, but seperated by a comma and a space.
In PHP:
$arr = explode('|',$str);
$last_three = array_slice($arr, -3);
return implode(", ",$last_three);
In Python: return ', '.join(str.split('|')[-3:])
Small conciseness improvements snowball as the codebase gets larger. In fact, being unable to chain functions in PHP is actually my biggest beef with the language. If you could do return implode(', ',array_slice(explode('|',$str),-3));
that'd be a lot less annoying. Still not as good as the python, but a lot closer.This should help you.
I think this is a bad feature and causes bugs. In Python there's a fail fast feature, where it'll throw an error if you go past the end of an array. It's places like this were bugs creep in. In python, you find out that there's a problem with this array, in PHP you have to hunt around and only later look at the array X lines above where the bug manifests.
they are all hashtables so you can use them as both arrays and lists
Python dicts (i.e. hashtables) are better than PHP arrays. PHP arrays only have number or string keys, so you can't use arrays as a key in a PHP array. You can in python.
foo = mydict[key] # Throws exception if key does not exist
foo = mydict.get(key) # Returns None if key does not exist
PHP foreach compared to Python foreach: # PHP
foreach ($arr as $value) {
echo "Value: $value<br />\n";
}
# Python
for value in arr:
print "Value: %s<br>" % value
# PHP
foreach ($arr as $key => $value) {
echo "Key: $key; Value: $value<br />\n";
}
# Python
for key, value in arr.items():
print "Key: %s Value: %s<br>" % (key, value)Awesome PHP is awesome.
Downvote? Really? Pfft.
I would personally pick another language if I were doing something from scratch, but the benefit is that it is a language others are already familiar with and so adding a framework like Yii isn't too hard.
I still recommend that people new to Kohana start with 2.x because a framework is worth a lot less without quality documentation, when you have to go read the code all the time. Not that you shouldn't do that eventually, there's a lot of good code in there to learn from!
Really, Kohana needs more documentation....
I guess, nobody ever accessed that.
I wouldn't ever expect to convince anyone who had ever worked on an old CF site to move back to CF ever again (believe me, I'm still scarred from it) but it's actually pretty good these days (Railo, that is).
My experience isn't limited either; Rails, Django, Flask, .Net (Umbraco), CodeIgniter, Drupal to name a few. They all have their warts. I hate to say it but in my experience Railo (CF) is way more performant than any of them.
Even JBoss has an open source CFML distribution, http://www.getrailo.org/ so the whole cost argument is mute.
CFScript is JavaScript (ECMAScript)
No it isn't, by any stretch of definition or imagination.In fact, I think Ruby has more in common with ECMAScript than CFScript does.
That and utterly unreliable servers, to the point of having a process running under Windows to restart the server when it accumulated, say, 50 pending requests.
I'll never touch it again.
The key here, as it states, is that they "built their own framework/libraries", which essentially means nothing to indie-devs and other small non-well-established companies who want to build something...
So the trend is simply this:
1) We use PHP because it's what we know, easy to get started with etc.
2) It gets us by while we build our business
3) Profit! Re-factor our codebase, in PHP!
Thus, the blog post should read: "Hey Mailchimp is doing awesomely, so we refactored our PHP codebase with our very own custom framework!"
It's not that PHP is all bad; it just lost the "framework wars" IMO, and I think when companies come out and state things like this, it kinda proves it...
I don't think everyone is doing that (building frameworks), or can, or even should when they're other possibilities outside of the PHP world...
I never really understood this argument. I mean, the overlap between Ruby and PHP are so great that they are virtually interchangeable.
(Hint: copying files to a server is not how real applications are deployed.)
> But if you considering building anything today on PHP (when you have sooooooooo fucking many better platforms) you are incompetent and plain stupid, because it will be a big technical debpt for the whole project.
I think we have a bunch of stupids like facebook and mailchimp... Php or any other programming language is a tool, a proven one. So if you can do some amazing things go for it.
"You use X then you are an idiot. Y is for masters !" approach is childish and proves that you can only use Y technology.
Probably better than finding a good dev in other languages for web development considering all the good PHP developers are still using PHP, and all the ones that couldn't cut it went on to learn the next LotM.
Honest answer: The same chance of hitting a good dev regardless of the language.