Andrew Ducker (andrewducker) wrote,
Andrew Ducker
andrewducker

Playing with code

God, I wish we had the latest version of Visual Studio at work.

I spent the morning playing with C# code after reading this article on brevity in code.

Trying to find something that I preferred over the Ruby code that did this:
“”.methods.sort.grep /index/i

and eventuall ending up with:
from methodName in "".MethodNames() 
  where methodName.Grep("index",RegexOptions.IgnoreCase) 
  orderby methodName select methodName;

The main thing that would be nice would be a simple sort keyword that could be used if only one variable was being operated on, and likewise not needing a select if there's only one item being dealt with.
Subscribe

  • Interesting Links for 04-03-2021

    Cuttlefish can delay gratification (tags: psychology fish ) UK announces it will unilaterally change Brexit deal with EU, risking new…

  • Interesting Links for 03-03-2021

    This rail gun is for training purposes only (tags: guns joke trains ) Six comedy Shakespeare adaptations (tags: Shakespeare funny ) British…

  • Interesting Links for 02-03-2021

    A journalist, the N word, and the New York Times (tags: journalism racism ) Tomahawk Steakhouse staff told to loan the firm 10% or they could…

  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

  • 6 comments