News for hackers. Stuff that matters.
Re:Technical debt as an opportunity to accumulate technical ... by 0xfaded on Monday August 15, 2016 @03:11PM (#12292680)
I would argue it would be simpler to introduce test coverage tools that automatically call out bad test coverage during code review.

Microservices remind me of a particular C++ protocol implementation I wrote as a novice programmer. Since the protocol was structured, I had high level classes broken down into simpler classes. e.g.

  virtual class Reader {
    void read(Buffer *buf);
  };

  class TCharacter: public Reader {
    TString *name;
    TList<TStat> *stats;
    ...
  };

  class TStat: public Reader {
    TWord32 *remaining;
    TWord8 *percent;
  };

  class TWord32: public Reader {
    uint32_t v;
  };

  class TWord8: public Reader {
    uint8_t v;
  };
And on, and on, and on, and on ...

I thought it was cute that down to the simplest PODT, every type satisfied a well defined `Reader` interface. I hand wrote many constructors, deconstructors, read and several other interface definitions for each type.

Elegant, arguably. Inefficient, yes. Overly complex, undoubtedly.

Every argument for microservices has in some way reminded me of this code, with it's well defined interfaces and overly verbose implementation.

My current strategy is to utilise the crap out of language features to safely achieve what I want in the minimal amount of code possible. In C++ this would be done by initialising the protocol structure classes straight out of the memory buffer, using #pragma pack as required. No error prone constructors / deconstructors / read() required.

Haskell and Scala are two languages I use a lot, and each have powerful type systems which I can use to prevent myself from doing something stupid. Programmable macros are great for removing boilerplate. Want less technical debt? Write less code.

In my own controversial opinion, if somebody can't work out how to modify my code because they can't work out how to correctly update the type definitions, that person has no business modifying my code. Problem solved! Interfaces are well defined and modifiable only by people who truly understand the code.

Re:Technical debt as an opportunity to accumulate technical ... by ScottBurson on Monday August 15, 2016 @03:50PM (#12292918)
> Want less technical debt? Write less code.

I love this Dijkstra quote: If we wish to count lines of code, we should not regard them as "lines produced" but as "lines spent": the current conventional wisdom is so foolish as to book that count on the wrong side of the ledger.

Re:Technical debt as an opportunity to accumulate technical ... by bluejekyll on Monday August 15, 2016 @04:21PM (#12293113)
When I was in College, I really only appreciated Dijkstra as a genius who invented neat multi-processing techniques.

As a formal Software Engineer, I now consider him to be possibly the most enlightened engineer that's ever existed in the field.

Re:Technical debt as an opportunity to accumulate technical ... by duaneb on Monday August 15, 2016 @05:21PM (#12293552)
> As a formal Software Engineer, I now consider him to be possibly the most enlightened engineer that's ever existed in the field.

On one hand, his quotes have the ring of wisdom. On the other, the man was famously not an engineer and never brought a software project to fruition, to my knowledge.

These aren't necessarily contradictory, but you should keep it in mind. Knuth is much more of an engineer in the sense it's used on HN.

Re:Technical debt as an opportunity to accumulate technical ... by bluejekyll on Monday August 15, 2016 @07:33PM (#12294378)
Knuth is brilliant and wonderfully pragmatic, no doubt. I think the greatest thing Knuth really got into me is that code is meant for people, not computers.

As to Dijkstra; enlightenment doesn't necessarily mean productive. Some of the least successful people I've ever met, can have absolutely sage like advice. Dijkstra was able to visualize things others could not, and explain novel solutions to those. On top of that he had a deep understanding of the life of a programmer and the complexities faced day in and day out.

Re:Technical debt as an opportunity to accumulate technical ... by geon on Tuesday August 16, 2016 @08:19AM (#12296930)
> Some of the least successful people I've ever met, can have absolutely sage like advice.

You learn from mistakes. Unsuccessful = many mistakes?

Re:Technical debt as an opportunity to accumulate technical ... by jhayward on Tuesday August 16, 2016 @09:07AM (#12297186)
The kind of creativity and acceptance of uncertainty that leads to insight is often at odds with the narrow focus get-it-done tenacity associated with success. Some people have more of the former without the ability to switch to the latter.
Re:Technical debt as an opportunity to accumulate technical ... by ht_th on Tuesday August 16, 2016 @07:22AM (#12296674)
Dijkstra worked as a programmer at the Mathematisch Centrum (mathematics center) in the 1950s. He was responsible for most of the systems programming of three subsequent machines that were build and used there. His PhD dissertation (1959) was on the operating system he wrote for the Electrologica X1 computer that was being built by the first Dutch computer industry Electrologica.
Re:Technical debt as an opportunity to accumulate technical ... by computerex on Monday August 15, 2016 @04:14PM (#12293064)
The primary offering of microservices is decoupling and simplicity. They are language agnostic, communicating via HTTP /messaging/pattern matching. It's the opposite of verbose and traditional monolithic architectures that relied on a rich domain model. Microservices should be small enough to be owned by a single developer. With pattern matching, you can extend functionality by creating new microservices instead of modifying existing ones. It boils down to change management. For complex systems, the benefits microservices bring to the table make the overhead cost of maintaining these services worth it.
Re:Technical debt as an opportunity to accumulate technical ... by dasil003 on Monday August 15, 2016 @10:01PM (#12295022)
The problem which I don't see discussed nearly enough when people start drinking the microservices koolaid is what does the interface between the microservices look like? If you can define a nice stable interface that changes much less frequently then the constituent services, then it's mostly a question of operational overhead. However, if the microservices comprise many cross-cutting business concerns, then the churn on the interfaces is a massive source of pain compared to (for example) running one process that loads multiple modules where you can leverage all the power of that languages to do basic wiring / type checking ensuring the whole things fits neatly together.

IMO, microservices or SOA or whatever you want to call it, is primarily a method of organizing large teams so they don't get hamstrung by ops coordination. In that case you absolutely need it, but for smaller teams the overhead will usually far outweigh the benefit. I'm glad the space is being explored so that we get better tooling and techniques to lower that overhead, but when the dust settles I expect many small teams will discover that we collectively overestimated the better-understood pain of monolithic architectures and underestimated the less-understood pain of microservices.

Re:Technical debt as an opportunity to accumulate technical ... by 0xfaded on Monday August 15, 2016 @04:37PM (#12293225)
> Microservices should be small enough to be owned by a single developer

This seems bad for code review, and disastrous with turnover. Whoops, now we need to find a scheme engineer whose eccentricities are roughly equivalent to this last guy.

There are also ways to achieve microservice-like architectures without requiring multiple code bases. See Actors (scala akka). Streams are an extension which give automatic load balancing. And if you need it to run over the network, akka-remote has you covered.

Re:Technical debt as an opportunity to accumulate technical ... by hinkley on Monday August 15, 2016 @05:16PM (#12293523)
I've not been happy with this kind code ownership in the past. Those who want to misbehave have a nice comfortable place to hide out while appearing relevant because they have a monopoly on an idea that they don't have the skills to be responsible for.

So then you have your coworker who wrote a wrapper around the code to sanitize all of the inputs and outputs and it's bigger than the actual code and once in a while it guesses wrong about ambiguous data.

Re:Technical debt as an opportunity to accumulate technical ... by duaneb on Monday August 15, 2016 @05:22PM (#12293562)
This somewhat sidesteps an advantage of microservices that they are language agnostic.
Re:Technical debt as an opportunity to accumulate technical ... by 0xfaded on Monday August 15, 2016 @05:34PM (#12293653)
I've never been convinced this is an advantage.

Ryanair (the discount carrier) has a fleet of 354 boeing-737s.

This means they cannot fly some routes the bigger jets can, and other routes they burn more fuel than the smaller jets would.

BUUUT ... maintenance and logistics are drastically cheaper and efficient.

By analogy, I would argue that costs sunk either in training or hiring for specific skills will pay off in the long run.

Re:Technical debt as an opportunity to accumulate technical ... by twunde on Monday August 15, 2016 @07:05PM (#12294190)
I will say that it can be an advantage, but it's rare. It becomes an advantage when your primary language lacks the tools to do something well. One of my previous companies was a PHP shop and they used Python to chop up audio files, which would have been very cumbersome to do in PHP (few if any existing libraries). My current company implemented complex data pipelines in PHP, which really should have been done in a different language (python or scala would have been natural choices).
Re:Technical debt as an opportunity to accumulate technical ... by gedrap on Wednesday August 17, 2016 @10:07AM (#12304766)
I am in a very similar situation right now and I totally agree with you on this one.
Re:Technical debt as an opportunity to accumulate technical ... by crdoconnor on Tuesday August 16, 2016 @06:17AM (#12296480)
>The primary offering of microservices is decoupling and simplicity.

Microservice architecture is very much orthogonal to loose coupling. I've worked on several microservice architectures with tight coupling. The microservice aspect actually exacerbated the pain caused by the tight coupling because it added the risk overhead of serialization/deserialization and network failures, which simply don't exist in a 'monolith' context.

Microservices when implemented are usually either a reflection of conway's law (ID team in building B has its own service; as does the CMS team in Europe), or fashion-driven development (one team working on 17 different services... which can be nasty).

Re:Technical debt as an opportunity to accumulate technical ... by crdoconnor on Tuesday August 16, 2016 @06:14AM (#12296471)
>Want less technical debt? Write less code.

Also: write less powerful code.

* Replace 'clever' metacode with straightforward imperative code where possible.

* Replace imperative code with declarative code where possible.

* Replace declarative code with configuration where possible.