
C# 4.0: The industrial response to Lisp? - fogus
http://axisofeval.blogspot.com/2010/07/c-40-industrial-response-to-lisp.html
======
Aaronontheweb
"I'm assuming, based on long observation, that Microsoft with high likelihood
fucked up the pragmatics completely, and that programming in C#, as opposed to
reading about it, is deeply depressing."

I've not found that to be true - C# is a lot of fun to work with.

~~~
j_baker
C# would be awesome except that it is a very "IDE intensive" language. Don't
get me wrong, Visual Studio is a very good IDE (and MonoDevelop is shaping up
nicely), but I'd still prefer vim or emacs as opposed to needing a fancy IDE
to be very productive.

~~~
olavk
C# is designed with IDE support in mind. For example, in Linq the "map" syntax
is:

    
    
       from a in b select a.x
    

This syntax is actually backwards compared to both SQL and list comprehension
syntax is most languages, which have the selector expression is before the
input list. E.g in SQL:

    
    
       select b.x from b
    

Or list comprehensions (in eg. Python):

    
    
       [a.x for a in b]
    

So why did MS change the syntax like this? Most developers already knows SQL
syntax, and Linq queries are supposed to be able to map directly to SQL.

The reason it that it is not possible to provide code completion in the
selector expression if the type of the list is not yet known. Hence in C# the
list is written before the selector expression, so the editor helpfully can
list all a's members when typing `select a.`

Another example is "Partial Classes" which is a curious language feature which
makes it more smooth to work with UI-designer generated files, but which I
don't think has any useful function outside of an IDE.

I don't think many other languages are designed with IDE support in mind in
such a way. This makes it possible to provide a very smooth IDE experience.

~~~
wvenable
From a theory perspective, SQL has it backwards. The projection operation in
relational algebra would come last. It certainly helps with IDE interactions
but it makes sense entirely on its own.

~~~
olavk
I may be confused, but according to Wikipedia
[http://en.wikipedia.org/wiki/Projection_%28relational_algebr...](http://en.wikipedia.org/wiki/Projection_%28relational_algebra%29)
it seems that in relational algebra notation the attribute names are written
before the relation, since the relation is an argument to the projection
function.

This seem to me to be closer to SQL syntax.

~~~
wvenable
The attribute names are written first, but it's like nested function calls:
projection(selection(R)). The joins are 'evaluated' first, then selection
(where), and then projection.

I suspect that SQL was actually designed to match the notational order (but
reversing the intent) they still got it wrong: to match the notation, it
should be SELECT .. WHERE .. FROM.

~~~
olavk
Interesting point, but that would apply to function notation in general, not
just relational algebra.

a(b(c(x))) is "backwards" because the functions are evaluated in the opposite
order than they are written. This is a flaw in math and in most programming
languages! I suppose stack-based languages have it right, and the OO method
chaining syntax in Linq and in e.g. JQuery has it right, since evaluation
order is left-to-right.

------
DrJokepu
> With LINQ's expression trees, they seem to tackle the same problem as Lisp
> does with S-expressions.

The problem is that at the moment, it's a lot harder to work with Linq
expression trees than with S-Expressions. If you're not very, very, very
careful, expression trees can very quickly become an unmaintainable, terrible
mess and it is very hard to debug them - it's a lot more painful than in Lisp.
This might change in the future though with better tools.

------
cageface
Microsoft has half of the best CS minds in Europe working for their research
division. Some of that genius is bound to leak into their products eventually.

~~~
mahmud
I would be more interested in the bright minds that had the wisdom to find
work outside Microsoft. Nothing against MS, but if half of your peers are
going to the same blackhole, and you choose not to follow suit, you're either
a smart fella with better options, or you're not good enough.

Assuming a 50-50 distribution; I am interested in that 25% that's both good
enough, and chose to break rank. Because I have a good intuition that
consensus always breeds mediocrity, never something exceptional.

~~~
cageface
I have been surprised at how little of the genuinely innovative things people
are doing in Microsoft Research seem to make it into their products, but there
are a lot of very interesting projects going on in their research groups
nonetheless.

I can also understand the appeal of MS research. Academic CS presents a lot of
distractions - the constant scrabble for funding, teaching responsibilities,
campus politics etc. There are plenty of high-caliber brains in MS research. I
don't think Simon Peyton-Jones, for instance, would have any trouble finding a
post in any CS department.

~~~
mahmud
SPJ is at Microsoft, and so are Jim Larus and Leslie Lamport. But you know
what? For a behemoth that allegedly swallowed half of the computing minds in
Europe, and god knows how many in the U.S., it's very sad that I can name only
three top researchers, and I have absolutely no idea what they're working on.

I see more development coming out of the Factor camp, and Factor is pretty
much a 25 year old guy in a basement.

Lest you think I am picking on Microsoft, I haven't been too happy with the
Google language R&D labs as well. They took out billions in cash and
replicated Bell Labs, circa 1986.

~~~
mahmud
By the way, just think of the few recent pieces of software that made the most
impact on industry; Clojure, Redis, Nginx, Memcached, jQuery,etc. All the
works of random sole hackers, the last two pretty much standard resume pieces
for any web developer. None of these guys existed on the map until they
changed the industry with a Changelog. And because of that, I have every
reason to believe that the next great engineer-aesthete is faceless today, and
bumming around on friends' couches and handouts; not someone being cultivated
with corporate endowments and backing.

~~~
cageface
I hope you're right honestly. The vision of the heroic hacker is much more
appealing to me than that of big, bureaucratic, corporate research
departments. Certainly the things small independent teams have accomplished
lately is impressive.

I wonder though if there are some projects that just require more elaborate
support structures. It's difficult for me to imagine that ghc or the scala
compiler or postgresql could have been hacked together on the clojure model.

------
francoisdevlin
The industrial response to Lisp can be found here, and it's thriving:

clojure.org

~~~
mahmud
So the industrial response to Lisp is a Lisp? You'll need a bit more care when
recurring over circular lists ;-)

~~~
francoisdevlin
No, that's a feature :-p

------
sofuture
The biggest problem with C# is the .Net ecosystem. Without (much) an open
source community, it is and remains a tiny pond, full of crap, including a
million shitty web applications and all the .Net baggage (Visual Basic
anyone?)

Which is a damned shame.

It is a beautiful and fun language.

~~~
daeken
There's a ton of open source code out there, from Mono, Gnome, a lot of
projects on Codeplex, and a bunch of other sources. I don't know where the
myth that there's a lack of open source .NET code came from; it's simply not
true.

------
jcromartie
The problem is that the people who appreciate the functional features of C#
are the same ones that are already exploring other languages and paradigms
outside of Java-flavored OOP.

The flip side of this is that there are a lot of code monkeys in cubicles
working on C# codebases who have no interest or ability to learn the exciting
features. That leaves the people who are excited about these features in the
tough position of either writing the best code they can and alienating their
coworkers, or finding another job.

------
michaelcampbell
I speak only for myself here of course, but what I find so "icky" about C# is
not the language, but the development environment. I haven't used the latest
VS so it might be better, but even 2007 still felt years behind the popular
java IDE's, and there didn't seem to be any real competition to it either.
(Someone please correct my missteps here; I'd love to know more about it than
I obviously do now.)

~~~
j_baker
My experience has been the exact opposite: Java IDEs are bulky and hard to
navigate while VS is at least bulky and easy to navigate. :-)

~~~
bokchoi
I haven't tried VS 2010, but in previous releases there was no "Go to
class..." type functionality! How is that easy to navigate? Thank god for
JetBrains ReSharper plugin.

All the major Java IDEs have had "Go to class..." for a long time.

~~~
Qz
2008 and 2010 both have it, as well as a lot of other easy ways to navigate,

~~~
bokchoi
I searched for a very long time when I last used 2008. How do you do it?

~~~
Qz
I might have been wrong about 2008, don't have it installed anymore.

------
Silhouette
My main concern about C# is that with each release, it becomes bigger and
seems to be more of a kitchen sink language. This phenomenon has been the
downfall of other popular industrial languages, notably C++.

As the language grows, so does the number of interactions between features.
All the little corner cases start to get in the way of writing clean, useful
code.

As the language grows, it also becomes harder for new programmers to learn it
effectively, by which I mean not just knowing the syntax, but also
understanding the idioms and being familiar with the libraries to make good
use of the language in practice. For real world projects that make use of the
advanced features, it therefore becomes harder to find staff who are
sufficiently clued up in the areas that are in common use on any given
project.

The more programming I've learned, the more I am convinced that effective
programming languages are simple. This doesn't mean they can't also be
powerful, but the programming model is clear and the interaction between
different features is either systematic or non-existent. Nearly every widely
successful industrial language achieved its success initially when it was a
simple language. Many industrial failures -- in the sense that they continue
to be used more because of various kinds of momentum than because of their
technical merit as programming tools -- became so when they stopped being
simple.

~~~
kenjackson
What kitchen sink was thrown in C++? The STL? That's the main reason I first
fell in love with C++. Templates? Exceptions? RTTI?

IMO the problem with C++ is its C legacy (things like macros). These things
make it harder to read code and make it harder to write great tools for it
(ever seen really good code completion or static analysis for C++ code?).

~~~
Silhouette
> What kitchen sink was thrown in C++?

What _wasn't_?

\- Procedural programming

\- Structures and enumerations

\- Overloading of functions, including operators

\- Classes, object-oriented programming and run-time polymorphism

\- Generic programming, templates, compile-time polymorphism and
metaprogramming

\- Text-based macros

\- Hacks and, from C++0x, built-in language support for in-line functions

\- Exceptions

\- Low-level memory access

By my count, every one of those things interacts with almost every other one
in some way. Often, there are deep connections, such as the RAII idiom, that
are fundamental to using C++ effectively but not obvious to someone with a
good general programming background but no expertise in C++ specifically.

The real problem, though, is that C++ isn't really very good at any of those
things in isolation. There are much better approaches to all of them, and
there are tools available that take those approaches. They just don't fit
together to form a coherent whole, where features are either orthogonal or
blended together cleanly. It used to be the case that C++ offered a more
powerful overall tool than most other languages because of the diversity of
its features, but today's languages have had the benefit of decades more
experience and hindsight to draw on. The very diversity that used to be a
compelling reason to use C++ has now become the most compelling reason not to,
IMHO.

~~~
kenjackson
Lets be clear... half of your list is from C:

-Procedural programming -Structures and enumerations -Text based macros -Low-level memory access

And for the items they actually added to C to make C++, none of them are all
that unusual, save templates (not sure if there is any other language that
does it compile time).

IMO, Scala has more parts of the sink in it than C++. The problem with C++
isn't the kitchen sink. It's that its built on a language that isn't meant to
hold the things that C++ would like to add to it.

Maybe I'm being pedantic, but when I see "kitchen sink" I have a vision of a
lot of features. But frankly C++ isn't all that feature rich. But its the
interaction complexity that makes it problematic. This is not a problem of
throwing the kitchen sink at it, but rather a design problem.

~~~
hga
Let's put it this way: do you know of any successful C++ project of serious
size that doesn't specify and stick to a subset of the language?

~~~
kenjackson
Several that I've worked on. There were aspects of the language that we
avoided, like export, because they weren't implemented. But in general, we
didn't have ground rules about features to use or not use. At least not in the
past 15 years. Back in '93ish we would be more careful, because the features
were still evolving, but by 2002-2003 I don't think we had a lot of issue
using the language.

------
ihodes
I think Clojure is the _right_ response to Lisp: embrace it, and make it
practical and quick.

~~~
hga
Although there are those who say " _Clojure is a terrifying meld of a beloved
character and an unreasoning alien onslaught._ " based on: <http://vintage-
digital.com/hefner/misc/lisp-programmers.jpg>

Me, I'll probably need to use Clojure on top of the JVM someday but I'd like
to get a "Turtle Clojure" developed after Clojure-in-Conjure gets somewhere
("it's turtles all the way down"). But that's because I'm not too concerned
with doing anything particularly or at least immediately practical right now.

------
grandalf
Does anyone know if there is a way that Arrays can be passed by ref in c#?

