Hacker News new | ask | show | jobs
by com2kid 2464 days ago
C# has very minimal boilerplate for a lot of uses. I can throw together a simple CRUD UI app in WinForms in well under a day. Visual Studio handles writing all the data binding code for me, code that I'd have to write myself in any other language.

Using one of the enterprise frameworks, sure, those all have boilerplate, in any language, especially the older frameworks.

And for some tasks, the amount of boilerplate is tiny. I can write out a struct/class with property names matching my JSON, and watch as C# automatically data binds the JSON to a UI. The amount of boilerplate I need to do that in the browser is pretty much identical, or I can learn / figure out some fancy auto-binding toolkit that has its own boiler plate and learning curve.

You can be seriously functional in C#. Passing around lambdas and using functional techniques to manipulate data has been idiomatic C# for over a decade.

> I've also noticed that most C# programmers don't usually know another language

Stereotyping is not good. I <3 C#, but I've written embedded C, C++, JavaScript, Typescript, and Python.

If you go to most corporate dev places, you will find a significant population of single language devs. Same things happen with any popular corporate language. While I agree that learning multiple programming languages makes for better developers, blaming a language for being popular is hardly fair.

Heck the number of developers who have historically only worked in C/C++ was really high for multiple decades.

1 comments

Under a day ?? Make an app with pyqt5 or kivy and it's under an hour...
> Under a day ?? Make an app with pyqt5 or kivy and it's under an hour...

Last CRUD app I did in WinForms:

1. Auth

2. Real time push updates from my database

3. Platform native looking UI

4. Automatic 2 way data binding between my backing JSON and my UI controls.

I hadn't used C# for ~2 years, I had never used that particular DB library or done any work with JSON in C#.

I got it done in under 4 hours.

If I did it now, yeah, even faster.

The amount of code I wrote is insanely tiny. I wanted some custom date/time formatting stuff so I had to implement that myself.

I just checked the source out, I wrote under 120 LOC total, and that is including the repetitive ~70 LOC I did for handling days of the week and auto-formatting user entered times. (Time sucks, working with time sucks.)

Without that my code would've been limited to:

1. Wiring login button up to sending username/password to the DB 2. Attaching a listener to the DB (C# has had native event handling as a primitive type since forever!) 3. The save button to push stuff to the DB.

Did I have to drag and drop some UI elements onto a page? I sure did. It was rather nice.

WinForms was the go to solution for CRUD apps for a reason. Sure VB6 was probably better at popping CRUD apps out in no time, but after that died out, WinForms was a really good replacement.

It would be cool if you had a demo to show this off. That way you can add a lot more heft to all of your arguments about this subjects, and we can all learn something from it.
Kivy is a broken pile of patches. You must be trolling.