Tuesday, September 9, 2014

Callback Hell Awaiting ES6 Heaven - Promises (Hebrew)

A lecture I gave on Callbacks, promises, and async/await style programming in Node.js.



Wednesday, April 23, 2014

Finally - a concise post explaining what I feel about TDD

http://david.heinemeierhansson.com/2014/tdd-is-dead-long-live-testing.html

Superb quote:

The current fanatical TDD experience leads to a primary focus on the unit tests, because those are the tests capable of driving the code design (the original justification for test-first).

I don't think that's healthy. Test-first units leads to an overly complex web of intermediary objects and indirection in order to avoid doing anything that's "slow". Like hitting the database. Or file IO. Or going through the browser to test the whole system. It's given birth to some truly horrendous monstrosities of architecture. A dense jungle of service objects, command patterns, and worse.
Yes!
And what is the answer?

I rarely unit test in the traditional sense of the word, where all dependencies are mocked out, and thousands of tests can close in seconds. It just hasn't been a useful way of dealing with the testing of Rails applications. I test active record models directly, letting them hit the database, and through the use of fixtures. Then layered on top is currently a set of controller tests, but I'd much rather replace those with even higher level system tests through Capybara or similar.

I think that's the direction we're heading. Less emphasis on unit tests, because we're no longer doing test-first as a design practice, and more emphasis on, yes, slow, system tests. (Which btw do not need to be so slow any more, thanks to advances in parallelization and cloud runner infrastructure).
Yes!

And again, yes!

 

Sunday, March 30, 2014

Towards a better programming

The other day, I came to the conclusion that the act of writing software is actually antagonistic all on its own. Arcane languages, cryptic errors, mostly missing (or at best, scattered) documentation - it's like someone is deliberately trying to screw with you, sitting in some Truman Show-like control room pointing and laughing behind the scenes. At some level, it's masochistic, but we do it because it gives us an incredible opportunity to shape our world.

-- Chris Granger, Towards a better Programming

While it seems that Chris is trying to do what others have already tried, and failed to do, (intentional programming, anybody?) Chris' description of the programming universe is spot on!

But I wish him luck! And hopefully he'll succeed.