Community

Posts about getting involved in the software development community

The Book of F#

The Book Of F#Earlier this year (late February to be exact) my life took an interesting turn: a publisher approached me about writing an F# book. Writing a book had been something that I’d thought of doing for some time but it was never something I gave any serious consideration. After some discussion with my wife, mostly about the time commitment, I decided to go ahead with the project. Since then, a mix of writing, reviewing, revising, and the variety of other activities that go along with getting a book on the shelves have consumed most of my nights and weekends.

After months of work, I’m very excited to announce that The Book of F#: Breaking Free with Managed Functional Programming will be published by No Starch Press! The book is scheduled for release on March 22, 2014 but No Starch is accepting pre-orders now! By pre-ordering from No Starch with the coupon code PREORDER, you can save 30% off the cover price of $44.95.

If you’re an experienced .NET developer that would like to break free from the chains of C# and Visual Basic or someone that’s just curious about the language, this book is for you. The Book of F# will introduce you to the basics of the language and walk you through features such as currying, partial application, pattern matching, discriminated unions, record types, units of measure, type providers, and a plethora of other concepts. Throughout the book you’ll see examples of how F#’s terse syntax and functional-first nature will help you be more productive and produce code that’s more predictable than that of many modern languages.

F# has been getting a lot of attention lately. If you’re even remotely curious as to why, I hope you’ll consider adding this book to your collection.

.NET Users of Fort Wayne – August 21

On August 21st I’ll once again venture out of my cave for a trip to Fort Wayne, Indiana where I’ll spread more F# love with my friends at NUFW.

If you’re in the Fort Wayne area and want to learn about how F# and functional programming principles can improve your software, please join us. The doors open at 6:00 for networking and the main event begins at 6:30. Be sure to check NUFW ‘s events page for the latest logistics information.

Microsoft MVP – Visual F#

If you’ve spoken with me or have been following this blog for any time you know that over the past year I’ve developed a bit of an obsession with the F# language. You’ve probably also noticed that fresh content here has been a bit, well, lacking over the past few months as I’ve focused on some speaking engagements and writing an as yet untitled F# book. I was very surprised, ok, shocked, when earlier this week I received word that I’ve been selected as a 2013 Microsoft MVP for Visual F#! I’m extremely honored to have received this recognition and will do everything I can to continue promote and advance this fantastic language.

I owe a debt of gratitude to the Indiana development community that I’ve been part of for so many years, particularly the user groups in Indianapolis, Fort Wayne, and Bloomington. Thank you for your all of your support and encouragement.

If you’re interested, you can find my MVP profile here: http://mvp.microsoft.com/en-us/mvp/David%20Fancher-5000148

On a related note, if you haven’t read about the new language features or tooling support in F# 3.1 and Visual Studio 2013, be sure to take a look at the F# Team blog.

Bloomington .NET Society – June 27

I know I’ve been quiet for a few months but don’t worry, I haven’t disappeared. Instead I’ve been hard at work on an upcoming F# book! The book has consumed most of my time but not being one to pass up a chance to talk about my obsession I’m making the trip down to Bloomington, IN at the end of the month to talk to the Bloomington .NET Society.

If you’re in the Bloomington area on June 27th and interested in learning about F#, please join us. You can find the full meeting details on the group’s site: http://dotnet.indiana.edu/news/jun-2013-meeting.

I hope to see you there!

IndySA – March 21, 2013

The March IndySA meeting is this Thursday.  I’m excited for the opportunity to spread around a bit more F# love as this month’s speaker.  If you’re looking for a fun way to fill the evening please join us at the SEP office in Carmel at 5:30 PM.  All of the logistics details are available on the meetup site.

I hope to see you there!

About the Talk

F# Needs Love Too

Originally developed by Microsoft Research, Cambridge, F# is an open-source, functional-first language in the ML family. Despite its lofty position as a first-class Visual Studio language for the past two releases and its cross-platform availability it hasn’t seen widespread adoption in the business world. In this talk we’ll take an introductory look at F#, exploring how its constructs and terse syntax can allow you to write more stable, maintainable code while keeping you focused on the problem rather than the plumbing.

 

GR DevDay

GR DevDay Speaker Badge

GR DevDay Speaker Badge

Last weekend I made the trek up to Grand Rapids, Michigan for the GR DevDay conference.  This was the second time I’d attended this conference but this time was special – it was my first time speaking at a conference!  I was honored to have my talk “F# Needs Love Too” selected and to have been included in line-up of speakers that included some familiar names like Eric Boyd, Jay Harris, Michael Eaton, David Giard, and Jennifer Marsman.

My talk was in the first time slot immediately following the keynote.  Considering I was up against some HTML5 and mobile development talks I was happy to see such interest in F#.  I thought the talk went well and spurred some good conversation.  Thanks to everyone that attended.  Hopefully you were inspired to take a closer look at the language and see how it can change the way you think about writing software.

Having the first time slot gave me the rest of the day to attend other sessions.  The sessions I selected were:

  1. Collaborate: Windows Phone and Windows 8 – Michael Perry
  2. Make Node.js Package. Become Famous. – Jay Harris
  3. Hot Data and Cool Cash – Joe Kunk
  4. Creating apps with high code reuse between Windows 8 and Windows Phone 8 – Jennifer Marsman

All of the talks were interesting in their own right.  Naturally I was most interested in the two Windows Phone 8/Windows 8 talks and they didn’t disappoint.  The other two sessions weren’t as immediately relevant to me but gave me some stuff to think about.

I’d like to thank the organizers for putting on yet another great conference.  I thought the event was every bit as good as the last one and was happy to be a part of it.

GR DevDay – March 2, 2013

If you’re looking for a great developer conference in the Grand Rapids, MI area I highly recommend checking out GR DevDay. This year the conference is being held on March 2 at Calvin College. The organizers have lined up a  great selection sessions covering a wide range of topics and technologies. Whether you’re developing for the cloud, desktop, or mobile spaces you’ll be sure to find something of interest.

I’m honored to be included among this year’s speakers. If you’re interested in an introduction to F# be sure to check out my session:

F# Needs Love Too!

Originally developed by Microsoft Research, Cambridge, F# is an open-source, functional-first language in the ML family. Despite its lofty position as a first-class Visual Studio language for the past two releases and its cross-platform availability it hasn’t seen widespread adoption in the business world. In this session we’ll take an introductory look at F#, exploring how its constructs and terse syntax can allow you to write more stable, maintainable code while keeping you focused on the problem rather than the plumbing.

I hope to see you there even if you don’t attend my session.
…but please do
…you know you want to!

CODODN Notes

I spent Saturday (Dec 8) over in Columbus, OH attending the Central Ohio Day of .NET conference. As with any multi-track conference there were plenty of good sessions to choose from but of course, I could only attend five. What follows are my raw, nearly unedited notes from the sessions I selected.

Underestimated C# Language Features

John Michael Hauck (@john_hauck | http://w8isms.blogspot.com)

Delegation

  • Anonymous functions
  • Closures
  • Automatic closures compile to classes

Yay!  ANOTHER discussion about using var or type name for declaring variables

Enumeration

  • IEnumerable<T>
  • yield return
  • IEnumerable of delegates

Deep Dive into Garbage Collection

Patrick Delancy (@patrickdelancy | http://patrickdelancy.com/)

Automatic Memory Management

  • Reference counting
  • Track & mark

Allocating

  • Application virtual memory
  • Heap is automatically reserved
  • New declarations are allocated into segments in the heap
  • Ephemeral segments
  • Clean-up tries to move longer lasting objects into other dedicated ephemeral segments
  • Longer-lasting objects are collected less frequently

GC Timing

  • When an ephemeral segment is full
  • GC.Collect() method call
  • Low memory notifications from the OS (physical memory)

Only finalization is non-deterministic

GC Process

  • Marking – Identifying objects for removal
  • Relocating – Relocating surviving pointers to older segments
  • Compacting – Moving actual object memory

Dead or Alive

Starting points:

  • Static Data is rooted in garbage collector (never out of scope)
  • Stack Root (call stack) has variable references
  • GC Handles – special cases that can be created and freed

Collector walks the tree from each point

GC Handles

Struct that has a reference to a managed object and can be passed off to unmanaged/native code

Marshalling

GCHandle.Alloc() and .Free()

Handle Types:

  • Weak – tracks the object but allows collection; Zeroed when collected; Zeroed before finalizer
  • WeakTrackResurrection – Weak but is not zeroed when collected; Can resurrect in finalizer
  • Normal – Opaque address via the handle (can’t get the address); not collected by GC; Managed object w/o managed references
  • Pinned – Normal with accessible address. Not collected or moved by GC; free quickly if needed

Generations

  • Generation 0 – newly allocated objects
  • Generation 1 – objects that survived gen 0; infrequent collection
  • Generation 2 – Long-lived objects; things allocated as large objects too; infrequent collection

Anything larger than 85K in memory is considered large and automatically placed on the large object heap.

Threshold checks consider machine resources including bitness and is always in flux (except gen 0 which is based on segment size)

Configuration

Workstation & server mode:

  • Default behavior is workstation
  • Workstation
    • Single-processor machines
    • Collection happens on triggering thread
    • Normal thread priority
  • Server
    • Multi-processor
    • Separate GC per thread processor
    • Parallel on all threads
    • Collection at highest thread priority
    • Intended to maximize GC throughput and scalability

Concurrency:

  • Foreground
    • Non-concurrent
    • All other threads are suspended until collection finishes
  • Concurrent & Background
    • Collect concurrently while app is running
    • Background (v4) is the replacement for concurrent
    • Collects concurrently while the app is running
    • Only applies to Gen 2 collection
    • Prevents Gen 0 & 1 collections while running

Latency modes

Time the user knows the system is busy

Useful especially when users will notice the collection – graphics rendering

  • Batch
    • Default when concurrency is disabled
    • Most intrusive when running
  • Interactive
    • Default when concurrency is enabled
    • Less intrusive but still accommodates the GC
  • LowLatency
    • For short-term use – impedes the GC process
    • Suppresses Gen 2 collection
    • Workstation mode only
    • Still collects under low host memory
    • Allows manual collection
  • SustainedLowLatency
    • Added in 4.5
    • Contained but longer
    • Suppresses foreground gen 2 collection
    • Only available with concurrency
    • Does not compact managed heap

Finalization

Non-deterministic

Only used with native resources (IntPtr handles)

  • To release unmanaged resources ONLY
  • Objects with a finalizer get promoted to the next generation and the next time the collector hits that generation it calls the finalizer; added to finalizaton queue
  • Finalizer runs on another thread after collection has finished and runs at the highest thread priority
  • Managed objects may already be freed
  • Flagged for finalization upon allocation
  • When troubleshooting performance check the size of the finalizer queue and look for hung finalizer threads

Disposable

Objects using managed resources that need to be released

Debug Build

  • Does some artificial rooting due to CLR optimizations

Unleashing the Power: A Lap around PowerShell

Sarah Dutkiewicz (@sadukie | http://codinggeekette.com/)

Covering PowerShell 3.0

Some Cmdlets:

  • Clear – clears the screen
  • Get-verb
  • Get-unique

Console

  • Part of Windows Management Framework 3.0 suite
    • 32/64 bit available
    • Windows 8 & Server 2012 have it installed
  • Built on CLR 4
  • Adds support for
    • Networking
    • Parallelism
    • MEF
    • Compatibility/Deployment
    • WWF
    • WCF
  • show-command cmdlet
    • allows searching for commands and executing in the console
    • often easier than get-command | more
  • Updatable help
    • Not installed by default on Win8/Server 2012
    • Update-Help cmdlet
    • Must run as administrator
    • No restart required
    • Can store to a network share
  • Language improvements
    • Simplified foreach (automatic/implicit)
      • PS C:\windows\system32> $verbs = get-verb
      • PS C:\windows\system32> $verbs.Group | Get-Unique
    • Simplified where
      • PS C:\windows\system32> $verbs | where group -eq “Data”
    • Enhanced tab completion
  • Unblock files with Unblock-File cmdlet
  • JSON, REST, & HTML Parsing support
  • Session improvements
    • Disconnected sessions on remote computers can be reconnected later w/o losing state
    • Both ends need 3.0

Integrated Scripting Environment

  • IntelliSense
  • Show-Command window
  • Unified console pane
  • Rich copy
  • Block copy
  • Snippets
  • Brace Matching

Scheduled Jobs

  • PowerShell jobs can now be integrated with task scheduler
    • Register-ScheduledJob
    • Found under Microsoft / Windows / PowerShell / ScheduledJobs

Autoloading Modules

  • PowerShell 3 automatically loads a module when one of its cmdlet is invoked

PowerShell Web Access

  • PowerShell in a browser
  • Mostly 3.0 w/ some limitations due to remotin
  • Prereqs:
    • Server 2012
  • Setup is difficult
    • Install web access
    • Authorization configuration
    • PowerShell remoting must be enabled to connect
  • Limitations:
    • Some function keys aren’t supportd
    • Only top-level progress is shown
    • Input color cannot be changed
    • Writing to console doesn’t work

Management OData IIS Extension

  • Allows RESTful OData access
  • Requires Server 2012, not Server Core

MS Script Explorer for Windows PowerShell

  • 32/64-bit platforms
  • PowerShell ISE is required
  • Downloadable (Non-standard)

Building Large Maintainable JavaScript Applications w/o a Framework

Steve Horn (@stevehorn | http://blog.stevehorn.cc/blog)

Quote from Kahn about complaining about status quo and theorizing about how things should be

(I tried to find the actual quote but couldn’t – if anyone knows where I can find it I’ll be happy to update these notes)

Assumptions for JavaScript Applications

  • Not progressive enhancement
  • JavaScript is enabled
  • Rendering of HTML templates is done on the client
  • Server side is for querying or performing work
  • The UI is the most important part of the app

Each framework is giving its own world view of how you should build an app

Code Organization

Book: JavaScript Patterns (Stoyan Stefanov)

  • How can I create modules and namespaces?

window.nmap = window.nmap || {};

Let JavaScript be JavaScript; don’t worry about public/private/etc…    

Constructor members are recreated every time the constructor is invoked

jQuery Tiny Pub/Sub http://benalman.com

Designing for Windows 8 Apps

Dan Shultz (@dshultz)

Metro/Windows 8 Style Design

  • Modern Design – Bauhaus
  • International Typographic Style – Swiss design
  • Motion Design – Cinematography

Windows 8 grid

  • Grid units
  • 20×20 pixel grids
  • Title size: 42pt
  • Title line height: 48pt
  • Page header is 5 units from the top

Responsive Design

…is the approach that suggests that design and development should respond to the user’s behavior and environment based on screen size, platform, and orientation

Techniques

  • A flexible grid
  • Media queries

Media Query Ranges

  • Mobile portrait < 479 px wide
  • Mobile landscape 480 – 767 px
  • Tablet portrait 768 – 1023 px
  • Tablet Landscape >= 1024 px

Certification Tips

  • Apps need to work in snap view to pass certification
  • Keep functionality off of the margins to prevent interference with charms and app switching
  • Use charms contracts where applicable
    • Share
    • Search
    • Picker
  • Need to include a privacy statement within settings
  • Weight functionality toward edges for higher usability
    • Center screen requires a posture change
  • Sharing & Ages
    • Limit < age 12
  • Reserved Space
  • Asset sizes
    • 100%
    • 140%
    • 180%
  • Invest in a great live tile
    • Consider different sizes

All Good Things…

IndyNDAThis isn’t the post I wanted to write tonight but I knew the time was coming. The leadership of the Indianapolis .NET Developers Association (IndyNDA) announced in its LinkedIn group that its December meeting will be its last.

IndyNDA has had a good run. Having endured for nearly 12 years it has been a cornerstone of the Indianapolis development community. When I moved to Indianapolis seven years ago it was the go-to place for all things .NET. Having come from a small user group in Fort Wayne I was a bit overwhelmed by the size of IndyNDA meetings at first but it has been part of my life most of the time I’ve lived here, increasingly so over the past four years.

I credit IndyNDA for helping craft me into the developer I am today. Over time IndyNDA broke me out of my shell. Through IndyNDA I’ve learned about things I probably would never been exposed to; I’ve formed relationships with people I’d probably never have met; and I’ve had opportunities I’d probably never have found on my own. I can’t thank the people of IndyNDA enough for its impact on me.

While I’m sad to see the group end I understand. The world has changed a lot in the past decade. When IndyNDA started it was the only game in town. Back then we didn’t have social media outlets like Twitter, Facebook, and LinkedIn; we didn’t have answer sites like StackExchange; and we didn’t have webcasts of every major development conference. All of this comes at a price though and in this case it’s that groups like IndyNDA have diminished importance.

IndyNDA may be coming to an end but I have high hopes for the future of the Indianapolis development community. Per the announcement IndyTechFest will be making a comeback next year and there are certainly other events around town as evidenced by a quick Meetup search. In the meantime though I’d like to thank Brad Jones, Dave Leininger, Dan Rigsby, Joel Dart, Alex Gheith, and everyone else that has led the group through the years. Your contributions are appreciated.

Indy GiveCamp 2012 Recap

Between building a new phone app, playing with a new Surface, and attending exciting development community events, I almost completely forgot to write about this year’s Indy GiveCamp. A few weeks have passed since the event and my memory is a bit fuzzy so this will be a little sparse but I better capture what I can remember.

Indy GiveCamp was held October 5-7. Once again MID Technologies was kind enough to allow our group of more than 40 software professionals to use their facility for the weekend so we could help five organizations achieve their goals through better use of technology. As a bonus, we had enough unregistered volunteers to offset the number of no-show volunteers so we were able to assign a few people to work on the Indy GiveCamp site too.

This year’s non-profits were:

Indy Irish Fest's Old Home Page

Indy Irish Fest’s Old Home Page

I was the lead for the Indy Irish Fest project. Indy Irish Fest is an all-volunteer organization whose mission is to preserve, promote, and nurture Irish culture, arts, music and history. 2012 marked their 17th annual festival.

The organization has been living for years with a site that was becoming dated and increasingly difficult to maintain. It was cluttered and information was often hard to locate. Additionally, the site was static HTML built and modified with FrontPage. To make matters worse, sometime shortly before GiveCamp the FrontPage visual editor started choking on some HTML and forcing them to make changes to the HTML directly.

After a lot of discussion with Mary and Terry from Irish Fest about their goals for the site and with the help of the two volunteer designers we were able to modernize their site and transform it into one that they could use to better spread their message without the friction of FrontPage.

Indy Irish Fest's New Home Page

Indy Irish Fest’s New Home Page

We reorganized most of the content, promoting the most important things, and demoting some of the less important things. We made it easy for visitors to locate cultural events in the cultural calendar, to sign up for the mailing list, and find content through a search. We also made it easy for visitors to connect with the festival through various social media outlets with focus on Facebook and Twitter.

GiveCamp is one of the few outlets for software professionals to use their talents to give something back to their local community. I was excited to work with such talented people on the Irish Fest site and once again proud to be part of a larger effort where five organizations were given the help they needed to enter their next chapter.

I’m already planning on volunteering next year. If you can spare a weekend I really recommend joining in on the action. You won’t be disappointed.