Showing posts with label open source. Show all posts
Showing posts with label open source. Show all posts

Nov 18, 2014

.NET is Open Source

Well, the trend of the latest years resulted in .NET going open source. That is pretty amazing, now it is possible to see what is there under the hood, without searching info in blogs and Q&A.
We've got reference source repository, which is intended to serve as a reference, located at https://github.com/Microsoft/referencesource
The new development will be in https://github.com/dotnet/corefx, it already has some libraries uploaded and the rest will come soon.
I decided to take a look into reference source, and the first place I went to was mscorlib assembly. Some notes on internals:
  • Extensive use of Code Contracts there
  • Some of the classes` internals do not match coding standards (or I comprehended the rules incorrectly)
  • There is non-generic static class Nullable :) that is a container for static methods operating on nullables. I’m just curious what is the reason having it? There is no such thing for DateTime, for example.
  • mscorlib, System.Web, System.ServiceModel are the monsters, taking more than 17 Mb of code each.
  • largest file with code is System.Web.Services\System\Web\Services\Description\ServiceDescriptionSerializer.cs which seems to be obfuscated. It takes about 668KB.
  • Task class is more than 6600 LOC
  • Not only XML verbose, but its handling routines also – XLinq.cs from System.Xml.Linq\System\Xml\Linq has over 9k LOC and 390 KB size. It’s actually 3rd biggest file that contains code.
What's interesting is that it is now easier to go and look at what the class does inside in case of any doubts. From the other hand, that is an abstraction leak - you are not supposed to take into account actual implementation. However, according to a law of leaking abstractions, sometimes that’s inevitable.

Jul 8, 2014

Brackets for the web

While diving into web development I needed a lightweight editor for JS, CSS and HTML files. So I decided to check how it is going for Brackets – open sourced code editor for the web.
After launching
cinst brackets
I got an editor, it appeared that current version is 0.41. First impression was – “too lightweight”, and it is after Visual Studio. The first feature I missed was formatting of selected code – there is no such command to invoke (at least I was not successful finding it). After lurking back and forth, cloning the repo, looking through the code, adding new command to launch some existing APIs – I got what I want, but then I thought – there already should be someone who needed the same functionality. And that’s it, there were several attempts to provide such functionality, starting with the extension that does almost exactly what I did and ending with several cards in projects cardboard, describing different formatting desires.

I end up installing the Beautify extension for formatting and also Code folding for folding regions of code. Both does not look abandoned (Brackets itself as well) and they do the work so far.

There are several conclusions from that story:


  1. Before writing your own feature, check if somebody already did that
  2. You could pack Brackets with whatever you want - there are a lot of extensions for almost any needs

Why Brackets? I like its Live Preview feature, when you can edit page and see a result on the fly in browser. I like it for its weight – that’s exactly what I need for prototyping ideas. I like it’s pace of evolution – it’s moving forward quite fast, growing to a mature product. I like the fact that I can add the feature I am missing Smile

Go and check if you haven’t seen it yet.