Updated: 15/09/2002; 12:48:42 a.m..
Python Community Server (development progress)
A weblog about programming in Python, C#, Java, Perl and C++ - and the occasional comment on PyCS development
        

Saturday, 6 July 2002

Heh - it seems that the Java people are one step ahead of me.  You can embed SQL statements directly in Java code with SQLJ, a syntax extension to reduce the code overhead of database access.

Incidentally, check out the free Oracle JDeveloper; another good Java IDE.  I'm messing with it at the moment; it doesn't take ages to set up and simple things like creating projects are easy to do, as they should be.


12:24:54 PM    comment []

A few months back I started trying to design a programming language.  Then I discovered Python, and realised it was far more useful than anything I was likley to come up with.  Then I discovered C#, which does a lot of things better than Python, but at the same time sacrifices a lot of the things that make Python so fun to program with.
 
It would be an interesting task to write a preprocessor to 'extend' the C# language to let you do stuff like list comprehensions, or quick declaration of dictionaries and arrays.
 
Wouldn't it be cool if you could say something like:
 
Hashtable Foo = { "one": 1, "two": "two", "three": 3.0, "now": dateTime.Now };
 
... or ...
 
ArrayList bar = [ 1, 2, 3 ];
 
... or ...
 
ArrayList baz = [ d.Year foreach DateTime d in listOfDates ];
 
These would generate something like:
 
Hashtable foo = new Hashtable();
foo[ "one" ] = one;
foo[ "two" ] = two;
foo[ threeKey ] = three;
foo[ "now" ] = DateTime.Now;
 
... and ...
 
ArrayList bar = new ArrayList();
bar.Add( 1 );
bar.Add( 2 );
bar.Add( 3 );
 
... and ...
 
ArrayList baz = new ArrayList();
foreach( DateTime d in listOfDates )
{
    baz.Add( d.Year );
}
 
That would probably halve the amount of code that I write in C#, bringing the overhead down to the level of Python.  It will seriously kill IntelliSense though, and IntelliSense is the main reason I like C#.  Hmm.  Is it possible to extend the IDE to know about things like this?
 
In related news, my C# data object wrapper generator is working (generating lots of C# code which compiles and seems to go fine) and just needs the addition of a few 'isDirty' flags so Commit() knows what to send back to the database.  I'll release the source in a few days, probably.
 
It's making my database code look much cleaner.  I now only need to specify my DB structure once (in XML), run MakeWrappers.py, and suddenly I've got all my database fields from my queries into tblFoo available as properties of a FooRow object.

11:26:16 AM    comment []


© Copyright 2002 Phillip Pearson.
 
July 2002
Sun Mon Tue Wed Thu Fri Sat
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31      
Jun   Aug

[Macro error: Can't render navigator links because an error occurred: "The file "C:\Program Files\Radio UserLand\www\#navigatorLinks.xml" wasn't found.".]
Click here to visit the Radio UserLand website.

Subscribe to "Python Community Server (development progress)" in Radio UserLand.

Click to see the XML version of this web page.

Click here to send an email to the editor of this weblog.