in

Platinum Bay

Peace, Love, and...

This Blog

Syndication


.NETicated

December 2009 - Posts

  • What is Community?

    I’ve travelled the world and the seven seas… ok, ok, just North America, but since September of 2007 I’ve had the opportunity to visit nearly 100 community events from user group meetings, code camps, micro-conferences to major tradeshows such as Tech-Ed and PDC. During my travels I’ve been able to talk one on one with numerous user group leaders and influentials and there are widely varying views as to what community is. A lot of community leaders base their metrics on how many butts in a seat they were able to achieve at their latest meeting. I’m here to tell you my friends that this is not community. Not in the slightest. It’s an association, a club.

    True community is what happens outside of organized events.

    Here are a couple thoughts:

    • How much time do you spend mentoring other developers? Jesse Riley has a great post spawned by a Jim Holmes talk on this. I’d recommend seeing Jim’s talk if you ever have the opportunity.
    • Do you invite your attendees out for food and/or adult beverages after each event? This is a great way to not only build relationships, but to find motivated up-and-coming influentials and community leaders. Less than 10% of your attendees will regularly come out afterwards, but those that do tend to have the spark and can be mentored into strong community leaders themselves
    • Is your Microsoft Developer Evangelist organizing all the events? Some of the best Developer Evangelists I’ve met rarely organize events themselves, rather they support those that are already organizing events. If folks in your local community aren’t organizing events however, that’s a great opportunity to step up and be a leader.
    • Do you make yourself available? I make it a habit to freely share my personal contact info, and unless I’m overdue on a deadline (hypothetically speaking of course), I try to make myself available. For the record:
      • Phone: (610) 883-7667
      • Email and Live Messenger: steve [at] platinumbay [dot] com
      • Twitter: SteveAndrews

    To me, community is not about a place to hang my hat and pat myself on the back. It’s a place where I can both learn and teach, mentor and be mentored, and build meaningful and lasting relationships with my peers. I’d encourage you to do the same.

    Posted Dec 24 2009, 07:00 AM by Steve with 2 comment(s)
    Filed under:
  • Tips for Releasing Sample Code

    When I’m learning a new technology, I’ll frequently download code samples that help me better understand the concepts. Often though I find myself frustrated by having to deal with formatting and extraneous information before even looking at the code. To that end I have some rules for releasing sample code.

    Format Every Document
    The keyboard shortcut for this is Ctrl+K+D. Nothing is more frustrating than looking at unformatted code.

    Code Order
    Code should be ordered in the following structure from top to bottom:

    • events
    • fields and automatic properties
    • constructors
    • abstract methods
    • methods
    • abstract properties
    • properties
    • subclasses

    Code Statements
    Include a blank line before return statements and before and after decision blocks (including using, if, switch, while). In C#, opening and closing brackets should be on their own line.

    Remove Excess Blank Lines
    There should never be more than one consecutive blank line between any lines of code. With consecutive closing brackets as well as #endregion notations in C#, there should be no blank lines between them. There should also be no blank lines between fields or at the beginning or end of method or property bodies.

    Separate Code
    There should be one blank link between properties and methods to allow the user to see logical breaks in the code.

    Code Files
    There should only be one class, interface or enumeration per file.

    XML Comments
    Always remove unnecessary XML comments from your code files. For example, this XML comment should be removed:

    /// <param name="param"></param>

    Import Namespace Placement
    Import (C#) or using (VB) directives should be placed above the namespace. Also use the Organize Usings > Remove and Sort refactoring built-in to Visual Studio 2008 and Visual Studio 2010 to remove any unnecessary directives. This also helps to make the directives more readable.

    Wrapping Lines
    Don’t manually wrap long lines of code. Visual Studio has a feature to allow a user to wrap long lines if they so choose.

    Properties
    Use automatic properties in .NET 3.0 code and above whenever possible.

    These are a few of the rules. I’ll try to keep the list updated as I run across more frustrations.

  • Visual Studio Code Formatting

    Working on a website in Visual Studio I found myself annoyed again by the extra spaces around <script /> tags when I type Ctrl+K+D (Format Code). It turns out however that this is easy to change. As with most Visual Studio customizations, the answer lies in Tools > Options.

    Under Tools > Options > Text Editor > Html > Format, click the ‘Tag Specific Options…’ button. Under ‘Client HTML Tags’ find ‘script’. Finally, under ‘Line breaks’, change the default value from “2 Before opening, within, and 2 after closing” to “Before and After”, like the Rush song.

    This isn’t specific to HTML though, most of the languages under Text Editor support formatting options. Another change I typically make is for CSS to use the Compact rules.

    Happy Formatting!

    12-20-2009 6-29-49

  • Help Rebuild New Orleans At Tech·Ed NOLA

    Just announced, registration is now open for Microsoft Tech·Ed 2010, June 7-10, in New Orleans, Louisiana. Tech·Ed isn’t the only reason you should come to New Orleans though.

    It has been four years since Hurricane Katrina devastated the gulf coast as the worst civil disaster in American history. It is estimated that 400,000 jobs were lost and 275,000 homes were destroyed, ten times as many as any other natural disaster in US history. The total cost is estimated at $100 billion in damages making Katrina the most costly hurricane in US history. Up to 15 million people were affected by Hurricane Katrina, and New Orleans itself is still struggling to rebuild and one of the biggest needs is for new housing.

    I'd like to help, so I have arranged for a volunteer group to work with Habitat for Humanity to help rebuild New Orleans on Saturday June 5th, 2010, the Saturday before Tech·Ed. This is your opportunity to help an area that still has immense need, as well as to network with fellow geeks and eat more shrimp and oyster poboys! You should try the fried alligator too.

    If you would like to volunteer to help rebuild New Orleans on Saturday, June 5th, 2010, please visit: http://geekgive.org/project/techednola2010

    For more information about working with Habitat for Humanity, please read the FAQ (Microsoft Word) and Safety Guidelines (Microsoft Word).

    I am also looking for sponsors to help with:

    • Hotel Discounts
    • Transportation
    • Breakfast
    • Lunch
    • Water
    • After-Party
    • $50 suggested donation to Habitat for Humanity per person to help cover work gloves and other costs

    If you can help sponsor this volunteer event, please contact me at steve [at] platinumbay [dot] com.

  • Serialization Generics

    I really dislike writing the same code over and over again. For my current project, this involves serialization and I ended up creating the following generic class to handle Xml serialization and thought it might be useful to someone else.

    using System.Xml.Serialization;
    
    public class SerializationHelper<T> where T : class
    {
        public string SerializeXml(T o)
        {
            var serializer = new XmlSerializer(typeof(T));
    
            var sb = new StringBuilder();
            using (var tw = new StringWriter(sb))
            {
                serializer.Serialize(tw, o);
            }
    
            return sb.ToString();
        }
    
        public T DeserializeXml(string text)
        {
            var serializer = new XmlSerializer(typeof(T));
    
            using (var tr = new StringReader(text))
            {
                return (T)serializer.Deserialize(tr);
            }
        }
    }
Powered by Community Server (Commercial Edition), by Telligent Systems
© Platinum Bay | Some Rights Reserved Creative Commons License

Disclaimer: The information in this weblog is provided "AS IS" with no warranties, and confers no rights. This weblog does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion. Feel free to challenge me, disagree with me, or tell me I'm completely nuts in the comments section of each blog entry, but I reserve the right to delete any comment for any reason whatsoever (abusive, profane, rude, or annonymous comments) - so keep it polite, please.