While working at Karmencita i had a “static typing vs. dynamic” discussion with a friend of mine. Of course, the guy insisted that the dynamic DSL is useless unless there was a way to “type check” it . I disagreed , of course, but nonetheless i was interested in doing this in C#. Unfortunately, there isn’t any way to do it. I was thinking at something like a C# compiler plugin…..so that at compile time i would have access to the AST and type check the DSL.
Unfortunately is not possible to do this in C# now. Maybe someday…..
Now playing: Elvenking - Hobs And Feathers
Some notes on scaling. There are 2 ways to scale a application :
1. scale up (vertical scaling) : this describes how an application/service can be scaled when running on a single box. The scaling is done by "beefing up" the box: adding RAM, faster CPU(s) etc. The things to note here are: the application/service's workload cannot be made to run concurrent and use multiple machines and that after a certain threshold is met there isn't a direct correlation between beefing up the hardware and the workload. So, for instance, if you increase the processing power by 100% that doesn't guarantees to also support a 100% increased workload. Sometimes this is referred to as brute force scaling.
2. scale out (horizontal)
This is the preferred way to scale. It means that the application/service is inherently concurrent and works on multiple boxes. So, to scale like that simply means adding/removing boxes to the network to keep up with the load. Usually this is done using a load balancer. Using as an example a web farm....a load balancer (which can be either software or hardware) is put "in front" of the network and the IP is "virtualized". That means each request ends up going through the balancer and it's his job to "redirect" the request to a free
box. There are 2 main algorithms that loads balancers use to determine which boxes are free :
- round rubin scheduler approach (the same that thread scheduling is done by the OS) which rotates between the boxes.
- server pooling : in which the balancer "pools" different boxes and assigns the request depending on how fast the server responded.
So, the main thing to remember from this, is that always try to design the application in such a way that can be scaled horizontally.
Now playing: Apocalyptica - Hope
Some thoughts on why the agile methodologies work:
– they keep you focused on the customer. The most important thing is to satisfy the customer. The project itself has a simple goal : bring business value to the customer.
– welcome changing requirements. There are 3 sure things in life : death, taxes and changing software requirements. Sooner or later it would happen…so why fight it ? After all the purpose is to bring business value to the customer. Welcome changes.
– shared code ownership. In most of the “traditional” software development methodologies, the team members end up “owning” different parts of the source code. The changes to these parts, by others than the author, are often discouraged. No so with agile….any member has the right to change the code. There is also a psychological issue with this : if a developer ends up “owning” a part to the source code , he will work only on that part and loose touch with the rest of the project. If some other part of the project will not work as expected he will think: screw it…my part works just fine. Of course the customer doesn’t care if some parts work….he just wants a working solution. So through shared code ownership the agile methodologies encourage the developers to keep on eye on what really matters : a solution which works.
– working together. The customer and the development team must work together to produce results. Face to face conversations is the most effective method of conveying information between the development team and the customer. And the primary measure of progress is working software. So…talk to the customer…..implements its requirements/changes…..show the software and repeat until the customer is satisfied with the result.
– the software should be build by motivated individuals in their environment and with the support they need. This should not come as a surprise to anyone but motivated individuals is the first requirement of a successful software projects. This is not necessary related to agile methodologies because i personally think that motivated individuals will succeed in delivering working, solid software no matter of which methodology they use. But with agile they will obtain faster results. They key point is that the management should be trust the people to get the job done and offer them the environment and support they need.
– deliver working software frequently. This is tied with working together…..deliver frequent working software and get the customer input. Rinse and repeat until the customer is happy.
– continuous integration. With continuous integration you are in control. Whatever you do breaks or advances the project. You get instant feedback on your changes and act accordingly. It helps to think of continuous integration and TDD as extensions of the compiler.
– Test Driven Development (TDD).Not much to say here….TDD simply changes the way in which we develop software and this is a “must use” technique.
That’s it so far. I’m not trying to suggest that agile methodologies should be used in any kind of software project, but i am suggesting to everyone to try agile methodologies in their projects.
Now playing: Blind Guardian - Into the Storm
This is sooo cool. There is a patch (http://bat.org/~tomba/monoco.html) for Mono which implements continuations in the runtime. Personally i am very interested in continuation because of the possibility of writing transactionable memory operations (something that .NET 2.0 System.Transactions doesn't support). Also there is a coroutines implementation dubbed "microthreads".
Very very nice. Let's just hope that CLR will also implement continuations someday.
Sometimes you need to capture the page HTML output (for logging purposes or to mail it). The easiest way to do it is to override the Render event handler like this :
protected override void Render(HtmlTextWriter writer)
//create a new string builder
StringBuilder builder = new StringBuilder();
//create a StringWriter based on the builder
StringWriter sw= new StringWriter(builder);
//create a new HmtlTextWriter based on the string writer
HtmlTextWriter htmlWriter = new HtmlTextWriter(sw);
//call the base Page implementation which generates the HTML
//get the output from the string
string html = builder.ToString();
//do usefull stuff
Finally migrated all my older entries here. So…now it’s time for blogging. Why blogging ? It really helps me organising my thoughts. Probably all of those crazy .NET related things which swirl through my mind will get a place in here.
I've read the C# 3.0 specs last night and ....well i'm a bit puzzled. I think the C# team is taking the language into
a wrong direction.The design of C# 1.0 was pretty good. Despite making a few small mistakes mr Helsjberg & co clearly were aware
that code is written once and read many times. Little things...like putting ref / out at the function call site showed
that readability is a key point for them in the design of a language.
In my opinion in the design of C# 1.0 they screwed up by adding domain specific functionality in the core language definition.
Domain specific functionality is handled in libraries (in which is easier to deprecate / improve) then the core language itself.
This domain specific functionality i'm talking about is threading. C# includes 2 keywords (volatile and lock) which deal with threading
directly from the language instead of the libraries (never mind that lock "maps" to a Monitor). Adding these functionality in
the language definition is bad because :
- they don't belong there
- it bloats unnecessary the language
- their functionality already exists in the library
- it harder for them to "evolve" the language when they are adding new keywords.
- a small fixed core is always better
Despite this i think the design of C# 1.0 was very good. With C# 2.0 they added again domain specific functionality into the
language definition. You can argue but a nullable type is used mainly in the context of a database operation. In fact nullable
types are implemented in mscorlib like any other type but the made the mistake of trying to add sintactic sugar in the language
definition for nullable types (with the ? and ?? operators). Don't know about you but Nullable x is way more comprehensive
to me than int? x. I guess after all it's just a matter of taste. I have mixed feelings about the rest of the C# 2.0 features.
Were they REALLY necessary ? I guess the C# team think they are in some kind of competition with the Java guys...think about it..
why the heck they added that half assed template implementation in Java ? I am willing to bet my socks that at least 50% of the reason
is because C# will have generics. To me it seems that the C# team is just adding things because they think they have to compete with Java
and because C# must be cool (Ruby style)....without really asking themselves if we REALLY need them. Do they ONESTLY think that the programmer's productivity is increased by introducing lamdbda functions ?
What happened to the much (in C# 1.0) touted simplicity ?! (please don't gimme the "don't use them if you don't like them" line). I mean...there is already out there a language that pretty much tries to be everything to everyone. And failed. Do we really want C# to follow the same route ?
We really don't need the things added to C# 3.0 ( or should i say LISP wanna be ?). And also it seems to me that at least some of them
were added to simply allow for LINQ implementation. Not because we want them / need them.
So...C# team...what happened to the balance between simplicity and power ?
PS : Also....why the HECK var ? It's not like C# is Pascal. Why not remove the var entirely and just let the name of the variable? It makes
way more sense than var.
Just finished reading "Concepts in programming languages" (published by Cambridge Press). It 's a book about programming languages (both procedural and OOP) and concepts (high order functions, templates, OOP pillars etc). Recommanded if you're interested in programming language theory.
Downsides from my point of view :
- no Ruby or C#.
- the praises for the C++ language design were waaaay too much.
Recommanded if you’re into programming languages theory.
Finished the game last night. I was interested in the game because the story was written by R.A. Salvatoare so i thought it's going to be good. Big dissapoiment. The game is simply a 3rd person hack and slash with a vaguely sketched story. Anyway :
good stuff :
- you get to play as Drizzt :)
-nice action packed scenes in the last 3-4 chapters.
bad stuff :
- bugs. Lots of them. I couldn't finished 2 chapters because of showstopping bugs (i had the patch installed).
-one dialog said "Please press the triangle button !!!!".
-the game is a little bit hard.
-battle pshysics and mechanics were downright bad when compared to games like POP: Warrior Within.
- too short.
Listened to latest Opeth last night. Very good album. Wholeheartedly recommended. Also...music related...i'm going to a Nightwish concert tonight in Bucharest. It should ROCK.
Got the album from a friend of mine in weekend and keep listening to it ever since. It just rocks !!! Highly recommanded if you're into metal. You can download the video from "A touch of blessing" from their site at www.evergrey.net
I’m very happy to announce the release of DataBlock v1.2 . Here is the press release :
voidsoft is pleased to announce the release of DataBlock v1.2 forMicrosoft .NET 2.0. DataBlock is an advanced O/RM and persistenceframework for .NET 2.0 which helps you build advanced databaseapplications fast and easily by generating a complete business facadefor your database entities. DataBlock comes with DataBlock Modeler (aGUI tool) which allows you to generate your entities in a few seconds(it supports both C# and VB.NET).
Features list : http://www.voidsoft.ro/DataBlock/features.htmSupport
Forum : http://www.voidsoft.ro/forum/
Download : http://www.voidsoft.ro/DataBlock/download.htm
Please note that the evaluation version is not limited in any way so give it a shot.
If you have questions you can leave messages on this blog, post on the forum (see link above)
or mail me directly at gmarius at gmail dot com. Also note that this new release is .NET 2.0 only
so if you're looking for a .NET 2.0 O/RM.....We scrapped the 1.x version and went straight for .NET
2.0 and this is the result of many months of work. We also included a small ASP.NET 2.0 demo
application. Check how you can have ther business facade ready in 15 seconds and how an
application can run on 3 different RDBMS (Access, MySql and SqlServer) only by changing 2
lines in a config file.
A demo video should be up on the site in the following week.
Work on Datablock ( http://www.voidsoft.ro) continues at a franctic pace. The upcoming release (1.2) will be available at the end of august.
Along with the enhancements (i will talk another time about this) and bug fixes a big noteworthy change :
-.NET 2.0 only. Mostly for generics (like i already said i'm not entirely happy with the constraints in .NET 2.0 generics) but getting rid of the custom collections along with StringCollections and the like worth it. It's speedier too when compared with 1.1. As long as i'm on this topic....we decided that arrays will still the primary method of returning multiple data ( we can also returned List<TableMetadata> as a conventional sided API for the languages that will support generics......although the generics are CLR compliant i don't expect that most languages will have support for them in the foreseeable future).
Other new related to DataBlock....well DataBlock will be "the main pillar" of the upcoming codenamed Sunrise business application framework which we will launch along with the .NET 2.0 release. More news about this in the upcoming months.
We're planning to write some medium size application (with GUI both Windows Forms and ASP.NET) as demonstration for DataBlock.
(the current one is too small). I will also record a demonstration video for DataBlock (not everyone has time to read docs ).
So much things to do....so little time. Got to get back to work.