I could maybe see it, if all you know otherwise is C++, and your experience with other languages is trying to make python / go / node / whatever work well on a Windows machine without well-working tooling, and then you finally try C# and it's like oh shit, it's not filling up my mouth with feces every time I want to iterate over a dictionary or need memory management, this is a big improvement, I like it
But, VSCode has good support for those other languages now anyway
And, the bigger question, who the fuck are all these people upvoting this
Like what do you guys do all day? Or is this some subtle super sophisticated joke I am not understanding, or do you just like the man's chin? Or do you just not program and you upvote programming things out of general excitement about the idea of doing programming?
Who in the fuck is this excited about C# of all the things in the world to get excited about?
Despite .NET being relatively friendly with Open Source, Java will probably remain the first choice for FOSS devs for a while, if only due to history and traction. You could write a C# Lemmy alternative, but it wouldn't necessarily be faster or simpler or better in any particular way than a Java version. I'd certainly rather contribute in Java than start from scratch in C#.
Microsoft tried to lock a development feature behind a paywall by introducing an artificial dependency on Visual Studio.
This also happened to occur right around the time there were also licensing and hosting issues around open source libraries. The manipulation of the .NET foundation was the really concerning part. Made it clear that MS still doesn't give a damn about the wider community using their language.
Compiler output only marginally better than working with c++
No one claims it's faster at runtime than good C++, it's just a lot easier to write decent code
I think they're referring to warning and error content. Compared to things like rust, deciphering error notifications from the c# compiler can sometimes feel like trying to figure out what a child with limited vocabulary is trying to tell you.
Even with decades of personal experience with it, they can be confusing and non-informative sometimes for me.
Nullable reference types are (a completely mandatory) bandaid fix in my opinion as a .net dev. You will encounter lots of edge cases where the compiler is unable to determine the nullability of an object, e.g. when using dependency injection to populate a field, or when using other unusual control flows like MediatR. You can suppress the warnings manually at the slight risk of lying to the analyzer. Objects supplied by external library code may or may not be annotated, and they may or may not be annotated correctly. The lack of compile-time null checking is occasionally an issue. But that said, NRT makes nullability a significantly smaller issue in C# than it used to be
I have such a love hate relationship with Gradle... I forget exactly what but there was something Maven couldn't do that made me first try Gradle locally. I didn't use it professionally for so long.
Now that I am using it professionally, I'm not sure it's better. Maybe it's just a case of "grass is always greener on the other side" sort of thing.
Some of my gripes,
The documentation is almost really useful, but as soon as you have to look at Gradle's Javadoc it's a mess.
I like the kotlin stuff better than groovy but a lot of old guides still use groovy and sometimes it is very confusing trying to translate.
Why the hell does IntelliJ Idea Professional version still not give me code hints for Groovy Gradle files???
I love that everything is customizable, but I think slightly more concrete conventions would be useful a lot of times. Or at least documenting the conventions somewhere.
Why is it so hard to get the Maven BOM experience? There's always fucking edge cases. Plus, why can't I do it with plugins too?
def fetch_html(self, url):
domain = urllib.parse.urlparse(url).netloc
if domain not in self.robot_parsers:
rp = urllib.robotparser.RobotFileParser()
rp.set_url(f'https://{domain}/robots.txt')
rp.read()
self.robot_parsers[domain] = rp
rp = self.robot_parsers[domain]
if not rp.can_fetch(self.user_agent, url):
print(f"Fetching not allowed by robots.txt: {url}")
return None
if self.last_fetch_time:
time_since_last_fetch = time.time() - self.last_fetch_time
if time_since_last_fetch < self.delay:
time.sleep(self.delay - time_since_last_fetch)
headers = {'User-Agent': self.user_agent}
response = requests.get(url, headers=headers)
self.last_fetch_time = time.time()
if response.status_code == 200:
return response.text
else:
print(f"Failed to fetch {url}: {response.status_code}")
return None
Randomly selected something from a project I'm working on that's simple and just works. Show me less than 300 lines of .NET to do the same, and I would be somewhat surprised.
It can be even simpler than that. With the so-called “Minimal API” framework lets you define an entire web app with simple functions. This article shows some samples of what it looks like to create a web app in this style.
It's attitudes like this that made me choose C# as the language I wanted to use professionally after graduation.
Having grown up in the Slashdot era where people would be childish, post about Micro$oft, and parrot EEE, all while the .NET Foundation consistently put out great tooling with a mature community that actively wanted to help you learn the language/framework, the choice was simple.
I don't think this line of reasoning is strictly speaking correct, but assuming it was, then I think it would follow that Kotlin exists and as such C# does not need to be kept around.
Compiled Java is still cross-platform. It’s been a few years for me, but when I last worked in C# it was a giant PITA to work on it in Linux or MacOS. I hope it’s gotten better.
.NET (not .NET Framework) is cross platform and can be compiled into native binaries on a variety of platforms. There is however the wrinkle of not all the libraries within .NET being supported on all platforms. Most notably, everything involving a graphical UI is Windows only.
The most well known cross platform .NET project you probably have heard about is Jellyfin.
It's a lot better with some notable exceptions. First,
.NET Core is multiplatform by design, so it is by default quite portable. The .NET Core CLI is extremely powerful and means a CLI workflow is totally feasible (and also simplifies CI pipelines). The new "multiplatform" application framework, MAUI, runs on Windows, Mac, iOS, and Android, but not Linux/GTK/QT etc. You can maybe attribute this to the design philosophy of abstracting native controls, of which "Linux" itself has none, but either way it's useless on Linux. Third party frameworks like Avalonia do work very well on Linux.
Do you know why sharp is added to the end of programming languages? Like c sharp and f sharp?
There was (and still is) a language called C. Then C++ was invented. And then C#, maybe because # looks kinda like 4 pluses.
There is also another programming paradigm, called functional programming. F# is a functional programming language and runs on the same platform as C# (that platform is called .NET). That's why they named it F#.
Actually, I don't even know if it is pronounced c sharp or f sharp. I just assumed it was the same as music.
i tried using c# for lower-level-ish tasks and it was even more painful than js (emulation development, specifically). who the fuck decided that all math operations should cast to int????
I program professionally in C# and I gotta say, it really isn't for that. You can do services in it, but that's as low level as I'd suggest. It's definitely a high level language for rapid dev of web and desktop stuff.