Quick doesn't have to mean dirty
me.veekun.com
me.veekun.com
> when did learning become bad?
This is when you hit on what I think people mean when they use the "just get stuff done" argument. What they mean is they can get stuff done now, without having to learn anything along the way or think too hard.
Sometimes that's defensible, deadlines and real life and all. Most of the time it's defensiveness because they know they are getting less stuff done and that stuff is lower quality because they didn't take the time to learn better tools and stuck with the training wheels.
> hip guys in class who write cool code in Ruby or Python
How out of touch do you have to be to think that people are using Ruby or Python because they are hip unknown languages? I have literally gotten this same statement thrown at me (to be fair, he had two young kids so he really was out of touch and had good reason to be).
I've seen the exact opposite: at least three PHP projects that got snowed under by "attempting to write something mindblowing", and zero Python projects that had the problem.
I think that the truth behind the meme is that there is a certain level of intermediate programmer who has learned that doing things right saves time in the end, but hasn't yet internalized YAGNI and KISS. So this programmer discards PHP and picks up another language and is all excited about this new world of doing things robustly! "I'm going to write the best UUID generator. I'm going to unit test every line of the admin console. I'm going to make an ORM that batches queries in the most efficient way." And because these things weren't necessary, and the programmer is still intermediate, they can't get those things done and get the actual application done in anything approaching reasonable time. If the programmer is forced to use PHP, basically the same thing happens; just with object inheritance, and curl_multi, and novel configuration file formats, and so on.
It's a cliff of enlightenment, and if you fall off it too hard, you might reject the enlightenment itself. Ignorance is bliss!
I think all good programmers should be somewhat selfish and care about their needs, not just the user's, because this helps them grow and makes them better, which in the long run is better for the user too. The "user doesn't care" mentality embraced by so many managers leads to lots of long-run pain and sometimes, paradoxically, even to business failures, because not keeping your "coders" (I utterly dislike this word, btw) happy is really BAD for business.
The underlying point here is that you can get something out the door quickly and have it not be a Jenga tower held up by duct tape. I'm sure there are plenty of people who can do that with PHP and I don't mean to imply otherwise; I'm only asserting that it can also be done with Python.
I think you could even go further: doing things The Right Way is not slower than doing them "dirty", it is actually faster.
Those "quick and dirty" guys always throw some "god machine" thing that never worked as an example of The Right Thing. It is wrong. The Right Thing is just the correct amount of forethought and architecture for the problem at hands. The Right Thing leads to no overengineering, because overengineering is wrong. Doing The Right Thing leads to things like Vim, Git, Python, Postgres, coreutils, etc. Note that none of these is perfect. But they have 1) sane basic assumptions 2) some level of internal coherency that allow them to be reliable tools one can build upon.
The problem with evangelizing the Right Way is that the benefits tend to come later; if you haven't experienced the pain of dealing with the Wrong Way's fallout once it hits critical mass, it seems easy to brush off. "SQL injection? Pfft, no one cares enough to attack my site." "Transactions? I only write one or two rows at a time anyway." "Templates? What's wrong with string formatting?"
Our profession is a bit lacking in context. Nobody believes the lessons of others. (Granted, we're so crazy that half the time we learn the wrong lessons.)
Still a young discipline, though. Maybe we'll grow out of it.
We know what are cars pretty well, and spaceships too. We know how they work, how to build them so they don't break easy, how to check for their health, etc.
But we have no firm grasp on software, we have no (economically sustainable) way to build them rationally and safely. Bugs are piling and the more we remove the more they are. No widely accepted method allow us to build software that has a quantifiable guarantee to work as planned under a fixed approximation interval. Etc. We programmers know that. Software development is at alchemy (magic) stage.
Funilly, this guy did specially point at OOP, saying that this was adding even more uncertainty to the mess. All that is well explained in SICP, and FP might be one of the strings we should pull to us out of the dark ages of software engineering. IMO.
We have languages with built-in async support (and some that fake it decently), languages with syntax for safe and unsafe pointer use, languages that bundle impurity away from everything else.
It's a slow process, since any new language has a massive uphill battle to gain any traction. But I think we're getting there.
This article is a list of best (or at least the author's favorite) practices for Python.
I'm so tired of reading a person banging on PHP and then hyping up best practices for another language. As if nobody can be productive with PHP or would choose it for a new project. Or that PHP doesn't have better practices than what the authors have experienced.
If you like Python, that's great. So do I. Just get over it, these threads are so lame.
Uhh... Heard of automated testing?
It makes absolutely no difference what language you write your code in, whether it's PHP, Python or Brainfuck - reliability is dictated by your testing strategy, not the language. In the PHP applications I write, the only things that break are the things I didn't test.
I suggest watching this: http://www.youtube.com/watch?v=9G77f9_tOSM
Also reading this https://plus.google.com/u/0/104920553571646483561/posts/fmyZ...
I actually mentioned Haskell in the post because coworkers have lamented not having its type system, which would immediately find problems at compile-time that we otherwise have a very very hard time thoroughly covering with tests.
The really really hard part is still checking that a given page "isn't broken"—something that's easy for a human to spot but hard for a computer—for all possible combinations of state. But very strict typing would at least make the output less likely to break.
What's so insanely monumental about writing unit, functional (i.e. like these http://symfony.com/doc/current/book/testing.html#functional-...) and Selenium tests to cover everything before committing new changes? It's just like any other code - test the main condition and edge cases and everything will be running smoothly next time you come back to that feature.