Thursday, December 20, 2012

Fizz Buzz in APL

I came across the Fizz Fuzz programmers test and just couldn't help myself programming it in APL:

p←0=3 5∘.|l←i←⍳100
l[,p[1;]/i]←⊂'Fizz'
l[,p[2;]/i]←⊂'Fuzz'
l[(,∧⌿p)/i]←⊂'Fizz Buzz'

And that is the way it is done (the code is self explanatory :))


http://www.codinghorror.com/blog/2007/02/why-cant-programmers-program.html

Wednesday, December 19, 2012

Software inovation by law

At one point in time, some people figured out that the world was full of selfish bastards that would leech off each other and therefore smart people would not innovate because all their hard work would be stolen. The patent was invented and this allowed inventors to work on difficult problems and if succeeding  be rewarded in the end. The leechers however have discovered that they can use the patent system for their own benefit. Instead of patenting stuff that represent a great effort they patent simple every day things like rectangles, colors or human gestures.

So now the patents are no longer used to defend the innovative from the bullies. Instead the bullies uses them to keep the innovative from being innovative. By having a vast amount of patents on everyday things and by keeping them to you self until someone has violated them, you effectively keep anyone from creating anything new unless they can afford a patent war against you.

In other words, it no longer depends how good your ideas are but how much money you have. I hope someone with the power to be heard one day figures this out and requests the system to be changed. Patents should only cover things obtained through some kind of effort, and patent owners should be forced to license the use of their patents to others. Color combinations or shapes are not to be claimed by anyone as their property! That's just my opinion...

Tuesday, December 18, 2012

Happy Happy Joy Joy.. Learning a new programming language

A year ago I started a new job. The company that is now my employer has a lot of code written in an old and obscure language called APL. So I have had to sit down and learn APL.

APL is short for "A Programming Language" and being invented in 1953 it is a very old language. For me its a fresh new approach to programming. Instead of spawning from electronic engineers, APL comes from the twisted mind of a mathematician. That means that the language does not origin from abstracting processor instructions, but from what would be useful for doing math. This makes it an extremely high level language that is very powerful once you wrap you head around it. APL sees the world as vectors and matrixes (single dimensionned arrays and multi dimensioned arrays for the rest of us). Once you have your world defined in arrays, you will be amazed by the expressiveness that APL provides.

I recently listened to hanselminutes where they talked about F#. One of the key points with F# was how little code you had to write to accomplish anything.  The example given was Conway's game of life. Ruby could do it in 140 characters. F# weighed in with an impressive 127 characters. Compared to APL these languages are however very verbose. APL does the same thing in only 38 characters. To be fair, this problem is right down APL's alley as 'twodimensional array' is a native type of APL.

http://tryapl.org/

To begin with APL is completely unreadable. First of all, the character set used is not present in you favourite font. Secondly there is no operator prescedence in APL, Expressions are evaluated from right to left.

  • 3 + 4 = 7
    returns 3 (4 is not equal to 7 and returns 0, 3 is added)
  • 4 * 0 + 4
    returns 16 
  • etc.
Example code from wikipedia:
(~R∊R∘.×R)/R←1↓⍳R


This code finds all the primenumbers up to R.Remember to read this from the right. ⍳R creates a vector  containing the numbers from 1 to R. 1↓ drops the first element of that vector. The new vector is assigned to R. The / in this context means a filter, it will filter the vector on the right by the binary vector(elements are boolean). 
R∘.×R produces a matrix(double sided array) containing the product of all combinations of numbers found in R. R∊ produces a binary vector of all elements in R that are also on the right. The binary vector is inverted by ~ and the filter is applied. Voila, a vector of prime numbers.

All in all it's great to learn a new language that is so different. This probably will never be language of choice but it has given me a different perspective on the other languages I use.

Thursday, August 09, 2012

Unit tests are not all black and white

And they are not all red or green either. From a management perspective it might make sense to divide unit tests into the ones that pass, and mark everything else as an error. After all, this is what is confirmed to work and what is not.



From a development's perspective this approach makes less sense. The main goal is still to get all unit tests in the green zone. It's just that some of the test that do not pass are not errors that need immediate attention. Some of the error may already be planned to be fixed in the future, configuration problems or dependencies on resources that are not available at the moment of the test run.

Take for example a test that uses a database (i known that technical it is not a unit test). You want to test that some updates are done correctly. If for some reason the database is down and you can't get an open connection to the database, would you fail the test? My suggestion is that you don't. The test is not about getting a connection to the database but about doing the update.

They way I like to use unit tests is to utilize the ignore or inconclusive state of tests. If it is some configuration,  some 3. party component missing on the test machine or some error that is scheduled in the future I like to take them out of the errors in need of immediate attention.



I have seen panicking because hundreds of tests fail just because the password of the database user had changed. This should maybe fail in a single test that verifies that the database is accessible, but not the whole test suite.


It's a good idea to prioritize your tasks, and by using levels of severity in your unit tests you can optimize your bug fixing efforts a bit and focus on the errors that are real.

Tuesday, August 07, 2012

Recursive lambdas

More and more programming languages supports a functional approach to programming. the functional approach gives a more compact syntax that for some people will be easier to read because everything can be kept together.

In C#, lambda expressions take us closer towards functional programming. An important concept of functional programming is recursitivity which in many cases can replace loops.

I pulled up my old base conversion algoritm and gave it a try. Basically it takes an integer and returns a string respresented in a base of your choice.

Integers to Text

The variable chars contains the characters used in the output. For a conversion to base 16 (hex) the first 16 are used etc..
C# doesn't let you reference something that is defined in the same line, so the signature of the lambda is defined in the previous line. The actual conversion is all written in one line of code and I'll let you decipher it yourselfes. Because of the recursion, no loop is required. It will basically calls itself for every character to be output. As C# doesn't support tail recursion (this is not completely true, but I won't count on it anyway), recursive code in C# has a limit to how many times a method can call itself.

I also did one that goes the other way.

Text to Integer
What i have now is two methods so that I can convert from any base (limited to the length of the charset used) to any other base. this is how i convert a hex number into base 3.

Console.WriteLine(format(parse("AF3D",16),3));



Thursday, July 26, 2012

Inline, nested if statements

The ?: operator was something I had to get used to when I first saw it. I allows you to define a conditional if statement on a single line with a build in assignment. This compacts a lot of code and once you get used to it it's quite readable.


var <result> = <if-condition> ? <true value> : <false value>;


This can, among other things, be used to translate values. In the following s will contain the text "Small" if i is less than 3, otherwise "Not Small"


int? i = 4;
string s = i<3 ? "Small" : "Not small";

Whatever is behind the colon, you can replace with a new inline if statement. Now its an if/else if/else statement on a single line.

string s = i<3 ? "Small" : i==3 ? "Three" : i>3 ? "Large" : "Not a Number";

Which gives the same result as.

string s;
if(i<3){
   s = "Small";
}else if(i==3){
   s = "Three";
}else if(i>3){
   s = "Large";
}else{
   s = "Not a Number";
}

This is even better when used in lambda expressions as a "standard" lambda expression only allows one statement. 

Console.WriteLine(
   GetInts().Select(i=>i<3?"Small":i==3?"Three":i>3?"Large":"Not a Number")
            .Aggregate((x, y) => x + "\n" + y)
);

Wednesday, January 25, 2012

Era of the XAML user interface

I hear the term XAML user interfaces mentioned way too often these days.

XAML has in fact nothing to do with userinterfaces. XAML is just a language for instantiating an object structure. I have previously written about how I have used it as a configuration language for my applications, a sort of light weight dependency injection framework. To show that WPF and Silverligth are not the only UI frameworks that can be used with XAML I have used XAML to create a small Windows Forms form.

The root node of my XAML file will be Form. By providing "clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms" as the default namespace Visual Studio and .net will recognize the elements and validate them to match a structure that is allowed beneath a form. If you need to use other .net namespaces, you just add a prefixed xml namespace for each of those .net namespaces.




Visual Studio will pr default open a WPF/Silverlight visual presentation along with the text editor when opening the XAML file. As we are not using WPF or silverlight the visual presentation will not show anything usefull. The XAML can be distributed as a file besides you application, embedded as XAML or embedded as BAML (XAML compiled to a binary format). The BAML approach is probably the most sensible solution for a real life application.

To create an instance of the form just give the XAML stream to a XamlReader and cast the result to a Form object. Now the form can be displayed by calling Show, like you would on any other windows form.


When the form object has been created, i use two lines of code to hookup some eventhandlers before showing the form. The find method on the form is an extension method for Form that flattens that flattens the structure of the form so that LINQ can be used on it. The generic type is a filter that only returns the controls of that type and the lambda is a further filter. The find method has been implemented in the plain framework, so you can go there to se the implementation.
The Do method is just like the ForEach method on List, this however work for any type of IEnumerable<T>.

The first of the two lines finds all buttons whose name start with "Command" and hook them up to an event handler. The second line hooks an event handler to the TextChanged event of all controls whose name start with Value. In this way it is easy to use a naming convention to hook the UI up to business logic. Dependind on your architecture, you might hook it up to fire commands or whatever.

You might implement some layout manager the same way, or you might inherit panel or something other control and create a layout manager that way. By implementing you own controls you can also put metadata on the controls in your UI.

So, XAML has the potential of being used with other UI frameworkds than WPF and Silverlight.

http://dotnetexception.blogspot.com/2008/04/xaml-ultra-lightweight-ioc-container.html

Thursday, January 19, 2012

Suitable Business model?

I have created a prototype for an application.
  • I know there is a market for what the application does as there are existing products that have same target audience.
  • Existing products are VERY pricy.
  • The product is simpler and easier to maintain than existing products in the market.
I just have one problem. How should I put this to market?

A way could be to make it open source. This has worked for me with plain. Plain was however a theoretical experiment, a playground for thougths on how simple and easy application architecture could be made. There was never a plan for a final release because the process was more important. The no limits and no constraints meant that we could implement a search filter framework that resembled Linq a bit before we ever heard of Linq. A validation framework much like the one now found in nHibernate and ASP.Net Mvc 3 etc.. But plain intentionaly lacked one thing that I would like my new project to have. Exposure and usage.
  • Open source the product and commercialize tools and support.
  • Open sourcing everything.
  • Make everything closed source.
  • Some others I haven't thought of.

This is a more finite problem and I want to work towards a releasable codebase. Will a enterprise product ever be popular if it is cheap?
Will it be possible to have a differentiated licensing model for hobbyists and enterprises. Will this model result in a greater usage? Is it at all possible to have the kind of openness and transparency I'm looking for if the project is not open source?

Wednesday, January 18, 2012

Declarative structure initialization

I'm on the lookout for a Dependency Injection framework for .net that supports a small, compact and declarative syntax. I want it to be so easy that non programmers can figure out what is going on.

My first thoughts were on XAML as it is simple and declarative. The reason for not choosing this anyway is that it doesn't support generics in a nice way. By not in a nice way I mean very verbose and strange. On top of that XAML is not implemented on mono.

Springframework and Castle Winsor is also too verbose for my likings. Although they are very good, they still require me to define my object at one place and reference they together in a structure somewhere else. Thsi is not a bad thing, I would just, also, like the possibility to create the objects in the structure inline where they are needed.

Another solution could be to consume code and execute it. This ofcorse is also way off compared to what I want to accomplish.

Any Ideas on what path to follow?

Wednesday, January 04, 2012

Wishlist: Derived generic parameters

In .Net generics gives a nice way to make type agnostic code that are not limited to a specific type.

The following two types are taken from the plain framework.

interface IBusinessEntity<T>{
    T Id {get;set;}
}


interface IDao<T,TT> where T : IBusinessEntity<TT>{
    T Get(TT);
    TT Save(T);
}


As shown you can use gemeric types as generic parameters for other types. In the IDao interface, I have specified that T must be a IBusinessEntity interface with the TT type as a generic parameter.
In my example I will create a Article class that implements the IBusinessEntity interface and a generic Dao implementation

class Article : IBusinessEntity<int>{
    //some code
}


class Dao<T,TT> : IDao<T,TT>{
    //some code
}



Now I want to get a dao for the class you just created. As Article has int as a generic parameter, the Dao objects has to defined with the article type as well as int to be able to compile.

var dao = new Dao<Article,int>();

Once you apply "Article", the only valid type as TT is "int". If you apply anything else, the compiler will let you know that "Article" is not valid. The reason for this is that in the definition of IDao, T has a requirement for T, not TT.
It has been bugging me that the compiler complains about the type of T and not the type of TT. T is the important generic parameter, and TT could just be derived from that.

In future releases of .net I would like to be able to write the following.
interface IDao<T<TT>> where T : IBusinessEntity<TT>{
    T Get(TT);
    TT Save(T);
}



This way I could specify TT as part of the signature, but as TT is derived from what type T is, I would only have to specify T when using it.
When creating the dao I could then write.

var dao = new Dao<Article>();

This is a small improvement, but it would remove some strange dependency error when using multiple generic parameters.

Thursday, November 10, 2011

Mostly immutable

I have had the "pleasure" of working with BizTalk on a few projects now.

I will save my general impression of Biztalk for another post. This is just to mention a undocumented side effect in BizTalk.

One of the key things in BizTalk is that all messages are immutable. I have found this to be mostly true.

In the following Message_1 and Message_2 are messages and should be immutable (except for in the block that constructs them)

Variable_1 = Message_1;
XmlSplitter.GetSFPage(Variable_1,0,2);
Message_2 = new System.Xml.XmlDocument();
Message_2.LoadXml(Message_1.OuterXml);



Message_1 is constructed elsewhere and yet we are able to change it by loading it into an XmlDocument. the above code is XLANG and I think it's a bug that the first line of code does not clone the message.

Wednesday, June 15, 2011

Token based credit cards

Like so many others I have an account on the playstation network. I also have accounts on iTunes and on Amazon. What these services have in common is that they save you credit card information on their servers so you don't have to type them every time you need to buy something from them.

This makes it very easy for users to buy stuff from them once the users are logged into their systems. This design however has some serious flaws. A problem is that all the informations needed to withdraw money from your credit card is registered on each service provider. You have more or less handed out a master key to your bank account. Online trade is based on trust and although I do trust these sites not to misuse my creditcard details, they are just managed by humans and are therefore not perfect.

What I would like to see is some kind of token based credit card for the internet. For any site that would like to persist my credit card information I could create a token that they could use to withdraw money from my credit card in the future. This way I could remove their access to my credit card without closing the card entirely. If the token was compromised I could see from which site they got it.
If the tokens included knowledge of the site it was to be used with, it would also be possible for banks to invalidate all tokens issued for a specific site such as Playstation Network.

I just think the current creditcard technology on the net seems a bit outdated.

Friday, April 08, 2011

XPath - fixed!

As you might have read in my previous post, I'm not too happy about the way the XPath works with namespaces.

To make things better I have created some regular expressions that will allow me to write XPaths the way I want to write them and still have them work with real XPath engines out there. It makes the XPath ignorant towards namespaces that are not defined in my XPath query. Namespaces that are defined in my XPath query will be handled like before.

if(!xpath.StartsWith("/")){
xpath= "./" + xpath;
}
xpath = Regex.Replace(xpath,@"/(?[\w]+)\[","/*[local-name()=='${node}' and ");
xpath = Regex.Replace(xpath,@"/(?[\w]+)","/*[local-name()=='${node}']");

PS. I'll get back to the post and tidy the code up later

Saturday, April 02, 2011

namespace mismatch

Once in a while you come across technologies that on their own are great, but put together are painful. Either you just live with the pain, you deselect one of the technologies or you try to improve the way they interact. This is the case with namespaces and xml/xpath.

Let me just explain that I am a big fan of XML and of XPath and XMLSchemas. They are related and work quite nicely. The schemas describe the data structure and can be used for validation. The XML is the datastructure and XPath is the query language for searching in the datastructure. Together these are very powerful.

Over the years I have heard a lot of people complain about XML, but often they are using it for the wrong purpose, they don't know the power of XPath to assist them or they are drowning in namespaces and prefixes in their xml documents.

Namespaces in xml are introduced to allow cross references across schemas and thereby allowing reuse of schemas. Every namespace, other than the default namespace, is given a prefix. For loosely structured documents this enables the writer of the XML document to specify on every single element, in what namespace it is defined. A good example of that is the XSLT documents. Here prefixes helps the writer of the xml validate only the elements that are part of the XSLT transformation logic. For this purpose namespaces and prefixes are great.

What I generally see with custom xml structures however is that the structure is more strictly defined and name clashes are less likely.

If I were to define the way xml and xsd would work with namespaces I would make the namespace prefixes optional on xml nodes where type and namespace could be derived from its placement in the structure. If the schema eg. only allows for one type of "address" element at a given location, why should I specify what type of address element it is? Only where name and type clashes occur would I demand namespace prefixes.

Namespaces should be treated as metadata of elements. They are just for validation and identifying the type of an element where name clashes could occur. For everything else they are irrelevant.

That brings me on to XPath and namespaces. Namespace information is metadata as far as XPath is concerned and you have to ask for the details if you want to use it in the query. It's a different story with prefixes. Actually the prefix is part of the name you can search for. This makes absolutely no sense as prefixes are only valid within a single document, and a the next document you receive might have other prefixes but be just as valid. The impact is that you have to make your XPath queries quite verbose to ignore the prefix and it really is a painful experience. If I could redesign XPath, I would make XPath ignore the prefixes of elements to be the default behaviour. Actually I don't see where anyone should use the prefix knowledge in a search.


Tuesday, January 18, 2011

When descission makers are clueless

It's a well known fact that you don't have to know anything to make a descision. Not knowing anything really speeds up the process of descisions and in some cases the descisions are just as good. In some cases they come with a price of being worthless or even disasterous.

When you don't know about what you are to descide upon a common aproach is to seek advice by somebody that know something about the subject.

Clueless descissions are most destructive when done in higher management because the consequences are often bigger. This includes politicians that are elected to make descissions. In Denmark there have rescently been some bad examples of such descissions regarding IT.

  1. Descissions about open document standards. Politicians kept OOXML in the loop although there was a better alternative that was more open at that time.
  2. NemId was chosen as the new authentication for citizens of Denmark when communicating with the goverment. (about taxes and stuff). I have used it and its work nicely from the end users point of view. The problem with the solution is that is uses certificates with public/private keys...  The private keys are placed on a centralized server. They have broken basic security principles and I think that is a problem.
  3. Rejsekortet is a new way of paying for public transportation. To do this they implemented their own encryption algorithm. The system has not been put into production yet, but the encryption algoritm has already been broken.
  4. Digital elections. Computers can be used for almost anything else. Elections part of a democratic proccess is not part of what computers can be used for. Pure electronic elections don't support recounting of votes and tampering with all votes can't be guarenteed. Elections of less importance, with truely trustworthy third parties can be implemented. Everybody has a interest in a democratic election and there is no trustworthy part that can ensure that the votes are not tampered with. It has been decided by politicians that electronic elections will be tried out.

Dynamic method binding

One of the added features to C# 4.0 was dynamic objects. It gives late binding to C# so everything doesn't have to checked at compile time. In some cases this makes it a lot easier to use reflection as you don't have to use any of the .net API's to do so. You can act directly on the object as if you had the type at hand. All you need to know is the footprint of what you need to access. Most examples emphasize how this can be used when integrating with other technologies like old com objects etc, but I have been looking for usages outside that scope. One is ofcourse reflection, another one is dynamic method binding that I will try and explain.

Basic OO with cats and dogs.



I create the traditionel object structure to support me explain what I mean. Animal is a pure abstract concept, Cat is an Animal and so is Dog.

Make the animals make som noise
I have created a MakeSound method that operates on the interface and one for each of the classes. As there is no general sound that will match any animal I just print ????? to the screen when in the context of Animal.
What I want is to have a list of animals containing cats and dogs and then call the MakeSound for each animal in the list.
As in C# < 4.0
The big question is what method is actually called. The answer is that the method binding is done at compile time, the best match is the method that takes the interface as a parameter. All the objects are treated as of type Animal. This is the way it has always worked in C# and it should therefore be no surprise if you have been in a similar situation. The output is as follows.

Result of program with static method binding

Use of var keyword

With C# 3.5 the var keyword was introduced. One might think that this changed the way this would work as the programmer no longer defines the type and the framework should therefore be able to select a better method implementation automatically. The answer is that the var is just a way to have the compiler derive the type instead of the programmer. This is all done at compile time and the best match will therefore still be the method that operates on the interface.

Handle the objects as dynamic instead
The dynamic keyword was introduced with C# 4.0 and this changes the possibilities when writing code like this. When treating every object in the list as a dynamic object, the compiler won't bind to any method but will leave it to the runtime to make the connection. This means that the type of every object is considered and handled on its own and the items in the list won't nescesarily result in the same method being called. This can be very usefull when iterating tree structures etc. The downside is that you will have no intellisense and no compile time validation when writing the code.

As the best methods are now called, the output will be cat and dog specific.

Output when treating the objects as dynamic
This can definately clean up some of my code. I might write a comment along with the code so that people in the future can figure out my intentions.

Related posts:
Wrapping objects with interfaces
Dynamic duck typing in .Net 3.5

Monday, September 13, 2010

Testers vs. Developers

Some time ago I read somewhere that Microsoft had problems getting software testers in Denmark. They were puzzled by this as they found the workforce to be educated and they had no trouble finding developers.


Although testers and developers should share some common knowledge of technology, their personalities are completely different. Good developers need to be inovative to be able to find solutions to problem they have never seen before. They should focus on the big picture and always strive for the best compromise. Good testers on the other hand have to focus on details and they need to be able to repeat an exact action and follow a script. The qualities wanted are opposites and it will most likely never be possible to find a person that posseses both.

Links:



http://www.version2.dk/artikel/14884-test-er-fy-ord-i-jobannoncer-microsoft-kan-ikke-hyre-danske-software-testere

Friday, August 06, 2010

5 years and still going

Yesterday it was 5 years since I started this blog. I started it because I needed somewhere to let steam out. (And I actually started it together with a friend) I wasn't sure I would be able to continue posting to it but after 5 years I still have issues I want to share (with myself). Luckily the world never stops changing and I never stop discovering things I hadn't thought of before.

The focus has been from very technical to philosofical about human nature. I'm looking forward for all the new blogpost that I am to write :)

Wednesday, June 23, 2010

Trust me, I know what I'm doing

Trust is important to any social relationship or communication. While I was out for a run I listened to a podcast about this and it really made me think. It stated that trust is also good for business. If you trust your surroundings you will be more open for doing business. Societies based on trust have a higher growth than societies that do not incorporate trust. This is a great message that I will try to spread around.

On a personal level you will gain a lot by trusting other people as well. By doing so you can benefit a lot more from other people. If you for instance are an employer, but don't trust your employees the only value they can add to your organisation is doing the stuff you though of to begin with. Once you trust your employees, they will be able to add value to your organisation on their own. You will no longer have to supervise them and they will be able to inovate. They will have to take ownership and it will lead to a higher level of motivation.

Actually you should not trust me because I know what I am doing. You should trust me because it is in my best interrest to help you out and because you will benefit more if you let me do it my way.

Related posts:
http://dotnetexception.blogspot.com/2010/04/leadership-is-about-motivation.html
http://dotnetexception.blogspot.com/2009/11/flank-your-problems.html
http://dotnetexception.blogspot.com/2010/01/there-is-no-such-thing-as-perfect.html
http://dotnetexception.blogspot.com/2009/03/misunderstanding-path-to-new-ideas.html

Friday, May 14, 2010

Discuss this!

I have categorized discussions in 4 groups

Religious
When in the context of a religion, the main goal of a discussion is to reach an already given conclusion. Any valid arguments are discharted if they contradict the given conclusion.
This kind of discussion is often held by religious people such as evangelists (the software kind too) or sales people. It's also the favorite form for drunk people trying to argue that they are not drunk.
Religious discussions also occur if you are too specialized. If the only tool you know how to use is a hammer, you are bound to use a hammer to solve every problem.

Philosophical
These are discussions without a goal. That might sound useless, but it's not that bad at all. It's about questioning your own beliefs.
It's a mind opener. It's about challenging your ideas, getting the big picture.

Scientific
The scientific discussion is about reducing the complexity of a domain. The conclusions might be inaccurate, but it should result in the optimal solution all things considered. Issues like feasibility and return of investment are handled in these discussions as well as risks. It should be noted that a conclusion concluded today, might me changed tomorrow. Scientific discussions embrace and accept change.

Lawful
Law is about details. The more the merrier. When you reach the maximum amount of details any human can comprehend, you are about half way there. The downside is that often the big picture and reasoning is lost in the pursuit for details. Although the focus is on details, even the details are sometimes lost in discussions like that. The last man standing is the one with photographic memory and who can stay awake the longest. To succeed in this category I suggest that you give up on any social life and start nit picking on your surroundings. Although there can be a winner in such a discussion, the real looser is the common sense and productivity.
Law is a primal discussion form and we are trained to master it when we have arguments in kindergarten about what is right and wrong and which kid has more candy (milimeterdemokrati).


When it comes to software development, you might have these different discussions at different points of time on your project. The religious discussions occur in the beginning of a project, or when changes to the project occur. Although the religious debate has a high return in the short term, the long term might suffer.
As the philosophical discussion is about challenging your current beliefs, it's great for workshops or when a project is stuck in a dead end.
The scientific discussion is great for decision making on a project. What separates a decision derived from a scientific discussion from a religious discussion is the scope.
The lawful discussion comes into play on a software project when someone feels he's not treated right. The discussion often can't be resolved by the parties involved and a third party is then required.

Let the discussions begin!