misc events

On Wednesday I attended this meetup. It was fairly informative. There is a bit uncertainty about the new features of Windows 10, Visual Studio 2015 and C# 6.0 but it was still good to cover most of them in a few hours.

It was divided into two main sections: Windows 10 and VS 2015/C# 6.0. I’m planning to review these myself and blog about them separately but here are the highlights of the events:

Windows 10

When they first announced the name I immediately thought about Winamp skipping version 4. We all know how that story ended so I hope Windows 10 fares better than that!

A few items discussed in the event about Windows 10:

  • First demonstration was sending a feedback which was painfully slow and it took forever to send a simple feedback message.
  • Some enterprise features are coming like like having store and custom company portals
  • There was a rather long discussion about what the 4 device from the left was in the image below: One Windows

I don’t think it makes any difference though but the idea is having one code base and one store to deploy apps to various devices with different form factors. Sounds cool but I’m a bit cautious about it for the time being. If it sounds to good to be true, it generally isn’t!

  • Looks like they are going to use hamburger icons everywhere which they initially opposed to.
  • There seems to be back buttons in a few screens which is a bit unusual so they may have to deal with some lash back from people like they did for their brilliant(!) charms invention.

Visual Studio 2015

Preparing for Windows 10 Event

  • There will be a free version of VS 2015 and there is already a free version for VS 2013 called “Community Edition”. It’s said to be Professional equivalent so it sounds cool to have it for free.
  • Like all Microsoft products versioning is a bit off and confusing here as well. There was a discussion about the version number vs. release year. So VS 2013 actually is version 12 but VS 2015 is version 14 even though there is no other VS in the middle!
  • A research project called Pex used to generate unit tests made its way to VS 2015 under Smart Unit Tests. It should help to create a lot boilerplate test code.

C# 6.0

  • Not a C# feature but one of the most impressive developments nowadays is that .NET Framework has become open source.
  • New version is coming with a much faster 64-bit compiler called .net RyuJIT
  • .net Native Project N is coming which is supposedly make the applications run faster
  • The compiler has been completely rewritten and its name is now Roslyn. It’s open sources and it exposes APIs that can be consumed by any application. So the compiler doesn’t have be a black box anymore.

Conclusion

A lot of exciting and revolutionary developments are going on in the .NET world these days. Taking a more open-source and multi-platform based approach will definitely help the platform in the future. It’s thrilling to be a developer and experience them first hand as these news come along. I have my virtual machine running Windows 10 and VS 2015 so I’ll play around more and blog about these specific features in detail in the near future.

Resources

misc site_news

On the road again…

Using WordPress for my blog had been bugging me for quite some time. So I’ve started using the popular static site generator Jekyll and host my blog on GitHub pages. Main reasons for this were:

  • Security: Over time you install a lot of plugins and any number of them can come with vulnerabilities. Granted they are optional and they are installed because they provide nice functionality but it would be much better to delegate the security of the system to GitHub.
  • Maintenance: I used to host my blog on AWS which is relatively easy to maintain but still I was responsible for keeping that machine up and running at all times.
  • Database: Using a database is overkill when all I’m doing is generating some static content. Database comes with performance impact, maintenance and backup requirements.
  • Scalability: No need to worry about scaling as GitHub takes care of it all for free!
  • Versioning: Just like any project on GitHub you have full control over the content and you can rollback to a previous version anytime.
  • Performance: All content is served in static pages. So compared to retrieving it from the database and generating the page on the fly it’s obviously much faster and scalable.

Beautifying the content

Compared to HTML, markdown is so elegant and concise. No more pesky attributes and ugly tags mingled with text. Granted WordPress has plugins for writing posts in Markdown but in GitHub it’s a first-class citizen and supported from the get-go.

Drawbacks

  • WordPress has its own merits like having a gazillion of plugins and themes. GitHub Pages supports a limited number of plugins due to security reasons.
  • SEO must be taken care of manually whereas WordPress already has lots of plugins for that purpose too

Resources

dev csharp

yield keyword has been added to C# long time ago but I never made a habit of using it. Basically what it does is create an iterator and allows you to return an IEnumerable one item at a time.

For example in the example below (from MSDN) Power returns a single int. But the return type of the method is IEnumerable. This is because of the _yield_ usage. Every time it's called it returns the next value it calculates.

public class PowersOf2
{
    static void Main()
    {
        // Display powers of 2 up to the exponent of 8: 
        foreach (int i in Power(2, 8))
        {
            Console.Write("{0} ", i);
        }
    }

    public static IEnumerable<int> Power(int number, int exponent)
    {
        int result = 1;

        for (int i = 0; i < exponent; i++)
        {
            result = result * number;
            yield return result;
        }
    }

    // Output: 2 4 8 16 32 64 128 256
} 

I developed a small Fibonacci calculator using yield.

Notice the first two occurences:

yield return f0;
yield return f1;

When it’s first called it returns f0 (0) and on second call it omits that return and returns f1 (1) and on subsequent calls it loops until the desired numbers and returns the series up until that point.

And the output looks like this:

Fibonacci console output

Resources


  • [MSDN Reference] (http://msdn.microsoft.com/en-us/library/9k7k7cf0.aspx)