19,927 reputation
94675
bio website ericlippert.com
location Seattle, WA
age 42
visits member for 4 years, 3 months
seen 6 hours ago

Eric Lippert develops C# analyzers at Coverity. During his sixteen years at Microsoft he was a developer of the Visual Basic, VBScript, JScript and C# compilers and a member of the C# language design committee; he is now a C# MVP. He is on Twitter at "@ericlippert" and writes a blog about programming language design and other fabulous adventures in coding at http://ericlippert.com.


Jan
12
awarded  Nice Answer
Jan
12
comment How does big O notation indicate upper bound on a function?
@Brian: I see your point. I interpreted the question as being "I have a program whose cost is f(n) = n + 10, which is O(n). I think you are interpreting the question as "I have the program fragment (int n) => n + 10, which I agree is O(1).
Jan
12
revised How does big O notation indicate upper bound on a function?
[Edit removed during grace period]
Jan
10
awarded  Custodian
Jan
10
reviewed Approve How does big O notation indicate upper bound on a function?
Jan
10
answered How does big O notation indicate upper bound on a function?
Jan
1
comment When should I use event-based programming?
You might also be interested in learning about "reactive programming", which has a lot in common with event-driven programming.
Nov
23
awarded  Good Answer
Oct
26
awarded  Yearling
Oct
16
comment Name for this type of parser, OR why it doesn't exist
Are you possibly looking for monadic parser combinators -- that is, a larger parser composed of several smaller parsers. They are handy for situations where an "island" of one language is embedded in another. My former colleague on the C# design team Luke Hoban has a good article on them: blogs.msdn.com/b/lukeh/archive/2007/08/19/…
Sep
28
comment Why do most programming languages have special keyword or syntax for declaring functions?
The question "why do you need a syntax for nominal functions if you have lambdas and variables?" is reasonable, but why stop there? Why have a syntax for events? An event is just a rule for combining functions. Why have properties? Just a pair of functions. Why have strings? Strings are just functions that take integers and return characters. Why have integers? Just use Church Numerals as your integers. In fact, why have anything at all except the S and K combinator?
Sep
28
comment Why do most programming languages have special keyword or syntax for declaring functions?
C# had anonymous functions -- which are just lambdas without type inference and a clunky syntax -- since 2005.
Sep
9
awarded  Good Answer
Sep
8
awarded  Good Answer
Sep
8
comment What is a “lifted representation”?
I discuss the meaning of "lifted" in the context of C# here: blogs.msdn.com/b/ericlippert/archive/2007/06/27/… -- likely the Scala developers are using the term in an analogous, but more general fashion.
Sep
8
comment What is a “lifted representation”?
A perhaps more clear example of "lifting" is lifting to nullable (or "optional" or "maybe") types. For example, suppose you have an operator + defined such that int + int --> int. The lifted-to-nullable operator int? + int? --> int? has the semantics of "if either operand is null then the answer is null, otherwise use the non-lifted operator on the values".
Sep
8
comment Why is the use of conjunctions in method names a bad naming convention?
Consider: (1) using "optional" rather than "or null". "GetOptionalEntity" sounds better to my ear than "GetEntityOrNull". (2) the .NET base class library uses the convention that if you have two methods that differ only in what they throw, name the one that cannot throw "TryBlah". For example, Int32.TryParse and Int32.Parse -- both parse a string into an integer, but the former returns a Boolean indicating success and the latter throws on failure.
Sep
8
comment What's wrong with comments that explain complex code?
Rather than answering your question here I've posted some thoughts to my blog. ericlippert.com/2014/09/08/comment-commentary. In short: a complex algorithm should have a specification, and the comments should refer to that specification.
Sep
5
awarded  Enlightened
Sep
2
comment The Definition of “Strong Type Systems”
@supercat: The VB6 and VBScript type systems back in the day also had many bizarre aspects like that. The type system attempted to work out which operand of a given operator was more "slippable" into another type, eg, comparing the literal 2 against a variant containing a string could have different results than comparing a variant containing 2 to a literal string. It thoroughly broke the fundamental rule of late-binding: that runtime-bound behavior behave as though the types had been known at compile time.