Desmond File

Blog archive

C# and Darwinian Theory

When Charles Darwin published "On the Origin of Species" in 1859, it turned the scientific community on its ear. His theory of natural selection fundamentally changed our understanding of the development of living organisms.

Darwin's theory can apply just as well to the world of programming language development. Over the decades we've seen languages evolve from elemental machine code and assembler constructs, to higher-order 3GL and 4GL languages that let developers economically perform increasingly complex tasks. Just as a single-cell bacteria ultimately gave rise to sea- and later land-borne vertebrates, so has the early work on machine code given rise to Java, C#, Ruby and Python.

But evolution is a tricky thing. Acquire the wrong adaptation, and your branch could be headed for the dustbin of history. That's the concern that keeps Anders Hejlsberg up nights. As the Microsoft technical fellow responsible for creating the managed C# programming language and many of the underpinnings of .NET, Hejlsberg is always on the prowl for ways to keep C# relevant.

That includes ushering dynamic typing and functional programming concepts into the statically typed, imperative C# language.

"The thing about languages, and this is generally true for all languages, is that there is a certain lifecycle to them," Hejlsberg explained to me. "Languages age. Every time you add a new feature to a language, you age it, because it sort of accrues conceptual weight, if you will. And eventually it will cave in under its own weight, because there are just too many features that have too many subtle interactions and whatever. This is the inevitable lifecycle of pretty much any language."

Hejlsberg credits the enduring success of C# -- which began development in December 1998 -- with the active, consistent and thoughtful engagement of the C# language group at Microsoft. He said the same team of people have been meeting to discuss the direction of C# ever since.

"Within six months we fell into a rhythm of having three weekly design meetings, starting at 1 o'clock and lasting at least two hours. And you know, that series of meetings is still ongoing. In fact, until recently it was still in the same room," Hejlsberg said.

That consistency has allowed C# to retain its fundamental character, Hejslberg said. He noted that despite its functional talents, C# will never replace F# for true, declarative programming tasks. Nor will C# ever replace Ruby for a fully dynamically typed environment.

"You can't fundamentally change the nature of the beast. C#, its core design center was to be an imperative, object-oriented programming language. Now you can add features that you borrow from functional and dynamic, but it still has that core center of gravity, and you can't really change that. Because now you end up with sort of schizophrenic language."

What are your thoughts on C# development? Is the language heading the right way, or would you prefer to see more profound changes? E-mail me at mdesmond@reddevnews.com.

Posted by Michael Desmond on 01/20/2009


comments powered by Disqus

Featured

  • Compare New GitHub Copilot Free Plan for Visual Studio/VS Code to Paid Plans

    The free plan restricts the number of completions, chat requests and access to AI models, being suitable for occasional users and small projects.

  • Diving Deep into .NET MAUI

    Ever since someone figured out that fiddling bits results in source code, developers have sought one codebase for all types of apps on all platforms, with Microsoft's latest attempt to further that effort being .NET MAUI.

  • Copilot AI Boosts Abound in New VS Code v1.96

    Microsoft improved on its new "Copilot Edit" functionality in the latest release of Visual Studio Code, v1.96, its open-source based code editor that has become the most popular in the world according to many surveys.

  • AdaBoost Regression Using C#

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of the AdaBoost.R2 algorithm for regression problems (where the goal is to predict a single numeric value). The implementation follows the original source research paper closely, so you can use it as a guide for customization for specific scenarios.

  • Versioning and Documenting ASP.NET Core Services

    Building an API with ASP.NET Core is only half the job. If your API is going to live more than one release cycle, you're going to need to version it. If you have other people building clients for it, you're going to need to document it.

Subscribe on YouTube