The title itself is a recipe for disaster. Also this is a semi rant.
Yesterday I was informed that I will have the honour to implement the core functionality - which is an interface layer to use the driver of a very expensive hardware shit - of the software I’ve been working on as a frontend dev.
There are two possibilities for the language: C++ or C#. The one that was proposed/imposed is C#, which I know nothing of, while at least I have some hobbyist experience with C++; when asked if I could take some time to familiarise myself with C# I was basically laughed in the face, saying I will learn on the field and at least some of them have some experience with it.
Should I insist to go with C++, or is that an even worse idea in an already fucked up situation?
Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!
Cross posting is strongly encouraged in the instance. If you feel your post or another person’s post makes sense in another community cross post into it.
Hope you enjoy the instance!
Follow the wormhole through a path of communities !webdev@programming.dev
A good developer doesn’t need to worry themselves over the language used. For the most part programming principles are universal, besides Object Oriented vs Functional programming languages. Since you’re not moving from, say, Java to Elixir, you should be fine.
C++ is a worse idea, it is not a good web backend language.
C# is pretty easy. As long as your boss doesn’t expect you to magically already be good at the thing they refused to allocate time for you to train in, you probably can just start trying to glue bits of C# web API examples together as your first project.
It’s not web backend
Oh sorry, I saw “frontend dev” and assumed that meant web and not like local application.
If you are doing something less popular involving non-web messaging between processes that might be harder to break into.
If I would complain about any new language or environment I’d be dropped in, I’d probably in the loony bin by now.
Tell the team leader that you don’t know the language but are willing to learn, read the existing code which will give you a feel for the language, the project, and the local programming style, all in one go, and you should be fine. Imagine the backend was written in PL/I, Prolog, or LISP instead of just another ALGOL dialect ;-)
What existing code? I have to write the whole thing from scratch
If you are starting from scratch, why do they limit the language selection?
I guess so that if I leave, they won’t be fucked
If you’ve firmly but politely articulated what your skill set is, and they’ve told you it’s fine, you’re literally being paid to skill up. I don’t see the problem. You haven’t lied about your qualifications, instead you’ve been told they want you on the project, even though you don’t know the language yet. This is a good thing.
I love getting paid to learn new stuff. Favorite part about my job
And the best part: you have a pretty good excuse if you do happen to fuck up
What language are you familiar with? Switching between the C-style OOP languages is honestly pretty straightforward.
JS/TS, Rust-ish, and CPP
Yeah, I’d say your road to C# should pretty much be syntax then. Check out a course on exercism and read a bit about common idioms in C#.
If you have “some hobbyist experience” with C++, then you should definitively avoid it and go with C#.
You should be at least “C++ is a landmine, be careful there” tall before allowed to play with it alone.
In school, we used to say that C/C++ gives you enough rope to hang yourself with.
There’s so much hidden rope in it, that will catch you if you happen to pass through. It doesn’t only give you some to misuse.
Yeah, probably. In the end maybe I will end up using c++ cause a coworker is pushing for it (although he knows nothing of the language). Ironically, I’m the one advising not to cause I know I don’t know lol
I’ve had a few years experience in both C++ and C#. The learning curve is a lot steeper for C++ with many more opportunities to shoot yourself in the foot or create horrible hidden memory leaks. It sounds like the person making the recommendation is talking out of their arse.
If you have any experience in Java or any OO language, then the transition to C# is not so large. The language itself is not difficult - it will probably a couple of weeks to be comfortable. Its the frameworks and libraries that takes time, and there are a lot.
Here’s my view… it takes 10 or more years (IMHO) for a sharp person to become a senior developer. It takes a few weeks to learn a language. If I have to choose for a big project, I prefer to focus on choosing the right person, rather than just focusing on the language, because a good senior will just learn whatever they need at the start. They will also bring their years of experience in good design, methodologies, communication, mentoring, testing etc to the party.
Depending on the (API) complexity and speed requirements it might be useful to start by implementing in plain old C. Easy enough to add on class structures later (i.e. transcode to either of those options) if needed. Also consider Rust, as long as you’re going to learn something, it’d be nice if it was current and forward facing.
If you can code in C++ you should be able to muddle through in C# no problem. The runtime will help prevent the worst SNAFUs; y’know, pointer errors (there are none, unless you use the unsafe block or p/invoke), memory leaks etc. Just look at the existing code and cargo-cult it til you make it. You got this. :)
The project is brand new (as in, the integration backend doesn’t exist), I have to code and architecture it
Okay that is a bit rougher. Best of luck I suppose. Hopefully you can lean on your colleagues somewhat. If I had one piece of advice, look up the using block, it basically ensures an object gets disposed immediately when it goes out of scope, which is the closest C# lets you get to deallocating memory. The object needs to implement IDisposable tho.
You only need to use IDisposable for disposing unmanaged resources (file io etc). In modern .NET there are actually ways to perform manual memory management using malloc and delete etc, but it’s unlikely you’d ever need it.
To clarify for OP, the only time you need this at all is when the object has a reference to something that the garbage collector won’t dispose of naturally. Things like an open file stream, db connection, etc.
You won’t need to dispose of an object you created if it just has properties and methods
Circular references can also impede garbage collection, don’t forget.
And to further clarify, a proper object wrapping a resource like the ones you listed will release them when it is eventually collected, in the finalizer/destructor. However, you can’t know when that will happen, so we have IDisposable.Dispose() which can be used to release whatever critical resources the object is holding right away. :)
This is very wrong. Circular references are no problem for the garbage collector at all (https://stackoverflow.com/questions/8840567/garbage-collector-and-circular-reference). You basically don’t need to worry about manual memory management at all, if you’re only dealing with managed code.
I was specifically thinking of circular event handler references, which I know was a thing at some point in the past. If .Net has improved since then, great.
I recommend looking at a Shawn Wildermuth course that seems related to the type of project you will be creating. He has a bunch on pluralsight and his website. He was instrumental for me in my early days of learning .net and architecture.
What do you mean? Your team says they’re going to help you learn as you go. I think you’ll be fine. Be proactive when asking questions, you’ll be fine! Just set expectations. Make sure your manager knows you don’t know this language and tell them you can learn as you go with assistance but you’ll need some time before you’re very productive.
You have copilot? You’ll be fine if so, just throw down comments for what you want it to do and tweak it when it doesn’t compile.
Please do not follow this advice. For one, copilot is terrible in general. For two, using it without being able to vet the codes correctness is a recipe for disaster.
I concur. I took the free trial and was not impressed - most of the time the suggestions aren’t any better than LSP autocomplete.
And if I asked it to implement something or let it autocomplete part of (say) an expression, it tends to go tits-up completely. (Which is especially odd considering I use languages with abundant static context - It’s not like JS where the type of a function parameter is “who the fuck knows until runtime.”)
Spend your $10 a month on supporting OSS devs/projects.
I think that was the joke?
We hope
This doesn’t feel like a disaster to me at all. This is an opportunity to grow and learn new things and new ways of doing things. It looks like your environment is very supportive and understanding that it will take some time and effort to get up to speed and are offering mentoring. And businesses often have valid technical or non-technical reasons for using a particular software stack - for example C# developers are likely easier to find than C++ developers which makes hiring easier in the future.
My suggestion is to take some deep breaths reset your perspective. Yes, sometimes it’s not fun to push outside of your comfort zone, and it sounds like that is creating a lot of anxiety for you, but you’ll do fine. This is very similar to how I got started professionally programming 25 years ago.
system.out.you.are.fucked()
Console.WriteLine("not really");
Bold of you to assume system.out.you.are.fucked() returns a string. It works with a proprietary i2c spinoff that tried to implement asynchronous.
C# isn’t that difficult to learn. Don’t be overwhelmed by languages or frameworks, they aren’t so different from each other.
C# isn’t too complicated tbh. A lot of things are done for you i.e. memory management.
Honestly if you’re not a cpp pro that seems like it would go worse as there are so many ways to shoot yourself in the foot.
You should be able to learn c# as you go.
ChatGPT is a great resource for this. If you paste in a snippet and ask it to explain you’ll get a decent answer with enough context for follow up questions or things to Google.
You can also ask it to explain how to do things. As long as it’s pretty general.
Getting paid to learn is always great in my experience.
It’s not a fucked up situation. I’m a Ruby developer and I got hired in a Scala shop with no experience. It took just a couple weeks to get up to speed and everyone was understanding.
Since you know programming principles already, the difference between languages is mostly in their APIs. But even experienced developers spend half their time reading docs about APIs. It’s nothing out of the ordinary.