Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I just watched this talk by Greg Young warning people to KISS: Keep It Simple St

ID: 642806 • Letter: I

Question

I just watched this talk by Greg Young warning people to KISS: Keep It Simple Stupid. One of the things he suggested is that to do aspect-oriented programming, one does not need a framework. He starts by making a strong constraint: that all methods take one, and only one, parameter (though he relaxes this a little later by using partial application). The example he gives is to define an interface: public interface IConsumes { void Consume(T message); } If we want to issue a command: public class Command { public string SomeInformation; public int ID; public override string ToString() { return ID + " : " + SomeInformation + Environment.NewLine; } } The command is implemented as: public class CommandService : IConsumes

Explanation / Answer

Is he trying to write a "straight to TDWTF" AOP framework? I seriously still haven't got a clue what his point was. As soon as you say "All methods must take exactly one parameter" then you've failed haven't you? At that stage you say, OK this imposes some seriously artificial constraints on my ability to write software, let's drop this now before, three months down the line we have a complete nightmare codebase to work with.

And you know what? You can write a simple attribute driven IL based logging framework quite easily with Mono.Cecil. (testing it is slightly more complicated, but...)

Oh and IMO, if you aren't using attributes, it isn't AOP. The whole point of doing the method entry/exit logging code at the post processor stage is so that it doesn't mess with your code files ans so you don't need to think about it as you refactor your code; that is its power.

All Greg has demonstrated there is the keep it stupid stupid paradigm.