this post was submitted on 28 Dec 2024
58 points (95.3% liked)

Ask Lemmy

27281 readers
1358 users here now

A Fediverse community for open-ended, thought provoking questions


Rules: (interactive)


1) Be nice and; have funDoxxing, trolling, sealioning, racism, and toxicity are not welcomed in AskLemmy. Remember what your mother said: if you can't say something nice, don't say anything at all. In addition, the site-wide Lemmy.world terms of service also apply here. Please familiarize yourself with them


2) All posts must end with a '?'This is sort of like Jeopardy. Please phrase all post titles in the form of a proper question ending with ?


3) No spamPlease do not flood the community with nonsense. Actual suspected spammers will be banned on site. No astroturfing.


4) NSFW is okay, within reasonJust remember to tag posts with either a content warning or a [NSFW] tag. Overtly sexual posts are not allowed, please direct them to either !asklemmyafterdark@lemmy.world or !asklemmynsfw@lemmynsfw.com. NSFW comments should be restricted to posts tagged [NSFW].


5) This is not a support community.
It is not a place for 'how do I?', type questions. If you have any questions regarding the site itself or would like to report a community, please direct them to Lemmy.world Support or email info@lemmy.world. For other questions check our partnered communities list, or use the search function.


6) No US Politics.
Please don't post about current US Politics. If you need to do this, try !politicaldiscussion@lemmy.world or !askusa@discuss.online


Reminder: The terms of service apply here too.

Partnered Communities:

Tech Support

No Stupid Questions

You Should Know

Reddit

Jokes

Ask Ouija


Logo design credit goes to: tubbadu


founded 2 years ago
MODERATORS
 

I've been coding for years in a multitude of languages, but other than one c class I had in college I mostly learned through osmosis, or learned new things as they were needed.

So my knowledge is honestly all over the place and with a ton of gaps.

I'm trying to learn rust and starting going through The Rust Book and afterwards I plan on going on Rust by Example and trying to code my stuff as strictly following best practices as possible.

Is that a waste of time? I mean rawdogging it has been working for me for a decade now. Should I just yolo and write what I wanna write in Rust and learn as I go?

top 29 comments
sorted by: hot top controversial new old
[–] hendrik@palaver.p3x.de 5 points 5 hours ago* (last edited 5 hours ago)

Yes. I think it's massively useful to learn coding in a structured manner. And books will do that. I usually read at least one chapter at a time and then try to apply it. Either myself, or do the attached assignments. Plus it's relatively fast to learn with proper material. You don't need to search for the information yourself, they're in the correct order and you're unlikely to run into some dead ends because you missed some more fundamental knowledge (if you taught it yourself pretty randomly).

If I already know things, I just read a few more chapters at a time. That's also some nice thing with books (in my opinion) you can read them as slow or fast as you like.

[–] expr@programming.dev 4 points 6 hours ago

Generally the Rust Book, even in comparison to most languages, is considered to be very good and it is the expected way to learn the language. It won't teach you everything, but it does give you a very solid foundation. The Rust community has put considerable effort into their learning materials.

[–] Nyxicas@kbin.melroy.org 1 points 6 hours ago

Reading programming language books isn't a waste of time. What is a waste of time, is delving into a programming language and finding out how little of use it is. You'd hate yourself for pursuing a programming language and find out that it has little purpose.

The point of programming however, is to be versatile. Do not be content. You may focus on one or two programming languages, but there are jobs and fields out there that's going to require more programming languages so you might want to keep a head up on that.

But no, reading programming books is not a waste of time. Just do not expect one book to answer everything. There's a reason why there's tons of editions of C/C+ for example. There is something new to document and learn about with that programming language.

[–] Coreidan@lemmy.world 1 points 6 hours ago

It depends on what you want to learn. One book won’t teach you everything there is to know about a language.

Decide on what area of the language you want to learn more about and then try to find a book that focuses on conveying that.

Otherwise you may spend a bunch of time learning something you don’t care about. You don’t need to know everything about a language unless you have a specific reason for why you want or need that knowledge.

The depth you go into a language will dictate where you need to go to gain the knowledge you’re seeking, if that makes any sense.

A simple 2-3 hour breeze through online documentation may be all that you need to get by. Or maybe a deep dive into serialization is needed because the kind of project you’re on and therefore finding a few books on that subject will be required.

[–] owsei@programming.dev 2 points 7 hours ago

For me The Rust Book was useful for discovering features of the language, not to discover how to code with Rust

[–] obbeel@lemmy.eco.br 1 points 6 hours ago

I've read the full C++ programming book by Bjarne Stroustrup before. It's good because you get the insight of the author about the language, but I don't think it's the best way to learn the language. I think it's good if you want to learn what is at the root of the programming language.

[–] Waldowal@lemmy.world 4 points 9 hours ago (1 children)

Yes. I find it very difficult to get a complete knowledge of something just reading random articles and playing with it. For me, one of those giant books intended to document every little aspect has always helped fill the gaps, and take my working knowledge up to expert level. It's getting harder to find those kind of quality books though.

[–] sighofannoyance@lemmy.world 1 points 8 hours ago

alright, I get the random articles thing, but what about the official language documentation/reference on the language's homepage?

[–] Bougie_Birdie@lemmy.blahaj.zone 1 points 7 hours ago

Personally, I like to supplement my knowledge with the occasional book. Like shit, that's sort of the whole point of books.

I don't think a book has ever got me started on something new while programming. Like if I want to pick up a new language or framework, I have better luck going directly to the documentation. If I have a specific problem, then I can search online or find a tutorial or something.

Another risk of using a book as the entry point is when those books go out of date and no longer become relevant. Always make sure they're using the right version of whatever tool you're using, lest you pick up a book vaguely titled "Learn Python" and discover it's for 2.7 when you've installed 3.11

But as you've kind of surmised here, books are great for filling in the gaps in knowledge. They're also generally speaking written by authors with tons of experience (and perhaps biases) which might tell you why things are done a certain way.

Of particular interest - and caution - are opinion-based books. For example, Clean Code is full of examples that sound good on paper, and then when taken to their extreme are shown to be brittle and cumbersome. I still think the book has some good points, but at the end of the day it's opinion, and opposing opinions exist for a reason.

So I guess what I'm saying there is books are great, but you shouldn't follow them dogmatically

[–] ExperimentalGuy@programming.dev 1 points 7 hours ago

Reading the rust book is a great use of your time. Rawdogging is a good method if you're just concerned with things you're working on. You can also read documentation on different things that you may not be working on, but know is a gap in knowledge. For me that was the async and tokio books as async rust is a bitch.

A lot of rust libraries use the same approach by having some type of "book" for documentation. I treat them like normal reading, so I'll be out and about or just sitting and I'll pull one out and read it leisurely. It's another way I've found to learn by osmosis. Doesn't even have to be something I'm working on, just something interesting. It sounds like you're doing what interests you, and that's what's important.

[–] Nemo@slrpnk.net 1 points 7 hours ago

I read programming books the way my wife reads cookbooks.

[–] darklamer@lemmy.dbzer0.com 7 points 12 hours ago

After I had learned programming well enough to do it comfortably in a few different languages, the return on investment for reading most common programming books declined sharply and since then the only programming books I still read are of a very specific kind and the very best of those still remains The Practice of Programming by Kernighan & Pike which still remains a greatly educational and relevant book today, 25 years later: https://en.wikipedia.org/wiki/The_Practice_of_Programming

[–] Nikelui@lemmy.world 26 points 16 hours ago (1 children)

In my opinion, once you have learned the basics (and a few advanced topics) of programming, you are already 40-50% into learning any other new programming language. If you feel reading a book is a waste of time, skim it to learn the syntax while you work on projects and come back to it when you are stuck on something. Also programming books often have sections about best practices and common mistakes, make sure not to skip those.

[–] Graphy@lemmy.world 8 points 15 hours ago

Yeah when I swap between languages these days I usually just google some form of “cheat sheet” and hope some college kid made one I can reference

[–] helmet91@lemmy.world 4 points 12 hours ago (1 children)

That's basically how I learned programming. I've bought a book I was interested in, an as I was progressing, always typed the sample codes by hand and tried them.

Even today I buy a bunch of programming books.

[–] sighofannoyance@lemmy.world 1 points 8 hours ago (1 children)

alright, I get the just buying a text book thing, but what about the official language documentation/reference on the language’s homepage?

[–] helmet91@lemmy.world 1 points 6 hours ago

That's a great resource for when you know what you're looking for, but I wouldn't use it for learning new stuff. It's like if you were trying to learn a language from a dictionary.

[–] Kolanaki@yiffit.net 11 points 16 hours ago (1 children)

I first started from just reading "teach yourself" books. But I would say most of the actually useful shit I learned was just by sheer brute force fucking around with my own things and learning by doing.

[–] NOT_RICK@lemmy.world 3 points 16 hours ago

Yeah I’ve only learned at work by bashing my head against the wall whilst complaining about bad documentation

[–] natecox@programming.dev 7 points 15 hours ago

The Rust Book helped me realize that I wasn’t likely to just learn Rust by doing as I had done with many other languages. I fucking love Rust but it is a bit of an oddball and the book is a great way to start.

[–] UnpopularCrow@lemmy.world 8 points 15 hours ago (1 children)

I think it comes down to how you learn. I’ve found programming books useful because I tend to learn quickly from books. I know others do not. Regardless, if I’m reading a programming book, it is usually nearby a computer where I can try stuff out. At the end of the day, the time at the keyboard will be time well spent when learning a language.

[–] jet@hackertalks.com 3 points 15 hours ago

Exactly. I know I learn the best from reading. I'll read the book, do the exercises, then reread the book after a while. The first pass I pick up some of it, and the second pass I pick up a lot more detail. Once I've built the mental model

[–] AbouBenAdhem@lemmy.world 4 points 14 hours ago

I think related/similar languages can be picked up on the fly, but if (for example) you’re only familiar with object-oriented languages, you need a more comprehensive introduction to your first functional language.

[–] brie@programming.dev 2 points 12 hours ago

A coworker from Alabama once told me that programming is like kissing your sis: you can't get better at it by reading books, you have to try and make mistakes to learn

[–] specterspectre@lemmy.world 3 points 15 hours ago* (last edited 13 hours ago) (1 children)

Anki for practicing recall and a lot of practice. Tons of daily practice. Build as many things as you can. Build for fun. Build to use the tools given by the language. Build unoptimized slop to experience first hand why it's normally not done.

I rely on Anki heavily so that the book content sticks around in my head. Do it long enough and you'll be able to recall entire books bit by bit.

Identify the gaps in your knowledge and plug em with books and courses. Reading books without practicing recall and working on your own projects might be a waste of time. I personally don't think it is if it's fun.

[–] sighofannoyance@lemmy.world 1 points 8 hours ago

so how long do you retain this anki-knowledge?

[–] NeoNachtwaechter@lemmy.world 2 points 14 hours ago

The last one I have read was "Java in 21 days", when I had some spare time between jobs.

Already decades ago... The last one before that was the API reference of Windows 3.1 :)

Today I start a new topic or language with a few youtube tutorials (when I have time) or just with ChatGPT (when I don't have time).

[–] rouxdoo@lemmy.world 2 points 15 hours ago

I have read and worked through most of the O'Reilly animal books - perhaps this is before your time. Perl, C, C++, Java, etc.... Yak, Camel, animals galore. I still have most of them buried in a closet somewhere.

This was before you could just google or (gasp, CGPT) your answer. You had to read and learn how to do something then try, practice and refine until you had a solution.

To this day I really prefer to enter a new language with a manual that has an index and examples. I could not have learned shit with nothing but Discord and (today's) google to help.

[–] TheV2@programming.dev 0 points 10 hours ago

If we're talking about programming language guides in particular, following a guided introduction to a new language was helpful to me, when I was introduced to new concepts and perspectives. And Rust is the best example in my case. Personally I probably would've struggled more and longer in practice without learning about ownership, lifetimes and borrowing in theory first, because it's an essential part of almost anything, even strings, and yet it's not too difficult to understand in theory.

But at the end of the day, you can start rawdogging it and use the Rust book or any other guide, when you're facing a roadblock. If you do so, please share your experience.