Entries:
Comments:
Posts:

Loading User Information from Channel 9

Something went wrong getting user information from Channel 9

Latest Achievement:

Loading User Information from MSDN

Something went wrong getting user information from MSDN

Visual Studio Achievements

Latest Achievement:

Loading Visual Studio Achievements

Something went wrong getting the Visual Studio Achievements

Comments

JChung2006 JChung2006
  • JAOO 2007: Bob Martin and Chad Fowler - Debating Static versus Dynamic Typing

    REPL is the thing I miss most in VB.  Bring it back please, Microsoft.
  • JAOO 2007: Erik Meijer and Dave Thomas - Objects, Functions, Virtual Machines, IDEs and More

    John Melville, MD wrote:
    

    JChung2006 wrote:
    Can you give an example of what you're talking about, John?

    Say I want to convert a list of strings to a numbered list of strings. This works:

    IEnumerable<String> NumberStrings(IEnumerable<String> input) {
      int i;
      return input.Select(s=>String.Format("{0}. {1}", ++i, s));
    }

    but this does not work:

    IEnumerable<String> NumberStrings(IEnumerable<String> input) {
      int i;
      return input.AsParallel().Select(s=>String.Format("{0}. {1}", ++i, s));
    }

    Evemtually numbers will be repeated or skipped because of race conditions involving the ++i expression.

    [For the nitpickers out there: I know that numbering n items is inherently sequential and that trying to do it in parallel is foolish.  I am trying to write a simple example of code that looks like it should work because its "functional," but doesn't.]

    Even though I am using ParallelFX, lambdas, LINQ, and all the other functional goo, its not a magic wand that lets me ignore the problem of shared mutable state. If I were using lisp, haskel, or another functional language it wouldn't let me do the ++i, because they don't have mutable state at all.  The success of functional languages (in which no beginning student really believes) is that you can actually write meaningful programs without it.

    Then it gets worse because if the ++i were actually a function call.  In functional languages, the language guarentees no mutable state.  In C# I may not know if it mutates state, or it may not do so now and change in the next version.  It might mutate state only in an edge case I didn't test for.  All of the sudden, my correctness depends on a sometimes very subtle implementation detail of (potentially) someone else's code.



    I pointed out the flaw in the logic of somebody who innocently asked for a parallel version of a for loop in another video thread (the Parallel Fx video thread, I believe).

    There are however many problems that can be solved efficiently by leveraging data parallelism, e.g., map-reduce, for which we have no really clean or concise semantics built into our current set of CLR programming languages.

    It isn't so much the "functional programming" aspects of functional programming languages that solve this so much as the semantics and syntax for expressing those semantics in such a way that lends itself well to parallelism.

    We'll need documented guidance to use these things wisely.  You can write grossly inefficient and-or bug-ridden code in any language like SQL or C#.  That doesn't make these any of these languages less than useful.

    Hopefully universities are doing a better job these days of teaching the concepts of functional programming.  When I was in school, I had to go to graduate school for that sort of thing.  I hope computer science curriciula has improved since those days.
  • JAOO 2007: Erik Meijer and Dave Thomas - Objects, Functions, Virtual Machines, IDEs and More

    Can you give an example of what you're talking about, John?
  • JAOO 2007: Bob Martin - Life in the Universe, Beautiful Code and Programming Discipline

    I'm sorry, but "write code that doesn't suck" is worthless advice.  Better advice would be "how to convince the folks who pay for code that beautiful code is worth paying for."
  • Programming in the Age of Concurrency - Anders Hejlsberg and Joe Duffy: Concurrent Programming with

    ktr wrote:
    parallel for (int i = 0; i < 10; i++)
        // do something

    The way they're doing parallel for is better.  The way you've suggested serializes access to i unnecessarily.
  • Mohsen Agsen: Bridging the Gap between PC and Enterprise, Developer and Designer

    PerfectPhase wrote:
    Is it really necessary for ES to have this functionality when you already have the likes of Premier etc out there?  I would have thought that the workflow would be to edit video in an external application and then import into Expression to be encoded?

    Yes, it makes sense if Microsoft wants to compete with Adobe.  Microsoft should add a non-linear video editing application to the Expression Studio suite and integrate it with the rest of the applications in the product.

    As things currently are, Microsoft has a long way to go to catch up with Adobe, and there isn't a compelling enough story for designers to pick up Expression Studio.  Adobe is the incumbent.  Microsoft is just getting started.
  • Alex Hinrichs and Jeff Woolsey: Announcing Windows Server 2008 RC0

    Charles wrote:
    
    JChung2006 wrote:
    I'll ask the obvious:  why not just call this RC1?


    Did you watch the video?

    I did.

    Software people tend to get silly when it comes to versioning things:  alpha, beta, CTP, RC0, version 0.041a-1.  You think that you're communicating useful semantic information with these obtuse, cryptic designations when a simple version 1, 2, 3, etc. would suffice.

    So again, why not just call this RC1?  Release Candidate means something to me.  1 means something to me.  0 means nothing to me in terms of versioning except perhaps a peculiar reluctance to commit to something being an actual release candidate, which is pretty much the opposite of what was said in the video.
  • Alex Hinrichs and Jeff Woolsey: Announcing Windows Server 2008 RC0

    I'll ask the obvious:  why not just call this RC1?
  • Patrick Dussud: Garbage Collection - Past, Present and Future

    JohnnyAwesome wrote:
    They wrote J Script in the time-span of several weekends? And he wrote that in Lisp and then rolled a C translator from scratch?

    There is a reason why I could not work at Redmond and that just about summarizes it.

    It's not that difficult, especially if you've done it before, like most people would have in any decent computer science graduate program.
  • S. Somasegar (Soma) and Scott Guthrie on Orcas Beta 2: What's in it?

    schroedl wrote:
    C++/CLI offers a somewhat painful approach to the .NET libraries.

    What's painful about the approach taken for C++/CLI and its interface with the .NET libraries?  This would be some good feedback to send to the C++/CLI and VS teams.