Moving into the .NET world

Brian LeGros | June 15th, 2008 | programming  

With my latest employer, I have taken the big dive into the .NET world. I’ve spent most of my career working with ColdFusion, Java, PHP, Flex and dabbled a little bit in the Ruby/Rails and Groovy/Grails world in addition to the obvious set of web technologies and standards that span all of these application languages. My limited experience with .NET was through some undergraduate and graduate work I did with C# as well as helping (if you can call it that) with an ASP.NET a long time ago with a colleague of mine. I am a application developer; even though I dabble in lots of different areas, the bulk of my knowledge is building applications in a corporate IT environment. I focus on implementing business requirements and managing technical concerns as it relates to the software development process. I’ve had jobs in the past associated with business and management roles but at the core I am a plain and simple application developer. As I’ve been getting my hands dirty in .NET over the last few months I figured I’d share some of my initial impressions. Please keep in mind, I may be looking at a lot of things in a very naive light, so read what I have as my opinion, ignorant or not.

With context out of the way, I have to say that so far working with .NET hasn’t been a negative experience. There is the whole you’re stuck with Windows thing, but since I’m in fully entrenched in the MS world now, I’ve been able to get past it. There have definitely been some nuances to get used to, but nothing extremely difficult to overcome. Here are a few comments on some of the things I’ve run into thus far:

  • Namespaces in C# aren’t constrained by the file system with respect to partitioning your code. Initially this seemed like a nice decoupling, but I’ve found myself forming more of a dependency on tools to navigate my classes hierarchy rather than just looking into a folder.
  • There is no notion of a shared class path as there is in Java. If you want to get a hold of an assembly to use in your application you’ve got to find it and pull it in. I think there is a configuration option on an assembly that you can use to help, but I haven’t had any experience using it.
  • Assemblies are pretty nice build artifacts. Versioning is addressed out of the box and integrated with the .NET framework. I’m not sure how they stack up against something like OSGI, but I’m enjoying having them around.
  • Everyone says the implementation for generics is better in C# than Java, but as an application developer I don’t notice a difference except that I’ve been told I can use reflection on them in C#. C# also seems to have made a much larger use of them in their core over Java. It seems like stronger typing is a very important practice in the C# world than in my experience with the Java world, but that is probably biased based on how I’ve used Java.
  • There appears to be a very balanced view on uses for metadata (attributes) in .NET. Annotations in the Java world were a great addition to the language, but sometimes their use comes off as abuse; look at a JUnit 4 test suite class for a great example.
  • There are lots of accepted libraries available that are direct ports from the Java community such as NUnit, NAnt, Spring.NET, CruiseControl.NET, NDocs, log4net, etc. Getting comfortable with these libraries was pretty easy since I’d had experience with the Java equivalents.
  • The help systems in .NET leave much to be desired and make me long for Javadocs, Livedocs, RDoc, or anything else. I find myself clicking through a class definitions on MSDN and after two or three links I can finally get to a list of “members” that belong to a class, only to click another link to load another page to see more about the details of that “member”. I have yet to find any easily usable API documentation.
  • .NET has a solid component model available out of the box. WCF is a really simple and tight implementation of a component architecture. Service-orientation is a focus with an emphasis on abstracting away protocols, execution environments, and exposing metadata for a more contractual usage. It has the feel of being an API built around WSDL 2 and many of the WS-* standards, but it goes by many of the concepts, although not by name, identified in Patterns of Enterprise Integration. It’s compatible with synchronous and asynchronous operations and did I mention simple to use? I hope to do some posting about it later.
  • Getting used to assimilating applications into the bowels of the OS seems to be core to the .NET mentality. This is probably just a matter of perspective for the developer, but based on the examples I’ve seen thus far, the user folder, the registry, and Windows\system32 folder are popular hang outs for lots of applications. I’ve been met by quite a looks of confusion when I mention deploying applications without the use of some type of installer. There is a lot of power that you get from this tight coupling with the OS I’ve been told. Unlike my previous shops, writing cross-platform applications doesn’t seem to be a priority for .NET developers, so tight coupling it is.
  • It took me listening to the episode of SER with Anders Hejlsberg to understand better it, but it appears to be that developing in .NET is meant to be an IDE integrated experience via Visual Studio. Regardless of the aspect of development I’ve worked with in .NET thus far, the development experience has been fairly consistent. There is always some visual representation of the code available (where applicable) and a debugger is always around and working no matter the context (desktop, web, etc.). At first it was so simple that I felt like I was missing something, but from what I have read and heard, as much work goes into VS as does the .NET framework, if not more. If anyone has used Netbeans for Java web development, it’s a very similar experience in terms of its integration with the environment.
  • I’ve always seen code insight as a supplemental thing, relying on documentation for the majority of my work, but wow, code insight (intellisense) seems to be the major crutch on which a lot of .NET developers place themselves within VS. What’s weird is that I don’t notice anything different than what you’ll experience when working with Eclipse and Java, in fact, the code insight seems to be limited to code only. I have yet to run into a situation where the IDE makes a suggestion on how something could be written or changed as IntelliJ does for Java. I will admit though, maybe I’m missing something.
  • The visual editors in VS seemed to get abused by .NET developers. I say abuse because quite a few .NET developers I’ve encountered can’t talk to me about their code in any other context but how they dragged-and-dropped controls onto a screen and edited properties. Since I don’t know the in’s and out’s of the tools quite yet, having a conversation is tough. I try to communicate in terms of language agnostic principles and patterns but most of the time all I get are blank stares and judgmental comments about how I am over complicating things.
  • MS alternatives exist in terms of the IDE and runtime, but they don’t seem to be popular at all. I really like SharpDevelop as an alternative to Visual Studio. It’s clean, easy to use, and integrates with a lot of OSS packages out of the box. Mono is available as a Linux-based .NET runtime that has a lot of .NET developers excited because of its potential to allow them to code for the Mac. I don’t know any Mac owners that have Mono installed however, so I don’t know if it’s really a viable cross-platform solution.
  • I have some thoughts on ASP.NET web forms that I want to share, but I’ll save that for my next post.
  • The developer community has always been important to me and I feel it’s always important to remain active in the community in some capacity. As I’ve begun attending the local .NET user group meetings, I don’t see a lot of topics that are not MS centric. There is no question that MS drives the releases of the .NET framework, but there have been lots of innovations coming out of the community that deserve attention. It feels like there are only a small minority of developers that actually utilize these contributions locally. I have yet to see any presentations on the various unit testing tools, build tools, ORM, IoC, etc. that have come out of this space. I do envy the direct support that MS has for its user groups, but I wonder if my expectations are too high.

In any case, so far the learning curve with .NET hasn’t been very steep and when I do get to code I feel fairly productive. I should be posting in the next few days on my thoughts about ASP.NET web forms so I’m sure that will get me flamed, but it’s a major part of the puzzle I’m having to work with that I feel needs some attention. Until next time.



Tags: , , , , , ,

Related posts

Discussion

  1. Sara Says:

    Usually I find people going the other way, from .NET to RoR or php. Interesting to see the approach from the other side.

    I disagree that intellisense is a crutch, I see where you are coming from, but a lot of developers know exactly what they are intending to write before they see that drop down box. I use it like a keyboard shortcut. RARELY I will use to it see what properties or methods an object has, but mostly it saves me some time.

    I never use the help in Visual Studio or the included MSDN stuff, I always go online. Though the included help isn’t very “helpful” I think there is a wealth online, more than most other languages (in my experience)

    Oh and “drag and drop” developers aren’t developers, they are designers. :)

  2. X-Cubed Says:

    In regards to installing applications, they should only ever go in one place: the Program Files folder. User specific settings can go under Documents and Settings, but the executables and libraries should stay in Program Files. And the only files to go in the Windows or System32 folders should be Microsoft libraries and executables related to proper operation of the OS.

    There are a number of applications that don’t obey these guidelines though, mainly because it is only recently that Microsoft have tried to tie things down. See the Windows Logo program for more information about Microsoft guidelines for Windows applications: http://www.innovateon.com/product_vista.aspx

    Using installers to distribute your applications is recommended as it ensures that the files go where they should, and that the required prerequiste libraries and components are also installed, along with the appropriate metadata to go into the registry (such as information about what executable to run to uninstall your application).

    Good luck with your coding!

  3. Onur Gumus Says:

    Here’s my comparison of ASP.NET with RoR and others

    http://reverseblade.blogspot.com/2008/06/web-development-aspnet-webforms-versus.html

  4. Chris Says:

    I live a dual life. By day, I live in the .NET world. By night, I live in the Perl/Catalyst realm. I’m also helping other ASP developers make their way from the ASP classic world to the ASP.NET world.

    In general, I don’t mind .NET, or C#, or even VS.NET. Yes, you’re correct. The key to Studio is to understand your code, not just drag n drop and walk away, as that can lead to pages choc full of things that should be in the page at all.

    ASP.NET PostBack is one of the worst design models ever created imho. It works well if you have a form that doesn’t change. Throw dynamically created controls in to the mix, and you end up spending more time fighting lifecycle hell than you do writing code. Thank god they’re creating MVC for ASP.NET.

    And of course, there’s not IronPython/IronRuby whcih should be available in the MVS stuffs as well as an implementation of RoR on .NET.

  5. Brian LeGros Says:

    @Sarah - Good to hear that the group I’m being exposed to are just a sampling and not a majority. I’ve had some luck with MSDN.com, but are there any blog or references you can recommend? I really want a great set of API docs for the .NET framework, any ideas?

    @X-Cubed - Thanks for the clarification. I figured the user folders and Program Files should be the deployment hot spots, but it’s good to know I’m not crazy with what I’m seeing in terms of OS debauchery. I’ve always used build scripts like Ant to handle deployment, so having something a little more polished like an MSI is nice experience.

    @Onur Gumus - Thanks for the feedback, good to see some other opinions.

    @Chris - I’m glad to hear that I’m not the only one that has a problem with the whole web forms model in ASP.NET. I’m also looking forward to ASP.NET MVC, but I’m eager to look into the Castle project as well; looks like they may have had the whole package before MS caught on. Either way, lots of options as you said.

  6. Gary Vidal Says:

    So I am crossing paths with you on the C# .net world moving to a java world. My devoted eternal love of c# faded when I had to deal with the lack of community and open source initiatives and ultimately coming back to a java based product when looking for standards based implementations. Microsoft is a big NIH offender. Since I dont have a java background I got stuck on Groovy which reminds me of windows powershell. I think the next evolution for .NET is a Rails framework based on Powershell.

    Ditto on who said Postback model is crap. I spent more time mucking around the whole Page Lifecyle writing custom controls and digging way too deep on internals to enjoy doing any dynamic web programming. Unfortunately I am .Net Dude in a java world. Being the only inhouse .net developer gets lonely. So I meet you at the cross-roads as I venture into the java world.

  7. Brian LeGros Says:

    @Gary - Thanks for stopping by. I’d encourage you to dive into the Groovy space, Grails especially if you’re going to be working on the web. If you’re working in a Java shop, it really is the way to go over JSP/JSF/EJB in my opinion. I’ve never used Powershell but Groovy is a lot like Ruby but with a distinct Java twist. Pretty much everything your shop does in Java will port and integrate easily with Groovy/Grails. If you’re looking for some great use cases, check out LinkedIn (http://www.linkedin.com), it’s powered by Grails. DZone (http://www.dzone.com) has a bunch of great stuff too.

  8. Maxim Porges Says:

    Unfortunately, Hallmark.com doesn’t sell a “Welcome to the MSDN Drone Army” e-card, so I couldn’t send it to you as I had hoped. :)

    Just kidding - great summary of the language and tools for somebody like myself who has never used .NET or even opened VS. I’m interested to see how your journey progresses with yet another platform; it might even convince me to install Mono on the Mac at some point (although it will have to wait until I am finished learning objective-C and Cocoa).

    - max

    P.S. Xcode is free - Jobs and his RDF rocks the house.

  9. Shoeman Says:

    I completely agree with you on the documentation for .NET. I’ve struggled with that a lot in moving from ASP.NET 1.1 to 3.5. The IDE that I used to use (WebMatrix) had a pretty decent documentation feature for the framework, but I haven’t messed with that since 1.1.

  10. Brian LeGros Says:

    @Shoeman - Yeah documentation just sucks, I still am not liking it although the Definition View is helping some in VS. I’d strongly encourage you to check out SharpDevelop 3.0, it just recently went beta 1 and wow, I love it so much more that VS. It’s got NUnit and SVN integration as well as a nice XPath tool. It’s more code centric and just so much easier to work with coming from Eclipse, Netbeans, etc.

Add A Comment