Showing posts with label C#. Show all posts
Showing posts with label C#. Show all posts

Thursday, April 28, 2011

Making the leap to QueryOver

So, if you are using the ActiveRecord/NHibernate stack I highly recommend switching to query over. The syntax is cleaner and it's type-safe.

Here is an example of a criterion based query:


Here is an example of the same query in QueryOver:



Unlike the Linq language for Nhibernate QueryOver is just a translation layer for Criterion.

Wednesday, September 02, 2009

COBOL.Net is NUTS!!

Just read an article about COBOL.Net.....who would really want to subject themselves to this horror.

Let's take the sample code in C#:

private void button1_Click(object sender, System.EventArgs e)
{
button1.Text = "Call COBOL";
}
Now here is the same method in COBOL:

METHOD-ID. button1_Click PRIVATE.
DATA DIVISION.
LINKAGE SECTION.
01 sender OBJECT REFERENCE CLASS-OBJECT.
01 e OBJECT REFERENCE CLASS-EVENTARGS.
PROCEDURE DIVISION USING BY VALUE sender e.
SET PROP-TEXT OF button1 TO "Call COBOL".
END METHOD button1_Click.
Am I the only one that finds this maddening. OK, OK, for the record there are still more lines of COBOL running then any other language. It could be that COBOL is just that great or it could be the fear of re-engineering systems are working just fine.

Any thoughs?