Sign In  Sign Up Live-Chat

Dmitry Vorobyev

  • A Weekend in Saint-Petersburg

    We've just returned from a weekend we spent in Saint-Petersburg, the "northern capital" of Russia. Definitely, this city is more than impressive. It's magnificent! Being tranquil and stately in the daytime, it becomes a large party place at night (at least the central part, not sure about the rest); and I just can't express what a fun atmosphere prevailing there!

    Petersburg certainly has its own energy or magic, almost tangible. I'm not sure if it's explainable, whether the reason is just the beautiful architecture or something more mysterious. Whatever it is, once visited, the city calls one back, so I believe we will manage to have a trip to there again until the weather gets cold and rainy (which is a real hassle to enjoy the city's charm).

    Let me share some photos we took without any comments. One reason is that I'm quite sleepy at the moment and the other is my shameful ignorance - I'm simply unsure what exact names of some sights are :) But I do know those are just a little bit of Petersburg which obviously cannot be explored in two short days.

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

  • Spring in Moscow

    Obviously May is the best month of the year. Here in Moscow it is not usually very hot, although at the moment it's 27 °C (~80 °F). However, it is always warm enough to wear T-shirt and have a walk across the city to admire its beautiful sights. May seems to be the most attractive month to visit Moscow indeed - winter or autumn will meet you with lowering sky, and summer is too sultry and dusty to enjoy the trip. Late spring is optimal.

    I love Moscow! This city combines very old architecture and modern offices, beautiful Orthodox churches and massive buildings of the Stalin epoch. So - let's have a short walk across the city (mostly central part) and make sure it is magnificent indeed. I hope my comments below won't distract you too much :)

     

    By tradition, let's start with the heart of the city - Kremlin. The big tower is named Spasskaya. The small tower nearby is named Tsarskaya because tsar Ivan IV liked to observe from it what was happening on the Red Square. Last time I was inside Kremlin being a child so no photos with the President today, sorry :)

     

    Another view of Kremlin (from an enbankment).

     

    St. Basil's Cathedral. Legend says that Ivan IV had the architect, Postnik Yakovlev, blinded to prevent him from building a more magnificent building for anyone else. What luck living several centuries later!

     

    Russian policemen armed with the latest modification of Kalashnikov halberd. The halberds are used to execute criminals trying to penetrate into the State Historical Museum (on the background). At least I believe it might be that way several hundred years ago.

     

    A pigeon attacking Marshal Zhukov's horse. The horse looks surprised.

     

    A developer taking a rest after many hours of debugging (he does not adopt unit testing).

     

    No comments (just another Moscow sight).

     

    Alexander Garden, the entry.

     

    The Tomb of Unknown Soldier in Alexander Garden. The guard stands without movement for hours. I envy his tenacity - there are so many pretty girls strolling by...

     

    Tulips in Alexander Garden. I recall a day when I presented my wife with a bunch of 101 tulips... No, I didn't steal them from this flower-bed. It was winter actually :)

     

    The Cathedral of Christ the Saviour. This is the largest Eastern Orthodox church in the world. It was demolished by communists and restored in 90s.

     

    That is how the Cathedral looks like at evening. This photo was taken by my wife - I had nothing to say but "wow".

     

    A monument to Alexander II, the Emperor of Russian Empire.

     

    A kitty guarding Alexander.

     

    96-meter-tall Peter the Great statue on the Moskva River bank. It is apparently supposed to scare off pirates if they ever appear on the river. We are thankful to Zurab Tsereteli (the sculptor) that he didn't make the ship proportional to Peter.

     

    A rainbow caused by fountain's splashes.

     

    Moscow is full of beautiful churches. I have an idea of collecting photos of all the churches in the city... alas, due to the lack of time this idea seems impossible to implement.

     

    A funky cabrio :)

     

    Aspose Moscow Office, under intense development. Yeah, just a branch. What? Oh... I was just told this is actually Moscow-City, the International Business Center... It is so easy to confuse...

     

    Ostankino TV Tower. Being 540 metres (1772 feet) in height (577.44 meters to the upper antenna), it is the highest freestanding structure in Eurasia.

     

    One of several "Stalin's" buildings, large and massive.

     

    A monument to Tchaikovsky in front of the Moscow Conservatory. Actually, I'm totally dumb in classical music and I'm a terrible singer. The only note I can strike well is C sharp :)

     

    Just a nice place to walk around...

     

    ...or simply stand on a pedestal.

     

    Let's finish our walk in a forest situated in Moscow outskirts where we found this cone... It is gorgeous, isn't it?

  • Microsoft Released .NET Framework 3.5 Beta 1

    Frankly, I didn't manage to duly investigate 3.0 so far. Yeah those guys are productive indeed.

    What's new:

    • Deep integration of Language Integrated Query (LINQ) and data awareness
    • ASP.NET AJAX for quickly creating more efficient, more interactive and highly-personalized Web experiences that work across all the most popular browsers
    • New web protocol support for building WCF services including AJAX, JSON, REST, POX, RSS, ATOM and several new WS-* standards
    • Full tooling support for WF, WCF and WPF including the new workflow-enabled services technology
    • New classes in the base class library (BCL) for the .NET Framework 3.5 address the most common customer requests.

    Download link: http://www.microsoft.com/downloads/details.aspx?FamilyID=e3715e6f-e123-428b-8a0f-028afb9e0322&displaylang=en

    I've noticed Amazon already offers several books about 3.5:

    http://www.amazon.com/s/ref=nb_ss_b/002-8753217-1998421?url=search-alias%3Dstripbooks&field-keywords=.NET+3.5

    Impressive but too early IMHO.

  • How to change Internet Explorer to open documents in Microsoft Word

    Just found a nice Microsoft KB article that shows how to change the way Internet Explorer opens linked Microsoft Word documents. By default, they are opened in-place in the browser window; many users seem require another behavior, when the documents are opened in a separate instance of Microsoft Word. I have tested it and it worked. Hope this will be useful.

    You can read the article here:

    http://support.microsoft.com/kb/254918

  • Happy New Year!

    2007... Seven is a great number, it brings success... Whoever you are, the reader of this post, I wish you success in the new year.

    2007... All troubles stayed in the old year, all sorrows... No pain anymore, but happiness instead... Whoever you are, the reader of this post, I wish you happiness in the new year.

    2007... Just believe that your dreams will come true. Just believe in love, and it will be with you the whole year. Whoever you are, the reader of this post, I wish you love in the new year.

    Be successful in 2007, be happy, be in love. Happy New Year!

     

  • Microsoft Released Service Pack 1 for Visual Studio 2005

    No doubts, Microsoft Visual Studio 2005 is not merely a "tool" for development. It's rather a powerful environment that includes everything we need for efficient and successful work. Unfortunately, it's an established fact that the first release of the environment proved to be too raw. There are quite many bugs for a product of that class, and some of them are pretty annoying.

    Guys from Microsoft do realize this as well and finally they decided to relieve us from most of the troubles. Recently they've released Visual Studio 2005 Service Pack 1 (SP1). They claim in some areas it addresses more than 50% of the bugs reported by users. Good job. I didn't notice any major fixes though, at least it's still impossible to work with dynamic help on - too slow as before. However, I've just installed SP1 on my machine so hopefully it will show its worth during the work Smile [:)]

    The most noticeable improvements offered by SP1 are:

    • New processor support (e.g., Core Duo) for code generation and profiling
    • Performance and scale improvements in Team Foundation Server
    • Team Foundation Server integration with Excel 2007 and Project 2007
    • Tool support for occasionally connected devices and SQL Server Compact Edition
    • Additional support for project file based Web applications
    • Windows Embedded 6.0 platform and tools support

    You can download SP1 here:

  • .NET Framework 3.0 is Out, Microsoft Office 2007 is Golden... What a Crazy Day of Releases! :)

    Well it seems like Microsoft has prepared a bunch of surprises for us... Just take a look what they have just released:

    Microsoft .NET Framework 3.0 Redistributable Package

    http://www.microsoft.com/downloads/details.aspx?FamilyID=10cc340b-f857-4a14-83f5-25634c3bf043&DisplayLang=en

    Microsoft Windows Software Development Kit for Windows Vista and .NET Framework 3.0 Runtime Components

    http://www.microsoft.com/downloads/details.aspx?FamilyId=C2B1E300-F358-4523-B479-F53D234CDCCF&displaylang=en

    Visual Studio 2005 extensions for .NET Framework 3.0 (Windows Workflow Foundation)

    http://www.microsoft.com/downloads/details.aspx?FamilyID=5d61409e-1fa3-48cf-8023-e8f38e709ba6&DisplayLang=en

    Visual Studio 2005 extensions for .NET Framework 3.0 (WCF & WPF), November 2006 CTP

    http://www.microsoft.com/downloads/details.aspx?FamilyID=f54f5537-cc86-4bf5-ae44-f5a1e805680d&DisplayLang=en

    ASP.NET 2.0 AJAX Futures November CTP

    http://www.microsoft.com/downloads/details.aspx?FamilyID=d7101c1a-5993-4f70-9944-4b98f312502d&DisplayLang=en

    ADO.NET Samples for Visual Studio Code Name "Orcas" - October CTP

    http://www.microsoft.com/downloads/details.aspx?FamilyID=c14c451d-7043-44f0-87d7-845f1c238d64&DisplayLang=en

    Microsoft SQL Server 2005 Compact Edition RC1

    http://www.microsoft.com/downloads/details.aspx?FamilyID=85e0c3ce-3fa1-453a-8ce9-af6ca20946c3&DisplayLang=en

    SQL Server 2005 Compact Edition Books Online Community Technology Preview (CTP)

    http://www.microsoft.com/downloads/details.aspx?FamilyID=e6bc81e8-175b-46ea-86a0-c9dacaa84c85&DisplayLang=en

    Windows SharePoint Services 3.0 Tools: Visual Studio 2005 extensions

    http://www.microsoft.com/downloads/details.aspx?FamilyID=19f21e5e-b715-4f0c-b959-8c6dcbdc1057&DisplayLang=en

    Also, Microsoft Office System 2007 has been released to manufacturers:

    http://www.microsoft.com/presspass/press/2006/nov06/11-062007OfficeRTMPR.mspx

    WOW! I'm eager to start playing with this new stuff! (Except Office 2007 of course - unfortunately I'm not a manufacturer... or fortunately Smile [:)]).

  • Unbelievable But True: Windows + Linux = Love?

    No comments. I only hope this will be really useful for the industry as stated, not merely for the money makers:

    Ron Hovsepian and Steve Ballmer take the stage together to announce a new collaborative relationship between Novell and Microsoft.

    Novell and Microsoft are announcing an historic bridging of the divide between open source and proprietary software. They have signed three related agreements which, taken together, will greatly enhance interoperability between Linux and Windows and give customers greater flexibility in their IT environments. Under a technical cooperation agreement, Novell and Microsoft will work together in three primary areas to deliver new solutions to customers: virtualization, web services management and document format compatibility. Under a patent cooperation agreement, Microsoft and Novell provide patent coverage for each others customers, giving customers peace of mind regarding patent issues. Finally, under a business cooperation agreement, Novell and Microsoft are committing to dedicate marketing and sales resources to promote joint solutions.

    http://www.novell.com/linux/microsoft/

    http://online.wsj.com/public/article/SB116249026689311557-helTbrheLKgbaJ5iO5z40ZFCiOs_20061109.html

  • Internet Explorer 7 Final is Out

    It's not a secret that the vast majority of websites are designed for and thus best viewed with the most popular browser in the world by Microsoft. That was the main reason for me to use Internet Explorer rather than "alternative" browsers which were apparently much more fast and convenient than IE 6. Indeed, running one instance per site instead of handy tabbed browsing was a really bad idea...

    And here it comes. Welcome IE 7 Final! It's really faster, simpler, user friendlier... and really tabbed Smile [:)]. Here's a list of the most important features:

    • Simplified user interface (unnesessary items were removed, maximizing the area devoted for the webpages).
    • Tabbed browsing (finally...).
    • RSS feeds (cool!).
    • Advanced printing (scales a printed webpage so that it's not wider than the paper it will be printed on + other features).
    • Improved security (phishing filter, anti-spoofing + many other).
    • Improved platform (improved CSS 2.1, AJAX and many more).

    The browser is available to download at http://www.microsoft.com/windows/ie/default.mspx.

    Internet Explorer 7

     

  • Microsoft Released Visual Studio 2007 "Orcas" CTP

    Recently Microsoft released a CTP of the next generation visual development tool. It is available to download here. If you don't like to install raw versions of software onto your working machine, there's a little surprise for you: the CTP is distributed as a Virtual PC image so you can download it and start playing immediately without impacting any existing software installations! Actually, the process of getting the CTP to run is slightly more complex as you also need to download another image containing a host OS etc. However, I think it's much better than installing products that are still under development directly into the system.

    In general, VS 2007 is still very, very far from the final release. Only a small part of the C# 3.0 features is supported, IntelliSense doesn't work for many language constructs, and so on. However, this is just a technical preview. Good luck to Microsoft in development of our main working tool! Smile [:)]

    Visual Studio 2007 CTP

     

  • ExpoRTFaster!

    I'm glad to report that one of the numbers published by Roman in his recent post is now out of date. I'm talking of the Aspose.Words RTF export speed. We wanted to optimize the export before v4.0 final is released and we've succeeded Smile [:)] Basically, exporting documents to RTF format is more time and memory consuming process than to DOC or WordML. It's because of some specifics of the format. For example, "correct" RTF (such as that produced by AW Smile [:)]) should include extra fragments to satisfy old readers and the emission of those fragments might take an extra time. But now, after applying a number of optimizations RTF export is reasonably close to DOC and WordML export processes. We've succeeded to improve performance by more than 30% so that the large, complex, 212 pages document mentioned by Roman is now saved to RTF in around 2 seconds! A similar improvement (over 30%) has been made to memory allocation so that the amount of memory consumed by the RTF exporter is now close to those consumed by other AW exporters.

    And this is not a limit of course Wink [;)] It's like a challenge to us - if we can make it even more faster, accurate, powerful. Even more AWesome!

  • Class Design: Which is the Best?

    What class design do you prefer? I assume most of you follow Microsoft guidelines, and it's reasonable. However, practice shows that not all the recommendations should be blindly obeyed. I don't imply here fundamental rules like "never make instance fields public" (yet this also might be broken in some rare cases – imagine you have an internal class representing a low-level data structure with several hundred fields!). I'm rather speaking of naming conventions, order of members, and some other stuff related to the appearance of a class. I wanted to share few class design rules that seem different from most popular guidelines but proved to be useful to me and my teammates. I supplied each recommendation with a practical explanation of the reason.

    Naming Conventions

    Use m prefix for instance fields and g prefix for static fields + Pascal style name.

    Why? Despite Microsoft recommendations, including prefixes in field names seems useful due to several reasons:

    • Field identifiers cannot be mixed up with other identifiers, e.g. those of properties or local variables.
    • No need in color highlighting (for example, offered by the ReSharper plug-in) to distinct field identifiers.
    • IntelliSense sorts fields together thanks to the same prefix.
    • Field look more "class level" than say when using camel style Smile [:)]

    It seems like controls should be the only exception. There is no strict opinion how to name the fields holding controls. I don't like both the popular styles: neither including a prefix (such as txtCustomerName) because Hungarian notation is considered obsolete in .NET, nor ending the field name with the control's class name (too long – imagine something like CompilationResultsRichTextBox3). So I'm just using Pascal casing (instead of camel casing offered by VS designers) until I find a better rule.

    The Order of Members

    The order of members inside a class:

    Ctor
    Methods
    Static ctor
    Properties
    Fields

    Why? Methods go first because when you open a source file in an editor, the first thing you want to read is normally what the class DOES rather than what data it works with. The instance constructor is the "initializing" method so it goes very first. The static constructor goes last because it's usually the least "important" of the methods – it normally contains nothing but static field initialization. Properties might be treated as a hybrid of fields and methods so it's logical to place them in the middle; another argument is that most properties are nothing but field accessors, hence they should be placed closely to fields. Fields are last because they are usually the last thing you want to get familiar with when exploring a class.

    One can argue that it's reasonable to keep fields and their "wrapping" properties together. Yes, it makes sense because it allows easily remove a field and corresponding property if needed. However, inconsistency is our natural enemy so if we agreed to physically separate the code of the methods and the data they work with, let's stick with this rule.

    It's a moot point which is the best place for events (not shown on the list), probably between static ctor and properties.

    The order of members inside each group:

    Public
    Internal
    Protected
    Private

    (Don't know where to put protected internal – have you ever had to create any? Smile [:)])

    Why? Mostly because less visible methods are normally invoked from more visible ones. There may be exceptions from this ordering for example if a private method is a helper method called from one or more public methods; in this case it's acceptable to place this private method right after the public method(s).

    Other Rules

    Always explicitly specify the visibility of a class and its members.

    Why? Just because it makes code more readable.

    If a method does not refer to any of the instance fields, make it static.

    Why? Because you can easily extract it later for example to a utility class.

    Do not use #region blocks.

    Why? Class shouldn't be so large to demand the use of #region. Refactor the class to a couple of smaller classes. Perhaps regions would still be useful say for separating methods and fields but they don't seem to have a decent support in VS (I was amazed when discovered that collapsing regions makes the contents not searchable).

    So a "proper" class should look as follows:

        public class ProperClass
        {
            public ProperClass(int field1, int field2)
            {
                mField1 = field1;
                mField2 = field2;
            }
           
            public void PublicMethod()
            {
                InternalMethod();
               
                // ...
            }

            internal void InternalMethod()
            {
                int result = PrivateMethod(mField1);
               
                // ...
            }
           
            private int PrivateMethod(int inputValue)
            {
                // ...
            }
           
            private static string PrivateStaticMethod(string value)
            {
                return (string)gSomeMap[value];
            }
           
            static ProperClass()
            {
                gSomeMap = new Hashtable();
                
                gSomeMap.Add("Value1", "MappedValue1");
                gSomeMap.Add("Value2", "MappedValue2");
               
                // ...
            }

            public int Field1
            {
                get { return mField1; }
            }

            internal int Field2
            {
                get { return mField2; }
                set { mField2 = value; }
            }

            private int mField1;
            private int mField2;

            private static readonly Hashtable gSomeMap;
        }

     

  • A Bit More About Nemerle and Functions

    After posting my first impression about Nemerle I noticed that I had been criticized by some community members for my superficial knowledge of the language and related concepts. I like constructive criticism and I do accept it; so I'm thankful to those guys for pointing me to that.

    However, I'd like to note I didn't try to pose as an expert. I only expressed my current understanding of the language and I advisedly highlighted that in the post. So I think next time I will write a separate large disclaimer to show that the subsequent text will not pretend to be an expert's voice Smile [:)]

    What was mostly derided by the critics was the part about local functions. They disliked my sentence "I guess this would be useful to not overburden classes with specific small methods such as printing a formatted string". Yet I'm still persuaded this is true (as a particular case), I must admit functions are much more important in Nemerle than just a nice but utility feature.

    The real power of functions I guess (critics may relax! no more than my personal opinion Stick out tongue [:P]) is that they can be passed as parameters and return values. This resembles the behaviour of C# delegates but doesn't require them (although Nemerle does support delegates – probably to satisfy the cases when Nemerle assemblies should be referenced from other .NET languages). Also, unlike delegates, functions are much more flexible. So in this sense functions are similar to other data types.

    Here's how a method accepting a function looks like in Nemerle:

    Compute(f : int * int -> int, x : int, y : int) { ... }

    Among other parameters this method accepts a function which, in turn, accepts two integer values and returns an integer value.

    Nemerle also supports anonymous functions (similar to anonymous delegates in C# 2.0, but no need in delegates again). Anonymous functions might be useful when you need to pass some function to the iterator or filtering method so there's no need to refer it by its name.

    You can see how to create an anonymous function inline:

    Compute(fun(x, y) { x + y }, 3, 4) { ... }

    Nemerle supports different types of lambda expressions – which are basically a syntactic sugar for anonymous functions:

    Compute((x, y) => x + y, 3, 4) { ... }

    Thus Nemerle provides an exhaustive support for functional programming. I didn't mention here such features as partial application or function decomposition – just because I haven't made them out yet and don't want to mislead you. Although Nemerle doesn't force a developer to use this approach, it offers the mixing of two programming styles: the top-level program structure is object oriented, while in the body of methods functional style can be (and probably should be) used. Therefore – I concluded that, as opposed to my first impression, functions are a core part of the language.

    Now let me share what I think of it. Although I really admire Nemerle, I do not feel myself "ready" to it yet, at least to use the mentioned "mixed" programming approach. I guess functional programming requires some special cast of mind. I'm not sure whether I will ever "grow" to it and whether I really need that at all. That's why the function use case I proposed might sound dumb for functional programming experts Smile [:)] I'm personally a staunch supporter of the object oriented programming paradigm, and at the moment I do not feel to be in urgent need of using local functions in my code, neither do my colleagues. Time will show if we should change our minds. After all, C# 3.0 will support lambda expressions – is it just a tribute to fashion?


     

  • AWesome!

    So we have almost finished another major release of Aspose.Words. We're happy to note how greatly the component evolves and improves despite it's still pretty young by the standards of software industry. It's less than 3 years old but it's already the subject to imitate Big Smile [:D]

    Among other cool features, two highly requested formats have been added to the component's arsenal, Rich Text Format (RTF) and WordprocessingML (WordML). One of the areas I'm responsible for is RTF export (will start working on import once we release 4.0 final version) so if you are curious, I will share some interesting facts related to that.

    Let me make some numbers public first. RTF 1.8 includes over 1400 keywords (called control words), and Aspose.Words now supports almost all of those required for proper representation of any Microsoft Word documents regardless of their complexity. The only exceptions are:

    • Table styles
    • Formatting revisions
    • Comment ranges

    All of these will be supported very soon.

    At the moment we process around 95% of the keywords. That wasn't so easy mainly because RTF is a very ambiguous format. That is some keywords or their values just do not obey the rules declared in the format specification (which is also pretty ambiguous, but that's a separate story Smile [:)]). Another difficulty was the inconsistency that was showing itself throughout the format. As a result, the code of the exporter is full of comments specifying that some keyword behaves differently from what is stated in the spec, or may include an undocumented value, or is not mentioned in the spec at all.

    Basically, RTF looks like the first attempt of migrating from binary to textual representation of documents. Yes, RTF is a textual format but it's hardly supposed to be read by a user Smile [:)] It's impossible to understand what \tsbrdrdgr or \lyttblrtgr mean having no description, isn't it? That wouldn't be a problem, though, if the spec was strict and legible and described each and every keyword Microsoft Word may produce. Unfortunately, I couldn't rely on the format documentation only and had to verify most of the keywords to ensure we produced documents looking exactly similar to the Microsoft Word's output.

    Now I'm happy to state that all the problems are solved and the documents we're producing are identical to those created by Microsoft Word. Even their internal representation (I mean RTF stream itself) resembles Microsoft Word; for example, we satisfy old readers as RTF spec dictates (although we didn't test readers older than Microsoft Word 97).

    That doesn't mean we blindly mimicked Microsoft Word. For instance, we have a test document containing several ClipArt shapes that when saved as RTF and opened again in Microsoft Word, crashes it. However, Microsoft Word perfectly opens this document when it is exported to RTF by Aspose.Words Big Smile [:D]

    Anyway, Microsoft Word is still exemplary for us because we're working with its "native" formats and our goal is getting rid of any differences between the appearances of our documents. I think we've succeeded in it. The accuracy we've achieved is the reason why we call our export High-Fidelity, or Hi-Fi, in case you were wondering. We spend a lot of effort in details. Here's an example. Microsoft Word has no UI elements that allow setting up such line properties as joining style or miter limit. However, these are present among the shape attributes and it's enough to us to be supporting them in RTF and other formats. We just do not ignore minor things even though they are used pretty seldom - who knows, maybe some of your documents will contain those attributes.

    If nevertheless you find anything you treat as inaccuracy when exporting to any of the supported formats, welcome to the Support Forums. Many improvements of the product are reaction to your requests, and we are in extreme need of your participation in the development process. We hope recently launched Aspose MVP program shows that well. Together we will make it Hi-End! Wink [;)]

  • Nemerle: The Mage's Language

    Nemerle LogoNemmerle is the name of a mage from Ursula K. Le Guin's book "A Wizard of Earthsea". I don't know whether it's a fairy trick of his but Nemerle now seems to be one of the most popular among the family of "alternative" .NET languages and its popularity is growing. I haven't had a chance to explore it in-depth but from what I've learnt so far I can confidently state I like it!

    Nemerle resembles C# but is much more complex and flexible. Whereas C# looks like a hybrid of C++ and Java, Nemerle is a thermonuclear mixture of C#, Java, VB .NET, Pascal, and even Lisp Big Smile [:D] And that's not bad. That's great!

    Nemerle offers functional, object-oriented and imperative features. Actually, there are tons of great features offered by Nemerle and it's impossible (and not reasonable) to list all of them here. I will just highlight the most distinctive of them.

    Meta-programming. This is what really makes this language POWERFUL. Imagine you could create your own programming constructs using special macros. You could extend the language as you like. Roughly speaking, you could sculpture almost new programming language fully adjusted to your needs! That's what is possible in Nemerle.

    Even not running to an extreme, meta-programming is not yet another developer's toy, it is useful. The process of development is full of various programming patterns we are forced to repeat more and more. We use many techniques and tools intended to make this easier. The examples are VS snippets or ReSharper Live Templates. C# also includes few built-in structures which simplify certain areas of programming (lock instead the use of monitors, using instead of calling Dispose inside a finally block, and so on), but their number is low and, what is more important, they are hardcoded into the syntax of the language and you cannot introduce your own.

    Let's take an example. Very often we create classes with several fields initialized in the constructor. There's nothing else to do within constructor body, just assign parameter values to a couple of fields. So we have a pattern here, and it would be nice to automatize the process of creating such constructors. We can use a tool to achieve that, and we can not declare the constructor at all if we use Nemerle, but apply a special macro instead Smile [:)]

    Take a look how easy it is (notice Nemerle uses Pascal style for declaring fields and parameters):

    [Record]
    class Person {
      public name: string;
      public age: int;
      public sex: bool;
    }

    This is equivalent to

    class Person {
      public name: string;
      public age: int;
      public sex: bool;

      public this (name: string, age: int, sex: bool) {
        this.name = name;
        this.age = age;
        this.sex = sex;
      }
    }

    Record is a macro which checks what fields are defined inside the class and generates constructor to initialize them. It is a built-in macro and it looks like a C# custom attribute but you are free to develop your own that define custom language constructs such as new loop types or anything else!

    Type inference. Another great feature that allows you not to specify types of variables you declare. The compiler is smart enough to infer the types itself from variable assignments and similar things. That is, you don't need to write such long statements as:

    Dictionary<string, int> d = new Dictionary<string, int>();
    d.Add ("Ala", 7);
    foreach (string s in args) {
      ...
    }

    but you can write instead:

    def d = Dictionary ();
    d.Add ("Ala", 7);
    foreach (s in args) {
      ...
    }

    This feature will also be supported in C# 3.0 but Nemerle offers it now and it's still obscure what compiler will be smarter to infer types. At least Nemerle compiler already shows great results in this area!

    Functions. You can define functions inside methods. I guess this would be useful to not overburden classes with specific small methods such as printing a formatted string. Here is an example which says hello to all persons in list:

    public Greet (people: list[string]): void {
      def say_hello (s) {
        System.Console.WriteLine ($"Hello $s");
      }

      foreach (person in people)
        say_hello (person);
    }

    The example shows more peculiarities of Nemerle: lists are special built-in elements of the language, and $ is used to mark a special active region within a string represented by an expression (and a simple identifier is also considered an expression) which gets evaluated and replaced with the result (nice and easy, compare it with C# string formatting).

    New language constructs. Although C-based languages allow to implement everything a developer needs using their basic constructs, those constructs might sometimes be a bit too common to nicely put developer's intentions into code. For example, the for loop is used very often to just repeat a block of code a certain number of times without any special loop conditions and without the use of the control variable. So isn't writing for (int i = 0; i < 100; i++) a little redundant for such cases? That's what we must write however. Nemerle includes a number of "more specialized" language constructs to ease developer's life. So you can simply write repeat (100) before a block to repeat and that's it. I presume this construct is also defined by means of macros and this is COOL Smile [:)]

    I have actually mentioned here just a minuscule part of staggering Nemerle capabilities. To learn them all, visit the homepage of the language www.nemerle.org.

    I'm personally fond of C# but Nemerle just looks like the next step of evolution Smile [:)]

More Posts Next page »