Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
C# Application Markup Language (Csaml): A Preview (2006) (charlespetzold.com)
47 points by mpweiher on Aug 19, 2023 | hide | past | favorite | 30 comments


April Fools joke that may be, but that looks more or less like a XML-serialized CodeDOM - https://learn.microsoft.com/en-us/dotnet/framework/reflectio...


Problem is some CS grad comes along, sees this and thinks "What if that were HTML?" and now we have the current state of front-end development. Sad. All we really want is a const o = new Div("#my-thing"). I remember doing XAML development back in the WPF hay day. 2009-ish. Csaml and Xaml are pretty close. I hated Xaml a lot. So much so that all the views and components I wrote at the company I worked for were done using Canvas + DrawVisuals as to avoid Xaml all together. Funny, sad, ironic, and nostalgic all at the same time.


Yup. SwiftUI does it right. One language for your whole app.


A mistake I've made a few times is thinking let's separate code and data, that sounds great. But then I realize I need to do some pretty complex stuff in the data, and I'm faced with the choice of building some hacky monstrosity, or a DSL, or just going back to the main code.

The basic tutorial examples of SwiftUI look like something you could easily do in XML, but doing it in real code makes it so much more powerful, and ultimately simpler for everyone.


I find Flutter's nested hell quite unpleasant to read or write. For declarative UI, XAML seems like a better approach.


Just break the tree into smaller semantic components. I, on the other hand, find XAML much more unpleasant to read or write than Flutter.


This looks like a C# AST written in XML, am I wrong?


You are right, and

> April 1, 2006

Back when jokes like that were cool.


You know, I suspect most people reading this weren't around for the "XML everything!" era and don't get the joke. They legitimately think it's a post about an experimental markup language.


Exactly, I was 9 years old when the OP was published, so I couldn't tell if it was a joke or not, to be honest. Thanks to y'all for explaining


Not just XML, but I see this article as a direct jab at XAML specifically.

XAML, the famously verbose dialect of XML tied to .NET, which hasn't seen any changes made to the core language design despite its numerous ergonomic failures (e.g. the xmlns mess). I can't explain why no attempt has been made to make it more usable.


It's almost too good of a prediction since XAML is from 2008 and this article is from 2006 :)

(To be clear it means the article is likely _not_ from 2006 but from later like 2008-2010 since it mentions XAML)


Xaml was around before that. Google "XAML Longhorn"


> Basically, CSAML is an alternative syntax for C# based on XML and, more specifically, on XAML, the Extensible Application Markup Language that plays such an important role in the forthcoming WinFX and the Windows Presentation Foundation.

Almost as if someone on the inside at MS would have knowledge of what was in development and decided to poke fun at it. 2008 was when it was released, it was in development prior to that.


It almost certainly was. He mentions XAML near the top.


You are not. Note the publishing date.


I don't get it, this is just WPF


It's an April Fools article.


Guess I should have added a /s to that comment


This predates WPF. I believe Xaml 1.0 came from this iteration but I don't work for Microsoft so I can't say. It looks awfully similar though does it?


I don't get all the hate for xaml. Its ergonomics are poor, sure, but are they that worse than HTML, of which it was based?

It was a huge improvement over forms and mvvm was revolutionary at the time.


Seems like Petzold gave up on following Microsoft's indecisiveness regarding what should be the official GUI framework for Windows. No WinUI 3 book is planned.


I think it's more that he got married and is now 70 and wanted to retire and wanted to do other things after 30 years of writing books about application APIs.

Charles more or less states as much on his website.


I see. Although, there are no other Microsoft endorsed WinUI 3 books either.


That looks like a great teaching tool


This may look like April Fools joke, but later that year Microsoft released XAML.


A moment of rage followed by laughter. Well done.


Jokes aside, this is what C# or Typescript feels like after working in F# or Clojure. Just so much syntax noise it's hard to see the important parts.


I'm surprised to see you downvoted because I absolutely agree. It seems like a common-sense opinion that C# and Typescript are unnecessarily verbose in comparison to F#. (I don't know Clojure so can't compare.)


No one wants to hear their favorite language compared to XML noise I guess. Not trying to offend, just pointing out that it's legitimately how it feels. If you love C# this shouldn't offend you. I'd be curious to hear if someone said the same thing about F#, I'd want to know what they were comparing it to, maybe the new thing will be a new favorite of mine.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: