Why F# is So Important to the Future of Software Development

by kevin 9/17/2008 6:30:00 PM

I am a big C# fan. As a general purpose, imperative, object-oriented language, C# has begun to take on some functional language capabilities that I like very much. LINQ just rocks, for example. And LINQ is a very functionally-oriented technology. It's so easy and expressive to get set-oriented work done using LINQ and it's functional underpinnings are the reason why.

I have been thinking a lot recently about why F# might be important to the future of all software development. If you think about it, there's really little in F# that doesn't already exist in other languages like OCaml and Haskell. But F# is significant and different because Microsoft is behind it and because of the tight integration with the .NET framework. But beyond the who of F# is the why of its importance. And the why, in my mind can be summed up with these five bullet points:

  • ORMs are failing to gain mindshare not because they aren't good domain modeling tools (as some complain about). They are failing because the imperative, object-oriented languages in which we use ORMs are unfriendly to sets and tuples.The database is full of nothing but sets and tuples. So we read them into objects and wonder why there's an impedence mismatch. F# is not only set and tuple friendly. You can't really think properly in F# without these first-class constructs.
  • Domain Specific Languages (DSL) are becoming more and more important in the marketplace. And functional languages are great for building language compilers. Language parsing into discrete intermediate forms is a problem that benefits greatly from the lambda calculus and functional decomposition. F# is appearing at the right time and place in history to serve in the critical role of helping us to build new DSLs.
  • Many of our time-honored design patterns are workflow-oriented. So, why do we shoe-horn them into data structures? Workflows are, by definition, composed of functions invoking higher-order functions. Step 3 invokes on the result of Step 2 which invokes on the result of Step 1. So, why do we code the Visitor Pattern to walk a tree into a data structure like an object? It makes no sense, really. F# allows us to revisit these time-tested patterns and view them in the light of functional decomposition. And the result will allow many who have been unable to grasp those patterns though an imperative lense to "get it" for the first time.
  • Service-Oriented Architecture (SOA) is predicated on the idea that strict operation contracts exist that take discrete, strongly-typed inputs and return strongly-typed results. F# rolls like that. There's no object-orientation in SOA, per se. In fact, SOA sort of shuns OOP to a certain degree. And good service design also avoids side effects, another tenet of functional languages. So, if SOA is important, and I think it is, then languages that follow the patterns of SOA will also be important in building compliant architectures. I think good architects will recognize the pattern and find interesting ways to expose services via F#. We will code the guts of services in C# and Java in the future. No question there. But the workflow, scheduling and execution core of SOA will be based on functional languages like F# instead.
  • Moore's law is breaking down. Intel and other companies are all moving to put more computing cores into their packages because they can't scale computing power vertically beyond what modern physics will allow. So, they are scaling horizontally to meet customer demand. The problem with this concept is that the marketplace isn't really ready for this kind of change. Massive pools of threads attempting to use Many Reader, Single Writer Mutexes with Starvation Avoidance ain't gonna work, my friends. We need a new model that will make parallelism invisible. But for parallel computing to become invisible, we need to move to a model that doesn't require the programmer to be involved in locking and serializing access to their code. F# is ready to help us think that way. And it's .NET! Beauty, eh?
These ideas aren't all mine. I borrowed heavily from Amanda Laucher and Ted Neward. But, I've added my twist, ideas and opinions of course. What you do think F# means for our industry and our profession? I'd love to hear from you.

 

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: , , ,

Architecture | Fun | Software Development

Follow Me Follow You Source Code

by kevin 8/23/2008 2:20:00 PM

A few weeks ago, I blogged about a tool I had written called Follow Me Follow You to help me understand who was following me on Twitter.com and, from that group, who I was following. See the Venn diagram below to see what I was after. Since then, the idea of understanding who's who in your TwitterVerse has become somewhat fashionable. This is probably due to the low signal-to-noise ratio that you get when you follow a lot of people.

Dunbar's number says that we primates are limited to about 150 meaningful relationships. This seems to hold true in the social networking space, too. In the TwitterVerse, for example, when the number of friends you have approaches about 150, there's so much noise, you can't get much value from the tool without other tools like TweetDeck which allow you to create sub-groups within your tribe. So, understanding your friends and your mutual friends as shown in this diagram can be helpful. Also, being able to quickly scan those who follow you but you don't follow from time to time, can help you from becoming a Twitter snob, if you know what I mean.

I finally found a couple of hours to clean up the Follow Me Follow You source code. I've linked to a ZIP archive containing the source code below. It's C# 3 code and includes a stripped-down version of my Mingle.NET social networking API. The TwitterClient class demonstrates how powerful lambda expressions are in C# 3. Check out the code required to load up the NonFollowingFriends (green), MutualFriends (blue) and NonFriendedFollowers (yellow):

private void LoadFriendsAndFollowers( object sender, DoWorkEventArgs e )
{
 if (_creds == null)
  throw new ApplicationException( "The credentials are null. " +
   "The user must be known to complete this operation." );

 _friends = FetchTwitterUserScreenNames( String.Format(
  _friendsListUrlTemplate, ScreenName ), false );

 _followers = FetchTwitterUserScreenNames( String.Format(
  _followersListUrlTemplate, ScreenName ), true );

 // left side of Venn diagram - friends who don't follow me
 _nonFollowingFriends = _friends.FindAll(
  friend => _followers.BinarySearch( friend ) < 0 );

 // right side of Venn diagram - followers who aren't my friends
 _nonFriendedFollowers = _followers.FindAll(
  follower => _friends.BinarySearch( follower ) < 0 );

 // intersection of Venn diagram - my mutual friends
 _mutualFriends = _friends.FindAll(
  friend => _nonFollowingFriends.BinarySearch( friend ) < 0 );

 var onLoadComplete = e.Argument as
  Action<ICollection<string>, ICollection<string>>;

 if (onLoadComplete != null)
  onLoadComplete( _friends, _followers );
}

Follow Me Follow You C# Source Code (19KB)

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

C# | Fun | Social Networking | Software Development

On Quitting Your Job by James Avery

by kevin 8/11/2008 5:45:00 PM

James Avery and I spent some time together at CodeStock this past weekend. He told me that he was tired of doing technology presentations. I entirely understand what he means. Education in the developer community is very important but at some point, you just want to switch gears and talk to your peers about other stuff that's important in our space. We're all geeks, that's for sure, but we need to be savvy business people, too. And that requires just as much peer training and influence.

James floated an idea past me for a presentation he would like to do and I liked it a lot. It's not your average Code Camp faire but I asked James if he would travel up from Raleigh on October 4th to present this session to our Richmond attendees. He agreed to come do it. The session is called "Tune In, Turn On and Quit Your Job" and it goes something like this:

Tune In, Turn On and Quit Your Job by James Avery

"We don't have a lot of time on this earth. We weren't meant to spend it this way. Human beings were not meant to sit in little cubicles staring at computer screens all day, filling out useless forms and listening to eight different bosses drone on about mission statements." - From the Movie Office Space (1999)

Stop working for the man and learn about writing a software product, building a successful web application or becoming an independent consultant.

I can hardly wait to attend this talk. I predict a packed house. I hope James keeps going on this vein and writes his next book on this topic.

James is one of many great regional and local speakers who will be presenting in Richmond at the upcoming Code Camp. Want to learn more about the Richmond Code Camp on October 4, 2008? As of August 11, 2008, we still need a few more speakers. Don't miss your chance to show the central Virginia developer community that you want to contribute your ideas, too. Submit your presentation abstract and bio here.

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: , ,

Code Camp | Fun | Richmond | Social Networking

Follow Me Follow You

by kevin 8/4/2008 11:06:00 PM

I've been playing around with the Twitter API and some of the more popular Twitter clients. My favorite desktop client for Twitter is TweetDeck. But one feature I really would like to have is a view of the relationships between my friends and followers. I want to see something like this:

I thought if I could manufacture that sort of diagram where the people in each part were clickable, I would be able to see and manage the relationships in my "tribe" more clearly. Tonight, taking a break from work coding, I created a desktop application that isn't as pretty but does what I want. It's called Follow Me Follow You and it looks like this:

OK, I warned you it wasn't pretty. But it is pretty cool. You can see the three parts of the Venn Diagram shown above as listboxes on the left side. The left side and right side are independent except that if you click on the screen name of a user on the left, it loads that user's Twitter page in the browser on the right. That feature alone is nice. Having persistent access to your tribe in a directory format is handier than I thought it would be. I can see part of a conversation in the browser window and hop around to related parties without having to use Summize, aka the Twitter search engine.

I can also scan the lists to find out other interesting information. For example, in the "Followers not Friended" list, I can scan for new names that I may have missed in e-mails that Twitter.com sends to me when someone starts following me. After clicking on their name and logging in within the web browser on the right side, I can look at their timeline and decide whether or not to follow them from there.

I used my new Mingle.NET library, a social networking library for the .NET Framework, to build the new tool in about an hour. I haven't released Mingle.NET or the Follow Me Follow You tool. If you're interested in them, let me know and I'll get them ready for production. I can only work on them in my spare time and there isn't much of that these days. :)

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: , ,

Fun | Social Networking

Meet the New Mike

by kevin 7/28/2008 6:10:00 PM
Photo of the my new studio mic and my old mic side-by-side

My new podcasting studio microphone came today. It's the Samson C01U Studio Condenser Microphone recommeded by my mentor Andy Leonard. So far, I really like the new mic. I bought it from an eBay company called Unique Squared because they seemed to carry audio equipment in my price range of high quality and they had a very good rating. Payment was simple via PayPal and the package showed up in just a few days in excellent condition.

I bought what's called the Podcasting Kit which puts together some parts that make a lot of sense for podcasting. These include the C01U mic, of course, a heavy base, a retro-looking spider mount for absorbing vibration noise and a pop filter for taking the edge off of words beginning with that hard "P" sound.

In the picture attached to this blog entry, you can see the old $5 mic in the foreground and the new $112 mic behind it. I thought my friend Joey Beninghove would get a kick out of seeing the two microphones together since he ribbed me in a tweet about this purchase a few days ago.

This mic is all-digital and USB-connected so I was worried about drivers and potential incompatibility. Thankfully, there were no drivers to install for Windows XP. I just plugged the mic into the USB port and Windows XP recognized it right away. I had to adjust the mic volume but I was up in running in just a few minutes. How the setup goes in Windows Vista (or Mojave) or Mac OS X remains to be seen.

The Cakewalk LE (ostensibly meaning Limited Edition, or cripple-ware) software that came with the package was a different story. It installed OK but it was clearly a 1990s style installer that had been cobbled together by someone who didn't really know what he was doing. After being interrupted by about 20 pop up dialogs asking inane questions about features I didn't understand, I got through the installation. However, after the installation, I discovered that the the Cakewalk LE user interface is pretty much incomprehensible for someone like me who has never used audio mixing and voice-over software before. I suppose I'll get the hang of it over time. If you know of some better (hopefully freeware) software that I should be using or if you can aim me at a Cakewalk LE Tutorial, that would be great.

I used the Cakewalk LE software to record a voice version of this blog post as an experiment. You can use the player below or download the MP3 file here. Let me know what you think. Drop me a note anytime, OK?

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: , ,

Fun

You Know Your Kids Are Geeks When #1

by kevin 7/5/2008 6:27:00 PM

You know your kids are geeks when...

Dishwasher buttons showing bits 0, 3 and 5 set.

You tell them to use the high-temperature configuration on the dishwasher and they collectively refer to that as setting number 41.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: , ,

Fun

Software Development Meme

by kevin 6/30/2008 8:30:00 PM

Frank La Vigne called me out on the Software Development Meme. Michael Eaton started this one. The path to me is:

Michael Eaton >> Dan Rigsby >> Chad Campbell >> Pete Brown >> Frank La Vigne >> Kevin Hazzard 

Here's my response:

How old were you when you first started programming?

I got a hand-me-down TRS-80 Model II in 1981 from a friend who had recently upgraded to a new machine. I was 16 years old then. It was like crack for me. I was instantly addicted to software development or at least the idea of it.

How did you get started in programming?

In the early days, commercial opportunities outside of the mainframe computing space were rare. At age 16, I didn't have access to a mainframe yet. Small businesses likely to use things I could invent used paper to track their accounting and they weren't likely to switch to using a computing system that didn't fully replace their accounts payable, accounts receivable, general ledger and payroll systems.

Although spreadsheets like VisiCalc and Lotus 1-2-3 arrived on the scene early, they were seen initially only as helper applications for doing what-if analysis and such. And they weren't highly programmable anyway. So real programming jobs related to the first "killer application" were hard to create. As a result, those of us working on smaller, home-based computers had no real market for our ideas. So we built games and so-called bulletin boards until our age arrived.

It wasn't until I bought an AT&T PC 6300 Plus with an 80286 CPU in 1986 that I found my first real commercial opportunity writing a turn-key accounting and inventory tracking system for a chain of video stores.

What was your first language?

Zilog-80 Assembler. I was a math geek so assembly language spoke to my soul.

What was the first real program you wrote?

I had just turned 17. My Mom was working for a local hospital organizing paper-based records. The hospital had a new numbering system for patient records for which they had to apply brightly-colored sticky labels to manila folders. I wrote a program for her that determined how many of each numeric digit was required to label a range of numbers. I started with a brute force approach which was very slow and then created an algorithm with a fixed number of computations to yield the same result. The hospital bought the program from me for $50 to help them manage the disbursement of labels to all of the contractors working on the project. It was written in Color BASIC for the Tandy Radio Shack Color Computer. I ported it to GW-BASIC to run on the hospital's IBM PCs.

What languages have you used since you started programming?

Various assembly language dialects: Z80A, MC6809, Intel 80x86, DEC Alpha and Motorola PowerPC. I wrote assembler on a Perkin-Elmer mainframe but I don't remember what the CPU architecture was, to be honest. I remember it was pretty weird, more like a macro compiler than an assembler. I got my first C language compiler for the Tandy Radio Shack Color Computer although I preferred using the assembler on that machine.

I was introduced to C With Classes (which later became C++) in 1984. There was no C++ compiler for the Perkin-Elmer mainframe I was working on. So we used something called Cfront to translate the C++ text into C language which was then further compiled into a set of linkable objects. I worked in C and C++ almost exclusively from 1988 until 2002 with brief stints into Java-land.

In 2002, the bright light of C# shone upon me and I've been pretty happy since then. C# is more expressive and makes me more productive than any other language I've ever worked with. I love Python and I'm itching to use it commercially. However, finding real applications that I can't implement with C# is pretty tough. I'm not sure PowerShell is a real programming language but, if it is, it's definitely one of my favorites.

Every time I've been forced to work with JavaScript (directly or indirectly), I've felt like I needed to take a shower. If JavaScript or HTML ever becomes the right way to implement anything, I'm switching professions. Silverlight has me very excited, as you can imagine.

What was your first professional programming gig?

In my senior year as an undergraduate student, I was contracted to write an application for tracking the inventory and sales for a small chain of video stores. I built the whole thing using Symantec's Q&A product. It was a way-cool, weird product that was part word processor, part database, part reporting engine. You could do amazing things in a short time with Q&A that would take days or weeks to implement using other tools. I think it was the first RAD tool there ever was in the PC space.

If you knew then what you know now, would you have started programming?

Yes. I enjoy software development now more than ever.

If there is one thing you learned along the way that you would tell new developers, what would it be?

Teach part time. Whether you do it at work, in the user group community or as an adjunct faculty member at a local college (I do all 3), you'll find that you learn more, faster by preparing to teach than you could ever learn as a student. Teaching is a fantastic form of mental catharsis. Teaching also helps build your public speaking skills, which translates into greater responsibility and a higher salary as you move forward in your career. Developers who can build cogent arguments and present them to executives often go further and faster in their careers.

What’s the most fun you’ve ever had … programming?

When I worked at Intel Corporation in the Architecture Labs, the supercomputing group parallelized one of my fractal algorithms and made it available as a 3D "game". I had written the Pascal language implementation of the Julia Set solver in college while I was working on a paper concerning the Riemann-Stieltjes Integral. The Julia Set is a particularly beautiful fractal based on the concept of a Riemann map. Working with the supercomputing group to parallelize my algorithm and see it work in real-time 3D was a heart-poundingly cool experience. You could visually "drive through" the set to infinite levels of detail, zooming, panning and scanning in real time. What took my PC days to compute, the supercomputer was performing in milliseconds, allowing you to move through the Julia Set fluidly as if flying in a flight simulator. It was a breathtaking experience for me.

Who are you calling out?

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Fun | Software Development

How Many Canaries Does It Take to Airlift a Whale?

by kevin 6/9/2008 10:30:00 PM

blissful whale carried by twitters For twitter.com users, the near perfect depiction of the series of poor architecture choices leading to the current state of affairs shows twitters (birds) airlifting a seemingly blissful whale by threads over the sea. Aside from the fallacy of bliss in losing access to one's tribe, no image could be more apropos for indicating that twitter is down. Twitter is over capacity in so many ways.

I've been thinking and writing code in the personal connectivity space for a decade or more. I even have a patent in the peer presence space. I joined a freaky little start-up that Intel Corporation invested in called The Palace. Time Warner and SoftBank were in that mix, too. In the late 1990s, we had high hopes of turning our vision of inter-personal connectedness into a cash cow. There were distance learning angles, entertainment angles, etc. All painfully 1990s thinking in retrospect.

We made so many mistakes. However, the technology wasn't the real problem. It was our thinking that was specious. Even as our pens stroked out the patents on paper and our keyboards tapped those ideas into great code, we couldn't imagine the power of the tribe that services like twitter.com evoke in the average user. Our Palace code was built very much like twitter. Centralized message dispatch. It did OK at intranet scale but when it came to thousands or millions of users, it was just the wrong way to build the thing.

Success can be a powerful enemy. Hubris, it seems, is a much greater threat to any technology-oriented business. The scale of the Internet guarantees that. As Andy Grove taught me, Only the Paranoid Survive. Paranoia, like hubris, is an equally self-interested set of emotions. But paranoia is sigularly devoid of vanity. And vanity distracts us from truthful ideas like, "It's probably not smart to build a hub-and-spoke protocol for something that has to scale to millions of users."

I agree with Scott Hanselman that microblogging should not be centralized. Except for SMS and directory access, there's just no reason to make any other parts of a system like that centralized.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Architecture | Fun

Who Really Needs This Kind of College Guide?

by kevin 6/6/2008 6:20:00 PM

I snapped this pic walking through the Books-A-Million store in Richmond, Virginia on 5 June, 2008. Sign of the times or a simple shelf stocking error?

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Fun | General | Richmond

SnagAJob.com Open House 4 June 2008

by kevin 5/20/2008 5:38:00 PM

My company is having an open house on June 4th, 2008 in Richmond, Virginia. Free tickets to see the Wailers concert at the SnagAJob.com Pavilion across the lake from our office. And did I mention free cocktails and heavy appetizers? Mmmmm. Here's the text of the invitation. If you are in Richmond on the 4th of June, please come out and have some fun with us.

YOU ARE INVITED TO OUR OPEN HOUSE
Time:
5:30pm-7:00pm
Location:
4880 Cox Road Suite 200
Glen Allen, VA 23060
RSVP to openhouse@snagajob.com by Friday, May 23

SnagAJob.com is going through an exciting period of expansion and we’d love to show you our office space, and give you the opportunity to chat with some “Snaggers.”

This is truly an Open House, so please feel free to pass this invitation on to your friends and colleagues. While this is not a recruiting event, we do welcome you to check out our current opportunities at http://www.snagajob.com/careers/, and talk with Snaggers about what it’s like to work here.

This will be a casual event with cocktails and plenty of heavy hors d’oeuvers. After the Open House those interested can head next door to Innsbrook’s SnagAJob.com Pavilion for the Wailer’s concert – Tickets are Free!

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: , ,

Fun | Richmond

Powered by BlogEngine.NET 1.3.1.0
Theme by Mads Kristensen


Kevin's on Twitter / FriendFeed

W. Kevin Hazzard Welcome to Kevin Hazzard's Blog. Kevin is a Software Architect, Professor and Microsoft MVP specializing in C#, WCF, Silverlight and IronPython.

View Kevin Hazzard's profile on LinkedIn
Microsoft MVP Award Foolish robot!

Calendar

<<  October 2008  >>
MoTuWeThFrSaSu
293012345
6789101112
13141516171819
20212223242526
272829303112
3456789

View posts in large calendar

Recent comments

Authors

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2008

Sign in