r/learnprogramming • • 27d ago

feeling discouraged - coding is 'too hard'

im trying to get into learning C++. I've taken courses and have some experience with data structures and algorithms. but I can't code from scratch and when I go learn tutorials, I often feel like I can't do anything on my own. I know people say to sit with your code and debug in order to learn, but how do you even get to that point? I guess my question is: how do you actually learn to program from scratch?

edit: it looks like I've found a number of people looking to work on projects, so I made a discord for group projects! You can join here: https://discord.gg/ysbgcD8Baf

90 Upvotes

102 comments sorted by

View all comments

Show parent comment

2

u/binarycow 27d ago

C# is a Microsoft language

And Go is a Google language. And Kotlin is a JetBrains language. So what?

The only thing that matters now is that C# is no longer windows only. You can write cross-platform GUI apps with it. You can write web apps. Everything Java can do.

The best way to understand it is windows app cert kit, required assets, manifest, signing, and makepri. They are bane of my existence. Not fun and very egregious of MS.

These are all Windows specific issues, that apply to windows apps written in any language.

Not to mention, with modern dotnet, none of that is really needed. You can write a self contained application that doesn't even need the runtime installed. No installer, nothing. A single file.

Although, windows smartscreen may flag your app, unless it's digitally signed. But again, it does this for any app, written in any language.

So - one real requirement - a digital signature.

so the tooling and ecosystem around it are simultaneously very modern and very old because of decades of compatibility.

Modern dotnet has tooling that has no ties to windows. You can use any IDE, there are cross-platform build tools, etc. Only time you need to worry about windows is when writing a windows gui app.

1

u/MrCodeGameandAnime 27d ago

I could debate this endlessly with you as well, but I already responded to most of it in a previous response to another Redditor. Please feel free to pile on and downvote 😜

https://www.reddit.com/r/learnprogramming/s/RrXS9gb4HG

The question I have for you is, why would you choose C# if not for Windows? Maybe I'm just blind leading the deaf, but beyond aspnet as legacy websites or dotnet as legacy enterprise software, I don't really understand the tool choice. Have you always used C# first? Is your go to language? Is it how you learned to code? Epistemic provence in regards to software may glean the paradigm for a given stance.

2

u/binarycow 27d ago

The question I have for you is, why would you choose C# if not for Windows?

At the very least:

  • Elegant, capable, and performant language
  • Excellent build system
  • Excellent package manager
  • Capable and fairly well designed GUI apps (WPF first party for windows, Avalonia third party cross platform)
  • Not stuck in the past - always modernizing

Have you always used C# first? Is your go to language? Is it how you learned to code?

No. It's the language I keep coming back to though.

My language history (from what I can remember, at least), going back ~30 years:

  • QBasic
  • VB6
  • C
  • Perl
  • PHP
  • VB.NET
  • C#
  • Java
  • Back to C#
  • F#
  • Back to C#
  • Python
  • Back to C#
  • Rust
  • Back to C#
  • Dart
  • Back to C#

1

u/MrCodeGameandAnime 27d ago

Lol, THIS guy definitely PHPs 😂😂😂

Oh shit, you're a perfect case because it explains everything. I absolutely understand your stance. Given 30+ years of software development I REALLY wish you pulled up with Fortran in the list. It would have made my day.

I've been developing for 7+ years, so obviously I don't have as much depth, but I view languages as tools. Python is my primary I'll do my damnest to use it on everything, but I understand it's limitations. For instance:

Window's:

  • c++
  • c#

Mobile:

  • java
  • kt

Web:

  • js

Concurrency:

  • GoLang

My largest project was slated for a rewrite to c++ once completed because it's a game and I want it on mobile, PS5, and PC. Then I fell down the rabbit hole of micropython and learned of a guy who ported to PS5 with it.

My second largest application is a streaming service which I planned to use fastapi, but then I did some digging. I learned about livekit and it's history. More searching lead me to pion. GoLang was chosen because python couldn't really compete at scale. Then I went further down the rabbit hole after first choosing srs. Found MediaMTX, realized I could engineer my way through ingress/egress to subvert transcoding to keep cost low.

I don't have nearly as much experience as you, but I try to be smart about tooling choices and keep overhead low and only scale when required including dependencies.

Thanks for responding and engaging. I always appreciate insight from uncs 😜

2

u/binarycow 27d ago

Full disclosure - I don't do web front-end (I abhor it) or mobile (just haven't felt the need).

Additional context - I'm a software developer and a network engineer. I have to keep two careers of knowledge in my head.

Python is my primary I'll do my damnest to use it on everything, but I understand it's limitations

Funny. C# is my primary, I do my damnest to use it on everything, and I've found very few limitations (but I do acknowledge them).

including dependencies

By splitting everything up into different languages, you not only have those dependencies, but also the language itself as a dependency. Additionally, there is the added overhead of developers having to manage different tooling and everything.

Let's say that language A is best for concept A, language B is best for concept B, and language C is best for concept C. Now let's suppose that language D is second best for all three concepts. I would rather use language D for everything.

C# is a very good language, and a good ecosystem. Is it the absolute best for every single thing? No, of course not. It is excellent for many things, good for most things, and suitable for almost anything.

Every other language I've tried has ended up disappointing me, which is why I keep coming back to C#.

Additionally, by sticking to one language, I can learn it more in-depth than someone who spends the same time learning 5 languages.

1

u/MrCodeGameandAnime 27d ago

Lol, we're so similar it's hilarious 😂

I absolutely hate webdev because function over form every day of the week. I've never done network engineering like that, so I can't speak to it.

I don't really split languages so much as pivot when required. For instance I was adamant in my early days I was going to make python work on Android. The problem is the tooling wasn't really there 5+ years ago. I accepted reality because I wanted to develop Android apps, so I had to use Java. This was just before kt really kicked off and became the primary language. Now chaquopy exists and is mature 😈🐍

I'm very much with you in c# being a good language and strong in many domains with dotnet. I won't argue that at all. The proliferation of python circa 2020 comes from the same space. Strong, but has some limitations. I can't confidently say that of JS despite its maturation, but maybe I'm biased. Ok, I'm biased. I guess the better way to say it is JS was meant strictly for the web, but has grown and is very capable across many domains.

I don't really get disappointed by languages because I don't expect them to do something. It's just a tool to me. I also don't expect one language to do do something the way another language does. However, what exactly disappointed you?

I 100% agree with sticking to one language. Whichever one you choose, get really good at it. One caveat, I genuinely believe it is important to understand both sides of interpretation and compilation. Even if you choose one lane, it's still very important to understand paradigms. I wouldn't be nearly as capable I didn't spend time head deep in Java architecture. That period built so much foundation and progressed me beyond writing scripts to building scalable applications.

1

u/binarycow 26d ago

I accepted reality because I wanted to develop Android apps, so I had to use Java

Yeah, I'm with you - if I have to, I'll use the appropriate language. Probably Kotlin and not Java, but 🤷‍♂️. Dotnet has MAUI, so I might fiddle with that, but I'm not a fan of MAUI, so I don't know. If I didn't have to, I just wouldn't make an android app. If I had to, I'd probably suffer thru MAUI or Kotlin.

I guess the better way to say it is JS was meant strictly for the web, but has grown and is very capable across many domains.

The only good Javascript is typescript.

However, what exactly disappointed you?

There's a couple major topics which continually disappoint me, depending on the language.

In no particular order, with one counter example per:

  • Build system

    • Dotnet has one build system that does everything you need it to do - to the point where it's unusual to even look for another one. Example 1 Example 2
    • Java has maven, gradle, blah blah blah
  • Package management

    • Dotnet has nuget. It's great. You don't really need anything else
    • Javascript has NPM, which is a dumpster fire
  • Distribution

    • Dotnet self contained apps just work. Running from source? Install the SDK, and it just works.
    • Python, you gotta set up venv (or risk installed dependencies corrupting other shit). Then you gotta fiddle with this and that. Maybe there's a script you gotta run to install something, blah blah blah blah.
  • "Batteries not included"

    • With dotnet, almost everything is included in first party frameworks/packages. Third party packages are usually "would be nice" stuff.
    • Javascript.... 'nuff said.