this post was submitted on 01 Dec 2024
31 points (100.0% liked)

Programming

17677 readers
54 users here now

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!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 2 years ago
MODERATORS
 

Folks, I need a hobby. I'm a C programmer who has lost his passion for programming, it seems. I've decided to try to spark my passion again by going back to the basics, perhaps by creating a programming tutorial Wikibook, for modern applications.

The trouble is, I cannot decide if I should make C or Rust my programming language of choice.

I use C all the time, and have barely any experience in Rust.

Do I go with ol' reliable and risk being outdated in a few years, or go with the new language and risk being too niche and unpopular?

top 9 comments
sorted by: hot top controversial new old
[–] rutrum@lm.paradisus.day 15 points 3 weeks ago* (last edited 3 weeks ago)

Imo Rust already has the perfect book. I would make a resource for C developers. Especially since you know C already.

[–] solrize@lemmy.world 13 points 3 weeks ago

Writing a book when you don't know the subject matter doesn't sound likely to result in a good book. Even more so for a language like Rust, which (short of Haskell) is the closest thing to a mainstream language that is informed by a lot of pointy headed PL (programming language) theory. A book about programming in Rust doesn't have to go into the theory per se, but the author should be familiar with it, just like someone who writes an introductory calculus or statistics text really needs a much deeper mathematical background than the book itself will convey.

If you want a Rust-related hobby, first of all, why not do Advent of Code in Rust, or otherwise make a study of Rust? And then if you're interested in PL theory, that's another area to study. Harper's book PFPL is a good place to start: https://www.cs.cmu.edu/~rwh/pfpl/

[–] azolus@slrpnk.net 7 points 3 weeks ago

I'd say going with C is not a bad idea at all—I for one would be interested. C is not going to become obsolete any time soon and is an immensly useful language to be proficient in.

When I tried to learn C I felt like I'm doing everything wrong because the C-way of doing things is very different to what one is used to from more modern languages (header files, make etc). Bridging the gap between the "I can solve project euler challenges" stage and actually being able to organize and implement proper projects is difficult without a mentor, so why not share your expertise?

In the end, go with what you feel most like doing, there will be an audience either way. So pick what is most fun to you!

[–] CameronDev@programming.dev 6 points 3 weeks ago

Rust is definitely not new and niche anymore, its the most popular language in the StackOverflow surveys.

A C book feels dated at this point, there are very strong recommendations that C is to be phased out in favor of memory safe languages. But people have been signalling the death of C for decades, so it probably has a few more years left.

A good C book on how to write memory safe C would be useful. Its been tried many times, but newcomers to C still seem to struggle with allocation and freeing, and thread safety.

[–] akkajdh999@programming.dev 4 points 3 weeks ago
[–] Kissaki@programming.dev 4 points 3 weeks ago

I don't see how that is relevant? You're already familiar with C, so writing about C does not influence whether you will be outdated in a few years. Learning and writing about Rust could be something that becomes useful, but not necessarily practically - it depends on what you will do in the future.

If you feel you lost your passion, I would suggest learning and experimenting with Rust. It's different, so may be interesting and thought provoking to learn.

Writing down what you know about C may also be worthwhile, good, or produce a good resource, but I don't see it as much or like as sparking lost interest and passion. If that is actually your goal (you only asked about future relevancy in the end).

[–] sudo@programming.dev 4 points 3 weeks ago

Do both but only publish the C tutorial. Only do a Rust translation as a draft so you can learn Rust. It would be wildly irresponsible to publish the Rust translation when its the first time you've written Rust.

[–] gianni@lemmy.ml 2 points 3 weeks ago

Zig could use your help I think. Give it a look

[–] Irelephant@lemm.ee 1 points 3 weeks ago

I'do go with c. Sent a link to us when you start!