Complaint-Driven Design

Plenty of good ideas here from Jeff Atwood. I love the passion he shows for his new venture:

Have your team and yourself start using that minimum viable product, every day, all day long. This is way more than mere software development: it’s your whole life. If you aren’t living in the software you’re building, each day, every day, all day … things are inevitably going to end in tears for everyone involved.

Now, need a customer service mindset for this approach, and a band of dedicated, cross-discipline engineers prepared to roll up their sleeves and get things done. But if you have that spirit and belief, the project can succeed.

The only thing I’ve ever seen work is getting down deep and dirty in the trenches with your users, communicating with them and cultivating relationships. That’s how you suss out the rare 10% of community feedback that is amazing and transformative. That’s how you build a community that gives a damn about what you’re doing – by caring enough to truly listen to them and making changes they care about.

Leave a comment

Filed under Programming, Soft skills

Book Review: The Broken Window, Jeffery Deaver

BrokenWindowAnother in the Lincoln Rhyme/Amelia Sachs series from Jeffery Deaver – this one is pretty good and hints at the dangers for society with the growth of corporations that store massive amounts of data about private citizens.Four starts

Leave a comment

Filed under Book Review

Book Review – The Enigma, Andrew Hodges

EnigmaI don’t usually read biographies, but this excellent biography of Alan Turing was given to me as a gift and I found it fascinating. There are plenty of plaudits for the treatment Andrew Hodges has given his subject and I agree he’s done a first class job. Even more so if you read the author’s notes at the end of the book and appreciate just how little material was freely available and the personal hardships the author entailed in order to write the book. His sources were the biography written by Turing’s mother and the academic papers/records available. Subsequent to that, Hodges interviewed many of the main players in Turing’s life in order to reveal much of the character of the man as well as to fill in the gaps in his life history.

For me, Turing was famous for the Universal Turing Machine and the Turing Test – it’s interesting to learn that he also touched other areas of pure mathematics and science.  The technical details on his approach to writing computer software are just as relevant – given that he was involved in the earliest computers in the 1950’s and the biography was written in the 1980’s, it’s great to know that Turing exhorted the earliest programmers to factor their code into sub-routines and to test their software!

Another lesson to learn from the biography was that, whilst Turing was happy to work individually and largely avoided self-promotion, that approach limited his opportunities.  If he had been more savvy in this regard and been more amenable to building working relationships, who knows how much more he would have achieved.20130322-204818.jpg

 

Leave a comment

Filed under Book Review

Book Review – The Black Box, Michael Connelly

TheBlackBoxThis is another Harry Bosch novel from Michael Connelly. I liked some of the back story where Bosch duels with his new statistics-led boss and has to get creative in order to continue with the investigations that matter to him. I found the main plot rather tenuous and didn’t buy into it – not one of Connelly’s best.20130418-193203.jpg

Leave a comment

Filed under Book Review

Dijkstra on System Design

This paper by Dijkstra was linked from a discussion on ArsTechnica about system design. It’s amazing that many of his high-level points remain true today, despite being published in 1968 – I’ve picked out a few below:

Focus:

Production speed is severely degraded if one works with half time people, who have other obligations as well. This is as least a factor of four, probably it is worse. The people themselves lose time and energy in switching over, the group as a whole loses decision speed as discussions, when needed, have often to be postponed until all people concerned are available.

Star developers:

The intellectual level needed for system design is in general grossly underestimated. I am more than ever convinced that this type of work is just difficult and that every effort to do it with other than the best people is doomed to either failure or moderate success at enormous expenses.

Unit testing:

It seems the designer’s responsibility to construct his mechanism in such a way —i.e. so highly structured— that at each stage of the testing procedure the number of relevant test cases is so small that he can try them all and that what is being tested is so perspicuous that it is clear that he has not overlooked a situation.

I’d add to the list that it’s vital to spread knowledge within a team to maintain productivity and avoid one person being silo’d to a specialist skill and becoming a bottle neck. Instead, find out how to pull the source code out of the repository, how to build and test it – and start making small changes yourself as a learning exercise.

Leave a comment

Filed under Programming, Soft skills

The importance of layered architectures

ArsTechnica hosts a number of discussions on software development, and arguably none more important than layering.

Understanding one thing at a time is easier than understanding two things that only make sense when used together … Rules of thumb such as “No cyclical dependencies” or “Dependencies must only reach down one level” simply capture the practically achievable limit of the fundamental idea that one thing at a time is easier to understand than two things.

Whilst interfaces and abstractions buy you immunity to change for a given class/component, a layered architecture buys you the flexibility to swap out an entire layer of technology. That’s something that can happen surprisingly frequently in the corporate world – need to replace MFC with Silverlight then with WFP then with HTML5? No problem if your architecture is layered such that none of the business models need to be re-released for the change. Similarly if a game-changing Hadoop solution is rolled out for your data storage – a well layered architecture can remain impervious. But mix up all that logic so that models source data and user interfaces call into low-level analytics – you’ve got a migration nightmare on your hands.

Leave a comment

Filed under Programming

Going Native 2013 – Don’t Help the Compiler, Stephan Lavavej

This presentation from Stephan Lavavej could have been entitled “Compiler Knows Best” – he rockets through numerous examples where the advice is to write less code and let the compiler do the right thing.

Here’s a slide of one of the key messages:

20140207-183930.jpg

Other highlights for me:

  • decltype(auto) coming in C++14 looks very cool (eliminates duplicate code when using auto with decltype for late-specified return values)
  • Don’t call std::make_pair( x, y ) – the T, U are inferred by template argument deduction, so should always be left out (unless you want to force a type conversion when T != typeof(x) e.g. short -> long
  • Use nullptr because it is convertable to all pointer types, but 0 and NULL are always type int

I love the new features of C++11 and couldn’t have written some of the cool libraries I’m working on without them. But – presentations like this make me concerned for the complexity of the language and the steep learning curve that even experienced C++ hires will have to climb.

Leave a comment

Filed under C++, Programming, Video

Why do std::shared_ptr and std::unique_ptr have different template parameters?

Interesting question on StackOverflow – Why does unique_ptr take two template parameters when shared_ptr only takes one?

I haven’t used std::unique_ptr much and wasn’t aware that you could supply a custom deletor.

If you provide the deleter as template argument (as in unique_ptr) it is part of the type and you don’t need to store anything additional in the objects of this type. If deleter is passed as constructor’s argument (as in shared_ptr) you need to store it in the object. This is the cost of additional flexibility, since you can use different deleters for the objects of the same type

Since unique_ptr is lightweight and doesn’t have the overhead of a control block, it uses a template parameter for the deletor. std::shared_ptr takes the other choice since it already has a control block and gains the extra flexibility.

Leave a comment

Filed under C++, Programming

Going Native 2013 – Effective C++11/14, Scott Meyers

Scott Meyers presented three guidelines from his upcoming new edition of Effective C++:

  • Understand std::move and std::forward
  • Declare functions noexcept whenever possible
  • Make std::threads unjoinable on all paths

The advice on std::move and std::forward echoes thoughts from Scott’s earlier presentation on Universal References. This time, he also talks about efficiency and points out that some standard library methods (such as std::vector::push_back) won’t move unless it can do so using noexcept methods. This is the motivation for the second guideline to use noexcept whenever possible on these key methods (move operators and swap).

The guideline on std::threads harks back to the ongoing discussions in the standards committee – when a joinable (“running”) thread is destroyed, should it block/detach/terminate. Scott advises to use RAII to force the behaviour that you want, and presents a simple class for that purpose.

Leave a comment

Filed under C++, Programming, Video

Herb Sutter GotW95: Thread Safety and Synchronisation

Excellent article on thread safety and synchronisation from Herb Sutter.

A race condition occurs when two threads access the same shared variable concurrently, and at least one is a non-const operation (writer). Concurrent const operations are valid, and do not race with each other.

Guideline: A type should only be fully internally synchronized if and only if its purpose is to provide inter-thread communication (e.g., a message queue) or synchronization (e.g., a mutex).

Leave a comment

Filed under C++, Programming