Live data from Hacker News

Poof and then Rails was gone

patmaddox.com

61–66 of 66 posts

Re: Poof and then Rails was gone

#61
I might just not be very good at this programming thing, but to me these kinds of articles on testing often (not always) remind me of my annoying tendency to implement a comprehensive productivity approach (often combined with buying yet another task app) that, on paper, really should help me keep track of my life. Usually it's a variation on Getting Things Done, which stands out in its exhaustive, all-encompassing, fine-grained approach.

In practice the whole falls apart after a week or so because I forget to do things the right way or because I don't feel like processing my 'inbox'...

Instead, I seem most effective when I write down my top three tasks of the day on a piece of paper.

Maybe I get that feeling because I've mostly experienced companies where testing didn't really seem to have much of an effect. Whenever I asked about this lack of efficacy, the answer was usually "that's because we're not implementing it completely!"

Which is exactly what I hear (and suggest) whenever I or someone else falls off the GTD wagon.

Am I completely wrong about that feeling? I mean that as an honest question, as I truly don't want to be negative and I'm way to inexperienced to be cynical about these things :-).

Re: Poof and then Rails was gone

#62
post #42

Earlier quoted context omitted.

I am also a strong non-fan of faking persistence mechanisms in testing. If you're faking it, you don't actually know that the real thing will work.

That's what functional tests are for. But if you're doing TDD there's no point in constantly running your functional/acceptance tests.

Anything that's not full verification isn't verification at all :)

Re: Poof and then Rails was gone

#63

Earlier quoted context omitted.

The examples in the OP, as in basically every article that describes these kinds of practices, are horribly contrived. The lighter-weight frameworks we have now in languages like Ruby and Python do have abstraction to deal with changing out bits of technology, but they've reached a point where they abstract only the things that experience has shown are likely to change, and support only the changes that are likely to…

> And make no mistake: it is always about supporting the hypotheticals, never about supporting what's actually really needed by the system. > The lighter-weight frameworks we have now in languages like Ruby and Python do have abstraction to deal with changing out bits of technology, but they've reached a point where they abstract only the things that experience has shown are likely to change, and support only the cha…

Let's take a framework I know pretty well: Django.

It's not uncommon to switch from one database to another (say, MySQL to Postgres). Django's DB abstractions keep you from having to really worry about what actual database you're running on; unless you had hard-coded dialect-specific SQL somewhere, you just flip a couple settings and now you're talking to the other database.

Same for changing replication setups, for changing authentication mechanisms, for changing logging setup, for changing how you do caching... all of these are things that can and in the real world do change, either from testing to production environments or over the life of a production application.

So it makes sense to abstract those, and the abstraction is backed by "these are things people have really needed to do frequently".

What I have a problem with, and what I criticize as overabstraction, is when someone then comes along and says "well, what if you replace the persistence layer with something that's not even persistent, like volatile memory or stdout (which is actually logging, not persistence, at that point -- a confusion of concerns!)" And then they write a blog post explaining how really you should keep abstracting to the point that the code can "persist" data to those things.

And that's why I say that the examples almost always feel incredibly contrived; it's like somebody didn't know when to stop, and just kept abstracting everything they could find until they ended up with an overengineered mess. Static/dynamic actually has very little to do with this, since even languages that do static typing in overly-verbose and un-useful ways can handle the kinds of abstractions people actually use.

So I don't see a point in re-architecting for these weird contrived hypotheticals, which always seem to be the focus of whatever we're calling the indirect-abstraction-for-everything pattern nowadays; it produces code that's more complex than necessary, has more layers of indirection (and hence bugs) than necessary, and doesn't actually gain any utility in the process.

Re: Poof and then Rails was gone

#64
post #60

Earlier quoted context omitted.

The best way to keep things simple is to keep them small and composable, right? Like, say, in the Unix way? I'm all for brutally-efficient and single-minded code in domains like mathematics or simulation modeling, where things like object encapsulation maybe don't make a great deal of sense (classic array-of-structs vs struct-of-arrays sort of thing). That said, keeping that stuff neatly boxed and then moving everyth…

The choice is not "monolithic piles of Fortran" or abstraction hell...there is a middle ground. All of your comments on this thread seem to be predicated on the assumption that this blog post is an example of something good . It isn't. It's a complicated, overwrought non-solution to an imagined problem. Nobody here is arguing against abstraction, but abstraction needs to be used judiciously, and the best abstractions…

You and I know there is a middle ground, but there is something very appealing about deriding the (hard) work of building abstractions and meditating on design principles in favor of "get shit done" coding.

This article was an interesting little exploration--mostly point out that by not using rails but by conforming to the interfaces you could do some interesting things. It was a harmless little piece, not something you might want to do in production but interesting nonetheless in its own right.

The tone of my comments is in regards to the top-level objections and phrasing these people are using--"wankery", "architecture astronauts", etc.

Look, I get it; most of us at one point or another have dealt with JavaEnterpriseFactoryBridgePatternAdaptorAnnotationAnnotationFlyweights and have had to meander through scores of abstracted calls to finally figure out something that should've been a direct function invocation. The dot-com bubble hurt many programmers, sure. Enterprise Jabba is a bloated king in a crumbling castle; whatever floats your boat.

There are people--in this very thread!--who are arguing against any abstraction. They do so in the name of performance, and in the name of domain modeling, and in the name of a dozen other half-articulated little fears and inconveniences.

I've had to deal with code written by academics that implemented brilliant solutions to some problems, and yet remained impenetrable. If asked, "figure it out yourself". These are the same chucklefucks that don't comment their code, that are uncooperative on projects trying to clean up and make libraries out of their work, and generally are people who think that making it out of a doctorate program with a paper about their tiny slice of new human knowledge somehow grants them any weight whatsoever in discussion about software engineering or working on teams.

It makes sense that they'd be against abstraction--them and the trading folks and game developers and everyone else whose livelihood depends on excruciatingly-specific implementation details which are nothing more than an artifact of their time, a form of technical arbitrage which pays for their miserable existence.

Of course they hate abstraction, because it is very hard to convince somebody of something when their livelihood depends on them not understanding it!

Re: Poof and then Rails was gone

#65
post #59

Earlier quoted context omitted.

> why in God's name did you use Rails Because it is actually a very good, mature application server with lots of sane defaults and good, mature plugins, even if you aren't using a database. Basically, people are interested in using it for more complex applications than you are, because lots of its conventions are still quite good for those applications, even if it makes sense to reject or reconsider some other conven…

> using it for more complex applications than you are Are you sure? How complex do you mean? How complex do you presume the parent commenter's apps to be? Could you give an example of one of those more complex apps? I'm wondering if I'm currently building apps of the "simple" or "complex" variety, according to your terminology.

It actually wasn't my terminology... If you read the parent of my comment, the self-proclaimed complexity was, literally, "MVPs which are mostly CRUD apps". I think most Rails applications I've used defy that description, and I don't agree with that comment that it is "the entire reason for Rails existing" any more than I would agree that the entire reason for PHP existing is to make personal home pages.

Re: Poof and then Rails was gone

#66

Earlier quoted context omitted.

> but why in the world would you want to do that? To get your tests to run in > but why in the world would you want to do that? Build better software faster

Test speed is not the only limiting factor in your ability to produce better software faster. Readability, comprehensibility, and approachability all matter too, and this architectural technique is bad for all of those.

> Readability, comprehensibility, and approachability all matter too, and this architectural technique is bad for all of those.

That's a matter of opinion.

Post reply on HN