Pragmatic Developer

Ali Özgür

Bookmark Blog

Add to Technorati Favorites

Google Talk

Chat with Ali Özgür

Purchase PragmaSQL from

Calendar

«  November 2008  »
MoTuWeThFrSaSu
272829303112
3456789
10111213141516
17181920212223
24252627282930
1234567
View posts in large calendar

Tag Cloud

Don't show

    Authors

    Recent Comments

    Banners




    aliozgur posted on April 23, 2008 11:29
    As a former long standing Delphi developer (actually I am still maintaining some Delphi projects) I really love the Delphi IDE. Visual Studio is also a fantastic IDE with lots of productivity features. But I always missed "Numbered Bookmarks" of Delphi. This feature really saves time while navigating source code back and forward. Finally I found DPack addin which has Numbered Bookmarks and emulation of some GExperts for Delphi features. DPack is also a free addin, I would recommend this addin to former Delphi developers . You can get DPack from here.

    Posted in: .NET Development  Tags:

    Be the first to rate this post

    • Currently 0/5 Stars.
    • 1
    • 2
    • 3
    • 4
    • 5

    Implicitly typed local variables introduced in C# 3.0 specification is very cool. Those who used VB and some other scripting languages are familiar with untyped variables and other who used VC++ and Delphi will remember the Variant type. But implicitly typed variables are different in C# 3.0. For example in VB actual type is determined at runtime and that is true for the Variant type too,but the actual type of the implicitly typed local variables are determined during compile time which eliminates lots of headache. C# 3.0 specification introduces "var" keyword to define an implicitly typed local variable. For example

     
    
    
    public void SomeMethod()
    {
        //int x = 12;
        var x = 12;
        //double y = 12.0;
        var y = 12.0;
        //string z = "Sample string";
        var z = "Sample string";
        //int[] k = new int[]{1,2,3,4};
        var k = new [] {1,2,3,4};
    } 
    
    
    

    Returning back to the original issue, using implicitly typed local variables saves lots of coding time and may be considered as a must for LINQ powered C# code. But do not forget that every piece of code may be debugged or reviewed by another person and by you some time later which brings code quality issues into scene. Readability is one important sign of the code quality and in some cases and depending on your coding practices using implicitly typed local variables may decrease your code quality as a result of difficult to read/review code. The key point here is how we review a piece of text as an average human. From my personal experience I can say that

    • We tend to anchor to the headings and try to understand the details backreferencing the heading
    • We may need short descriptions or walk throughs before we start understanding a complex issue
    • Not to get lost in a long text we tend to summarize what we have understood so far
    • When we finish practicing the text we try to infer a result from what we have highlighted in previous steps
    • After inferring a result we can start to invent our own understanding of the subject

    I think that scheme is applicable to debugging and code review practice. Knowing these we, as software developers, should avoid practices which may turn our code to a nightmare for other developers. I think if you

    • Use meaningfull names for your classes, methods and variables. Every code entity, be it a class, a varible or a method ,  should mimic its purpose of existence by its name if possible.
    • Write atomic methods. I mean writing methods that perform only a single well defined task.
    • Comment your code well (Some developers tend to write more comments than the actual code, if you do this I suggest you to review your code you might be doing something wrong or incomplete)
    • Keep the level of method chaining in a reasonable level

    you shall use implicitly typed local variables without hesitation. But if you have readability problems with your code be carefull while using implicitly typed local variables, that will bring more complexity to your already hard to grasp code.

     


    Posted in: General Programming   Tags:

    Currently rated 4.0 by 1 people

    • Currently 4/5 Stars.
    • 1
    • 2
    • 3
    • 4
    • 5

    For a while I am thinking about the Microsoft's support to open source projects. Some news that attracted my attention to this issue were

    • Foundation of CodePlex, open source project hosting web site of Microsoft
    • Ms-PL license developed by Microsoft  
    • Release of .NET Framework libraries  source code . Read more
    • Release of ASP .NET MVC source code. Read more

    Heritage

    Microsoft has developed very successfull technologies through history. COM/ActiveX formed a good baseline for MS platforms and related runtimes like MTS, COM+ and DCOM were a must for enterprise level application development targeted at MS platforms. VB was a fantastic programming language, even I've never written single line of VB code I remember how my co-workers rocked with VB, ASP was not perfect but it was, actually it still is, productive and easy to learn and VC++ powered with MFC was the programming language of choice for lower level software development. All these runtimes, frameworks and languages were not perfect, but they did succeeded in helping software developers to produce valuable software. However some of these technologies required software developers to have some sort of geek talent. For example it was very difficult for a regular software developer to write some sort of event sink COM code or programmatically configure the DCOM environment. I think Microsoft has learned more than we expected from the history I briefly tried to explain. Now we are at the age of .NET and related technologies and personally I expect less hesitation than the previous experiences we all ran through. 

    Communities behind technologies 

    I think all these steps and efforts are very much related with the direction Microsoft plans for the .NET Framework, bunch of foundation frameworks (like WWF, WPF and others) and it's flagship product Visual Studio. These steps also show that Microsoft analyzed Java community very well. Communities have direct impact on the directions of the technologies, once you build (or help to build) an active community around a technology it is very likely that you will end up with long lived and more mature product.

    The thin line between enforcing and empowering

    Microsoft has very bad history record about enforcing developers to stick to the technologies and practices they offer, leaving very limited space for our own judgement of truth. For example it was very hard practice to write COM code without VC++, even with VB that was very hard (I exclude Delphi). But Microsft's approach changed over time from enforcing to empowering developers starting with the establishment of .NET Framework and related technologies. For example release of some well known patterns as application blocks and later bundling these application blocks to more mature foundation class libraries is a nice example for empowering. Even better example is the release of ASP.NET MVC open source, .NET developers will not have to stick to default WebForms view engine and they can develop alternative view engines that will work with ASP.NET MVC.   

    Customer and developer trends

    Today software developers focus on interoperability, extensibility, maintainability and testing more than ever. This trend forces big brothers of the industry to develop different licensing approaches, different marketing strategies and development platforms as well. I have never understood that what did Microsoft gained from hiding the source code of a piece of software like TextBox control or a GridView control. That kind of source code was a big value, say 20 years ago, but today it has no value I guess, since software users demand more Business Intelligence and we, software developers, need robust frameworks and development tools to provide this intelligence.

    Software Development Ecosystem (targeting MS platforms)

    I like the term ecosystem very much. Because this term can be used to describe an environment containing many diverse components surviving together in a nice harmony (balance). Software development is in a way an ecosystem containing actors, processes, tools, frameworks and lots of communication. The diversity of the components in a software development ecosystem makes it hard for a single provider, even that is Microsoft, to provide all the facilities needed inorder to form some kind of harmony. I think Microsoft realised this very well and backed off from the obsession to provide every component needed in this ecosystem. By the way in Turkey we take diversity as granted and I believe that applies to software development ecosystem too, more colors make a better painting. Returning back to the issue, I'am sure that Microsoft's effort for openness will trigger other actors to enter the ecosystem and existing ones will have to reshape themselves to adapt to the new conditions. I expect new and more mature components to evolve while old ones evaporate. Nowadays we are in the middle of evolution process which will produce much than we expect.

    Conclusion

    It seems that Microsoft is doing more right things than ever. I expect this process to introduce innovative and open source technologies (I mean community initiated open source technologies) to the .NET community. We, as software developers, shall be more confident about using Microsoft tenologies than ever. I recommend you to keep an eye on these projects


    Currently rated 4.0 by 1 people

    • Currently 4/5 Stars.
    • 1
    • 2
    • 3
    • 4
    • 5

    Especially for Windows XP machines after Service Pack 2 (SP2) is installed some WMI related problems can occur due to security updates included in sp2. These problems cause PragmaSQL not to perform license check correctly and as a result application does can not start. Some probable solutions to this WMI related problem are

    Probable Solution - 1: Please ensure that Windows Menegement Instrumentation service is not disabled

    Probable Solution - 2:  Try running this command and see if it works
    netsh firewall set service type=remoteadmin mode=enable scope=all profile=all

    Probable Solution - 3:   Follow these steps

    1. Use the Start menu to right-click My Computer.
    2. Press the Manage item.
    3. Double-click Services and Applications in the left-hand pane.
    4. Press Services to expand it.
    5. Scroll to Windows Management Instrumentation in the right-hand pane and right-click it.
    6. Press Stop.
    7. Use Windows Explorer to delete all the files in the %SystemRoot%\System32\Wbem\Repository folder.
    8. Shutdown and restart your computer. The Windows Management Instrumentation service will start and the files will be re-created.

    Probable Solution - 4: Go to Start/Run/CMD and then run each of these hitting enter after each:

    1. winmgmt /clearadap
    2. winmgmt /kill
    3. winmgmt /unregserver
    4. winmgmt /regserver
    5. winmgmt /resyncperf
    This may or may not repair the repository but will re-install wmi into the registry.]

    Probable Solution - 5:   To correct permission issues:

    1. In the Management Console\Services STOP WMI and set to manual.
    2. Go to the WMI repository %Windows%system32%wbem and delete the repository.
    3. Set the WMI service back to Automatic
    4. From %Windows%system32%wbem run "wbemtest" and connect to your namespace.
    5. Start/Run/Regedit and navigate to: Locate current HKEY_CURRENT_CONFIG\System\CurrentControlSet\Control\Class. Open the class key and right click on the sub key 0000 and select permissions and make sure that the permissions for you [administrator] are "Full".

     


    Posted in: PragmaSQL  Tags:

    Be the first to rate this post

    • Currently 0/5 Stars.
    • 1
    • 2
    • 3
    • 4
    • 5