|
Hey everyone,
I've been diving into C# .NET recently and I couldn't help but notice some similarities with C programming. I'm curious about how much C programming principles influence C# .NET and how understanding C might help in mastering C#.
Key Points of Discussion:
Syntax and Basic Constructs:
C# shares many basic syntax elements with C, such as data types (int, char, float), control structures (if, for, while), and operators (+, -, *, /). How much does familiarity with these elements in C help when learning C#?
Memory Management:
C provides manual memory management using malloc and free, whereas C# handles memory through garbage collection. How does this difference impact the way we write and optimize code in C# compared to C?
Pointers and References:
While C heavily relies on pointers, C# abstracts memory management but still allows the use of pointers in an unsafe context. How relevant are C pointers when dealing with C# programming, especially in performance-critical applications?
Object-Oriented Programming:
C# is inherently object-oriented, unlike C. For those coming from a C background, how challenging is it to grasp the object-oriented concepts in C#? How can C principles aid in understanding these concepts?
Platform Independence:
C# through .NET Core aims to be platform-independent, much like C programs can be compiled on various platforms. What are the key differences in achieving platform independence between the two languages?
Use Cases and Applications:
C is often used for system-level programming and embedded systems, while C# is popular for web applications, desktop applications, and game development using Unity. How do these different use cases affect the choice of language and the transition from C to C#?
Your Experiences and Insights:
Iβd love to hear from those of you who have experience in both C and C#. How did your knowledge of C help (or not help) you when learning C#? Are there specific areas where you felt a strong correlation or significant differences? Any tips for someone coming from a C background and looking to excel in C# .NET?
Looking forward to an engaging discussion!
Cheers,
Tejaswini
|
|
|
|
|
Has anyone noticed that when you get a vscode update, the release notes never call out the bugs that were fixed.
<snark>I bet it's because the list is so large that it would cause the release notes file to be larger than the max possible size...</snark>
<moresnark>How do they exppect us to be able to reliably develop our own buggy code if the tools they provide us are so buggy?</moresnark>
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
They expect us to be dazzled by the list of wonderful enhancements.
|
|
|
|
|
The latest whiz-bang is "text to speech".
Speak this MS - "I don't give a f*ck about text to speech.".
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
Still better than the vast majority of "app store"-type release notes, which are invariably some variation of:
Release Notes: Bug fixes and performance improvements.
Sometimes with slightly more embellishment, but it usually translates to the same meaningless BS.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Or so short, because they didn't fix a damn thing.
If you can't find time to do it right the first time, how are you going to find time to do it again?
PartsBin an Electronics Part Organizer - Release Version 1.4.0 (Many new features) JaxCoder.com
Latest Article: EventAggregator
|
|
|
|
|
Microsoft fix bugs?
When did they start doing that?
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
OriginalGriff wrote: Microsoft fix bugs?
No need when you can just enhance over them.
User: "Microsoft, have you fixed the xyz bug?"
MS: "Did you see the list of 300 enhancements including new fonts and icons?"
User: "Oh, look at all the shiny."
|
|
|
|
|
Misc bugfixes...
You can always check the list of issues closed for that release on GitHub
|
|
|
|
|
I tried VSCode and never found it a good solution for my needs. As a pure editor it's worse than VisualStudio + VisualAssistX, for C# or Windows C/C++ code it's worse...
I found it acceptable for Python but I wrote 100 lines of Python in my whole life so take it with a deposit of salt.
GCS/GE d--(d) s-/+ a C+++ U+++ P-- L+@ E-- W+++ N+ o+ K- w+++ O? M-- V? PS+ PE Y+ PGP t+ 5? X R+++ tv-- b+(+++) DI+++ D++ G e++ h--- r+++ y+++* Weapons extension: ma- k++ F+2 X
The shortest horror story: On Error Resume Next
|
|
|
|
|
π all
Do you find yourself in a PR battle where you discuss if you should use const or const ref, or otherwise discuss why you use using to reduce the name of certain types, I can get so frustrated sometimes when I develop a feature or new code, I have it tested and all work and then you have this colleague who wants everything to be how he or she is seeing it and in the end it doesnβt matter as you spent more time discussing or changing it for their joy, code wise it would end up as the same code for the compiler.
|
|
|
|
|
dbstudio wrote: the same code for the compiler
The best possible code review result. No reason to worry.
|
|
|
|
|
That's one of the reasons I don't miss working on dev teams.
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
dbstudio wrote: or otherwise discuss why you use using to reduce the name of certain types
What I can say for sure is a concise code is much more readable and that's why if there are several references made to get to a certain type then it's good to use usings.
If I had a dev who wasn't convinced with this reason alone, I'd do it myself.
|
|
|
|
|
GKP1992 wrote: concise code is much more readable
My code may not be concise in the same way yours is.
|
|
|
|
|
It's not about what it looks like to the compiler - it's about what it looks like to the *team*.
The cure is to establish reasonably rigid coding standards, and make sure everyone adheres to them.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
I strongly believe that it should be less rigid and more flexible and who donβt want to have a const signature if you are not changing the value, I feel the itβs more due to the fact of junior developers fresh out of school believing we are building a kernel or cathedral if you wish.
|
|
|
|
|
Either you have coding guidelines or you do not.
We have guidelines, they dates from the 80s and 90s (seriously).
The mantra has been don't change anything. (even crazy bad tab/spaces everywhere)
But...
When I go in a file to do work in it, I clean it up and bring it to more modern best practices as much as the underlying code allows me to do.
I wish I could go deeper, but time and money are not infinite.
CI/CD = Continuous Impediment/Continuous Despair
|
|
|
|
|
Wordle 1,083 3/6*
β¬🟩β¬β¬🟨
β¬🟩🟨🟩🟩
🟩🟩🟩🟩🟩
|
|
|
|
|
Wordle 1,083 3/6
β¬π©β¬β¬π¨
β¬π©β¬π©π©
π©π©π©π©π©
|
|
|
|
|
Wordle 1,083 4/6*
β¬π¨β¬β¬π¨
π¨β¬β¬π©π©
β¬β¬π¨π©π©
π©π©π©π©π©
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Wordle 1,083 3/6
β¬β¬β¬π¨π¨
π¨β¬β¬π©π©
π©π©π©π©π©
|
|
|
|
|
β¬π¨β¬β¬π¨
β¬β¬β¬β¬β¬
β¬π¨π¨β¬β¬
π©β¬β¬π©π©
π©π©π©π©π©
In a closed society where everybody's guilty, the only crime is getting caught. In a world of thieves, the only final sin is stupidity. - Hunter S Thompson - RIP
|
|
|
|
|
Wordle 1,083 4/6*
β¬β¬β¬π¨π¨
π©β¬π¨π¨β¬
π©β¬π¨π©π¨
π©π©π©π©π©
Happiness will never come to those who fail to appreciate what they already have. -Anon
And those who were seen dancing were thought to be insane by those who could not hear the music. -Frederick Nietzsche
|
|
|
|
|
Wordle 1,083 4/6
β¬β¬β¬π©β¬
β¬β¬β¬π©π©
β¬π©π¨π©π©
π©π©π©π©π©
|
|
|
|