3 ms·
Someone else may have mentioned something like this, but I can't find it, so I'll chime in. Transitioning to Ruby or Python or Scala or anything else will not
by mgkimsal 16y ago
Someone else may have mentioned something like this, but I can't find it, so I'll chime in.
Transitioning to Ruby or Python or Scala or anything else will not make anything magically better. I recently converted a Rails project to Grails (actually, I'm in the middle of the conversion). I'd thought "it's Rails - we'll just go in and fix the current issues". It was a horrid nightmare of undocumented crap. It was started in 2006 - Rails 1, and had been added on to for nearly 4 years, and was still Rails 1 (1.2). No useful inline comments, no unit tests, undocumented magic method overrides for basic stuff that wasn't compatible with future Rails versions, and so on. It was horrid. But hey, it's Rails, right? Must be magically better than PHP!
I went back and forth on whether to rewrite in PHP or Grails, and either would have been fine. Why? Because part of the rewrite process is to use modern techniques - with a big helping of TDD tempering the process. Oh, and version control. Yeah - 4 years of a project with 0 version control is not fun to deal with.
So... I'll take PHP with a team of people using sane schedules, TDD/testing, version control, internal and external documentation, and other niceties, over Ruby for the sake of Ruby. Now, modern Ruby/Rails with all those niceties vs PHP with same niceties? Probably a more even draw, with no clear cut choice. But that doesn't seem to be brought up in these discussions.
Frankly, most of the stuff people point to as awesome about Ruby (or Groovy, in my case) in isolation can be detriment - metaprogramming in general can be confusing to someone new to the code without proper documentation as to what's being done. Whether those docs are in tests, inline or external is beside the point. Typically when I come in to a new code base in any language the documentation just doesn't exist (or, better yet, it's "self-documenting"... right...).
End of rant - PHP really is fine when used with proper development techniques. Most languages are. In my experience problems start (and get worse over time) when people rely exclusively on the language alone, rather than language + commonly accepted dev techniques.
- raganwald 16y agoYou'll take language X with team A and process 1 over language Y with team B and process 0? Help me understand what, if anything, this says about languages X and Y?
- mgkimsal 16y agoIn some ways it doesn't, which was the metapoint. People get extremely hung up on "php sucks" or "python rules" or "C# kicks ass", but the language is only one portion of the equation. How the language fits in to the bigger process of development is a huge factor that is often/usually ignored in these discussions. No, actually, the teams (people) could be the same. It comes down to lang X with sane processes (testing, documentation, version control, etc) vs lang Y with no (not enforced, standardized, adhered to) processes.
- raganwald 16y agoThat isn't a strong meta-point, it's like saying it isn't the bike, it's the cyclist. Sure Lance can beat me on a junker bike. But he can't win the Tour on a junker. So if you want to succeed, and you have a choice about language, you still need to pick the best language for your circumstances. The importance of people and process doesn't invalidate that any more than the importance of Lance Armstrong invalidates the importance of bicycle engineering in the Tour. All that being said, I agree with the last sentence of your comment. It's just that I don't meet many people who say that with the right language they don't need anything else, so I'm not sure who you're debating. For example, all of the Rubyists I know fetishizes testing. None of them have ever said to me that thanks to Ruby, they no longer need tests. What they actually say is that Ruby makes testing easier, which is your point. So yes, process and people are important, we all agree. So who, exactly, says anything to the contrary?
- mgkimsal 16y agoI see where you're going, and I'm probably not as clear as I wanted to be (and probably don't have time to be!) The ruby community is interesting because of the testing focus, which possibly negates my point a bit. However, I meet plenty of Rubyists who are so focused on tests (which are easy to do because of the language) that they eschew documentation, of any kind. I've talked to more than a few Rubyists who are now in the 'my code is self-documenting because Ruby is so elegant and my method names and variables are so awesome and I can metaprogram anything I need that there's 0 need to have any comments or documentation - just read my code and the awesomeness of Ruby will overtake you'. I don't particularly care how elegant your code is, having some inline comments will not hurt. Having external documentation, and sane commit log comments, and so on, are vital in my view. I'm not picking on Rubyists here specifically, that's just the few that spring to mind.
- NathanKP 16y agoI agree. It isn't the language which makes the project good. A bad programmer will write bad code no matter what language they use, and a good programmer should be able to write good code in any language, even PHP. Perhaps once a language becomes mainstream, and is adopted by many people, not just the early hacker adopters, the perception of the language as clean and elegant goes down. This isn't necessarily because the language has changed, but because the average person using it has become less skilled. Languages that are comparatively new and shiny are mostly used by the much more talented early adopters, and thus seem to be more professional and clean. (This is just speculation, so feel free to disagree if your personal experience doesn't reflect this.) Of course some languages make it easy for inexperienced programmers to write bad code, but this doesn't mean that good code can't be written in that language. In fact, I would go so far as to say that if you are a decent programmer you should be able to write clean, reusable, DRY, efficient code in just about any language. So as far as your argument goes I agree. The important thing is the team doing the programming, not the language they are programming in. If they are a decent team they will be able to do good development in PHP, or any other language.