9 ms·
Beej's Guide to Learning Computer Science
- bencornia 11mo agoI am currently enrolled in a operating systems course where Beej's guide to network programming was invaluable. Highly recommend!
- stonecharioteer 11mo agoI started skimming this but it seemed to be more of a learning how to learn CS book. I'm a fan of his other works. This one, I'm not so sure the right folks are going to find it when they need it/ should use it.
- elseweather 11mo agoBeej's guide to network programming is an all-time classic, and I suspect this is the same (even before I've read it thoroughly).
- pygar 11mo agoMost reputable CS courses will have one or two math subjects (often called "Discrete Mathematics" or some variation). Does anyone have any advice on tackling subjects like these for someone who hasn't done any math since high school more than a decade ago (and has forgotten it)?
- School-Cotton 11mo agoMy advice is to (re-)learn elementary algebra to a proficient level before attempting any other branch of math. That is a core prerequisite for absolutely everything. By elementary algebra I mean roughly everything in classes called “Algebra” or “pre-calculus” that you learn in an American high school before calculus. Geometry and trigonometry can’t hurt either but algebra is more central.
- tresdots 11mo agoFor as much as I've learned in the last 10 years of being a software engineer, I've frankly forgotten at least half of the maths I once knew. Of course, I could take the time to re-learn it all if need be, but I'm definitely thankful to have went straight from high school into college. Having to re-learn everything just to be at baseline would make the whole experience far less enjoyable. Kudos to those that have done so.
- chrisweekly 11mo agohttps://betterexplained.com https://betterexplained.com is a goldmine
- randmeerkat 11mo agoKhan Academy https://www.khanacademy.org/ https://www.khanacademy.org/
- qsort 11mo ago> one or two math subjects Only one or two? :) It's not easy as an adult but it's definitely doable, don't get discouraged. The main hurdle isn't knowledge of specific topics, most undergraduate courses assume little to no previous baggage, i'd say it's more the lack of "mathematical maturity"[0], or the ability to "bridge" between the formal language of math and the intuitive "what we're doing here". When you're writing code, you probably don't stop to think "I need to do this operation for each element of this vector, a for loop is what I need", you instead have a high level idea of what you're trying to accomplish and "make the code happen", filling in the formalities as needed. Trying to go line by line is how beginners operate, and that's why they never get anything done. I'd never get anything done either if I had to work like that! The reason why many people get stuck in math is similar. You read a definition that goes "for all ε>0 there exists δ such that for all ..." and you immediately get confused, trying to keep the entire "abstract syntax tree" of what you just read in memory. Like in the code example, the "mature" way to see it is that we're trying to capture an idea, and the formalism is instrumental in that. What are the variables "morally" doing? (At a certain point you'll realize the formalism is actually working for you rather than against you, but that's a rant for another time...) The conceptually easier but more time-consuming thing to do is to practice symbol pushing if you lost that since high school. For example: is it immediately obvious to you what (a+b)^n is if you expand it? Do you remember how to factor (a^3 + b^3)? Do not despair if you don't. Many more people than you think can't do that off the top of their heads, but it's the kind of "mechanical" skills that's probably blocking you at this point. Another important aspect to learn is a bit of notation, the "standard library" of math, as it were. Understand "for all" and "exists" as quantifiers, and how they interact with negation and logical operators. It should be eventually obvious to you that negation "inverts" quantifiers. Learn at least a little bit how to work with naive set theory: union, intersection, etc. Look up what the "common" sets (integers, rationals, reals, complex) are and how they relate with each other. And finally, try to get a feel for how proofs work. That's going to be important, even for the type of math you need for computer science. Good luck! --- [0] https://en.wikipedia.org/wiki/Mathematical_maturity https://en.wikipedia.org/wiki/Mathematical_maturity
- monero-xmr 11mo agoMy university offered the math classes in either CS or Math departments. I always chose the math department. Better teachers and far more interesting professors (as people)
- modernerd 11mo agohttps://www.mathacademy.com/ https://www.mathacademy.com/ is a great combination of structured learning across an incremental skill tree with practise problems to prove to yourself that you understand. It’s a big commitment but helped me go from “hasn’t done any math for a while and probably missed some basics” to much more comfortable. You can do the self-test to pick a starting level and work up from there. As with many things you basically have to sit down and do the work, though, you’re not going to get better just by inhaling books and videos. MA isn’t a fun/gamified learning platform like Duolingo, the ‘fun’ comes from putting the work in and seeing yourself improve. For me it went from a grind initially to something I enjoyed doing. https://www.geogebra.org/ https://www.geogebra.org/ is also worth exploring for its novel visual approach, but is much more rudimentary, less challenging, and less deep than MA.
- lII1lIlI11ll 11mo agoI second this. Mathacademy is great and there is no way OP would be able to just jump into university-level math courser without re-learning prerequisites, considering they said that they forgot most of the school-level math.
- nathan_douglas 11mo agoI third MathAcademy. I graduated high school >25 years ago with almost no math skills and had a major struggle with the math prerequisites for my CS degree ~15 years ago. I've been wanting to get into higher math recently, so a few months back I started hitting MathAcademy heavily. Its structure and modularity is exactly what I needed.
- Rendello 11mo ago> Its structure and modularity is exactly what I needed. Through great effort, I completed Mathematical Foundations I & II. I talked about it a bit here [1][2]. If you read through MathAcademy's methodology and reasoning, it's incredibly strong [3], but in practice I never felt confident in my understanding or execution, everything felt quite discrete and I didn't understand the relationships or purposes of what I was doing. I kept going because I was getting better, and because people online who were quite good at math said not to try too hard to understand things fully at first, since the abstraction level of math is so high. The weeks before finishing MFII, my motivation was higher than ever. The day I finished, I felt nothing, and in the following weeks I decided that it was time to let it go for now. I think MA is good. I've never done so many exercises in my life, and although I wasn't super confident, I was far better at math than I'd ever been. But I think MA probably needs a lot more multi-part exercises so you understand what you're doing and where to use things. I feel like I learned "Discrete Math", but in the sense that all the lessons were discrete and I couldn't draw connections between them. https://news.ycombinator.com/item?id=42519882 https://news.ycombinator.com/item?id=42519882 https://news.ycombinator.com/item?id=43275665 https://news.ycombinator.com/item?id=43275665 https://www.justinmath.com/files/the-math-academy-way.pdf https://www.justinmath.com/files/the-math-academy-way.pdf
- deleted 11mo ago[deleted]
- whatamidoingyo 11mo agoI'd recommend going on Thriftbooks and ordering a textbook. I can't remember the exact copy I had years ago when I was self-learning CS, but it was like $4.00 for a really incredible textbook. Now, I don't have a degree, so take my advice with a grain of salt, but the book was really really good, and honestly, if you've been programming for awhile, I think most of the concepts didn't require a heavy math background (of course, it would probably help). The chapters were like: Symbolic Logic, Set Theory, Proofs, Algorithms, Cryptography, and other things which I can't remember. Edit: The book is free to read online EDIT EDIT: Removed link as I don't know if that was a "legal" link. It's out of stock on Thriftbooks, but looks to go for $6-8 on there.
- ink_13 11mo agoWhat's the name of the book?
- whatamidoingyo 11mo agoIt's called "Discrete Mathematics and its Applications" by Kenneth H. Rosen. A google search reveals a PDF as the first result.
- Rendello 11mo agoMath Academy is a good option, but I wrote about the issues I had with it here. Recently, I've been going through Introduction to Graph Theory by Richard J Trudeau. It's from the 70s, and I'm doing all the exercises. It really is an intro, and teaches some set theory and proof stuff. Doing Math Academy at least taught me that doing exercises is incredibly important for mathematics learning. https://news.ycombinator.com/item?id=46124247 https://news.ycombinator.com/item?id=46124247
- z500 11mo agoIt's a different kind of math from the continuous math they teach in school. Personally I found it a lot more intuitive. Like it wasn't the easiest thing ever, but I did better than I thought I would.
- _f9cu 11mo agoThanks for this !
- hahahacorn 11mo agoI’ve had Beej’s Guide to C and Beej’s Guide to networking bookmarked for an embarrassing amount of time. But this is the first guide that I know the material! I have “learned computer science” (somewhat). And I have to say it has propelled Beej’s other guides to the top of my reading list. The subchapters I skimmed and their content are just so relevant and I know many new and experienced devs (myself included) who would still benefit greatly from reading this. Just exceptionally well done.
- bencornia 11mo agoI recently read his networking guide as part of a class and it was invaluable. It gets you up to speed without overwhelming you with detail. It's a lightweight read.
- chrisweekly 11mo agoThat sounds like HPBN (High-Performance Browser Networking), an awesome and accessible resource everyone doing anything w the web should read. https://hpbn.co https://hpbn.co (not .com)
- zeeqeeng 11mo agoI've had Beej's Guide to C, and I would say it's the best C learning material for myself ever.
- matt3210 11mo agoBeej taught me networking in c in the early 00s. He will now teach my son computer science in the 20s. The circle of life.
- egwor 11mo agoLooking at the article headings these don't feel like computer science, and rather how to approach coding problems. This is useful, but not Computer Science. I think that we should refer to this as Programming Engineering or Software Engineering. It is important to call these distinctions out in my mind because the Computer Science is often the concepts or foundations, whereas the Software Engineering is about how to convert those concepts and use them in a situation such that the concepts are well implemented, tested, and will stand the tests of time (including changing it). They're different skills and concepts.
- beej71 11mo agoI think that's a valid point. The naming came from the fact that the (my) students reading this are in a degree program called "Computer Science". But I do thing that's worth a mention in the guide. Cheers!
- lou1306 11mo agoNot my kids, but I also passed my Networking course thanks to his guide (early 10s), and I used it as reference material for teaching about sockets in an Operating Systems course this year. Sometimes I just love the Internet, man.
- jjice 11mo agoUsed his book to learn networking in the late 10s! It's a timeless book at this point. Using the C/Unix socket APIs as the foundation is fantastic. He dives into code and actual network function so well for such a quick read.
- aa-jv 11mo agoBeej has been a stable reference for me for decades, also. By applying the knowledge gained in his networking guide, I've won many contracts for work that others considered too difficult (or "impossible" in the budget constraints) .. but which I managed to deliver, on time and under budget, because Beej had led the way. Easily one of my top 5 favourite people on the Internet, alongside Linus Torvalds and so on.. I would say Beejs' impact on technology has been understated but definitely an order of magnitude or two greater than most.
- pmontra 11mo agoWell done but is this a guide to Computer Science or to Software Engineering? In a Guide to CS I expected to find information theory, computability, complexity, finite state automa, language grammars etc. Anyway, the audience is > Undergrad students just getting into programming so it's naturally biased toward the engineering part of the subject.
- kaladin-jasnah 11mo agoWhat about operating systems, architecture, compilers, networking, and the like? I have seen people argue that computer science is the more theoretical side of things, but many university CS programs cover both systems and theory (or sometimes skew to one side).
- deleted 11mo ago[deleted]
- pmontra 11mo agoYes, my CS program of 40 years ago had 4 parts. Sorted by decreasing abstraction level: Math, physics, statistics Theoretical CS, the one in my original comment OS, compilers, networking, computer vision, transmission codes Computer languages and having to write actual programs, how transistors work up to logical gates, adders, CPUs and machine language Of course the separations are not clear cut: we had relational algebra and SQL commands in the same course.
- johnnyanmac 11mo agoI see it as "learning how to learn", not directly learning itself like a curriculum. It's more for those who want to build proper study habits. Reading the chapter of AI seems to support that feeling. It was about tips on where to use it, where to not use it as a shortcut, how to be critical of any output, and some personal speculation.
- hahahacorn 11mo ago> 1 Foreword > Are you getting into Computer Science, or thinking about it? Or maybe you’re in it already. This super-high-level guide is for you! > I’m not going to talk about how to write code (much). I’ll I’m going to talk about in these roughly 40 pages is more about how to learn when you’re a nascent software developer. Page 1
- alexchantavy 11mo ago> So, while it’s clearly possible to have a career in a lucrative field you dislike, it’s (a) going to be harder for you than for people who like it and (b) maybe you should consider a field that you do like? > You gotta want it. Do you want it enough to go through the tremendous amount of effort it takes to learn it? Maybe you hate programming, but you want the money enough. Maybe you don’t care about the money, but you want to program every second of the day. > Just make sure you have the drive to make it happen. Man this is so true
- zwnow 11mo agoThere's also a huge difference between liking to program and liking to work as a programmer. I despise the latter as business programming takes the joy out of everything. Trying to educate management about the current boundaries of the product or having to work extra hard because a product manager promised features that dont yet exist is exhausting. Not being allowed to work on fixing tech debt while having to build on top of it is pain. Doesn't help being a solo dev in a start up either so maybe that's the issue.
- badmonster 11mo agoHave you found any strategies that help maintain joy while dealing with business constraints? What boundaries work best?
- f1shy 11mo agoAs long as: (1) The technical staff understand the business constraints AND (2) management understands the technical constraints AND (3) both constraints "match" you are in heaven. I've seen that. Is possible. Is nice. More often than not, one of the 3 conditions is not met. In case of 1 and 2, if they are good professionals, talk can (and typically will) help. In case of 3, you business case sucks, that is a big problem, change company. Run.
- zwnow 11mo agoI am the worst example to ask this. I regularly go rogue or work on private shit during work. As long as there isn't any pressing work to do I force the balance I need. Perks of working alone I guess.
- silisili 11mo agoI feel stupid saying this over and over each time one of his guides pop up, and I know he lurks here, but thanks Beej. All of his material is absolutely top notch. His guide to network programming was instrumental to both my understanding and career. It often feels like thanks isn't quite enough.
- zwnow 11mo agoYea agree, free educational content is worth so much. Especially in a world where everyone wants to make a quick coin by selling courses or whatever. Would never have looked into C if it wasn't for beejs guide, as that other book that's often recommended is as dry as math books...
- armadsen 11mo agoI was lucky to work with him for a while. He’s a great guy IRL too.
- Madmallard 11mo agoWhat does this matter now? It seems like economic collapse and the destruction of value coming out of programming is basically imminent
- deleted 11mo ago[deleted]
- jhatemyjob 11mo ago> 7.3 No Copy-Paste Coding > [...] But nowadays they tend to punt to some AI. Beginning developers should not do this. I don't know how I feel about this. I get the sentiment, I really do. But it almost reads like a chess Grandmaster in the 90s telling up-and-coming players to not practice against Deep Blue because it will teach you bad habits.
- traxler 11mo ago> But it almost reads like a chess Grandmaster in the 90s telling up-and-coming players to not practice against Deep Blue because it will teach you bad habits. No idea if chess grandmasters did do that in the 90s, but frankly it would have been good advice. Just as it is good advice today for up-and-coming players not to practice against stockfish, leela or whatever. Unless you are already very proficient in chess, practicing against those engines will teach you very little .
- randoglando 11mo agoGukesh, the current world champion, did not use engines for analysis until very late. I think until after he became a GM.
- aswegs8 11mo agoEspecially if your job will be to let Deep Blue play against others so you should know how to control it well. That maybe doesn't satisfy the purists around here but it makes Juniors way more competitive in the short term, hence they are well-advised to use it.
- 11mo ago
- woile 11mo agoI did Beej's Guide to Network Programming and it was fantastic, I learnt a lot, and it was easy enough that I was able to do it in Rust. I'm sure this one is as good as all the others. Point 7.5 of this guide reminds me of the Einstellung effect, I built my own "pomodoro" timer with notifications saying "go stretch" or "go drink water" (https://github.com/reciperium/temporis https://github.com/reciperium/temporis in case someone is interested)
- nsavage 11mo agoSince I had to find the link: https://beej.us/guide/bgnet/ https://beej.us/guide/bgnet/
- marginalia_nu 11mo agoMust have been nearly 25 years ago now, this was one of my first dips into network programming after very briefly dabbling in systems programming based on nothing but random man page exploration and K&R. Think I still have it printed somewhere. Beej has really done the world a solid, it's also making me happy that they're still around and being kept up to date (as much as these things change).
- beej71 11mo agoAppreciate it! This response turned into more of an essay in general, and not specifically a response to your post, marginalia_nu. :) Sharing information, to me, was what made things so great in the hacker culture of the 80s and 90s. Just people helping people explore and no expectation of anything in return. What could you possibly want for? There was tons of great information[1] all around everywhere you turned. I'm disappointed by how so much of the web has become commercialized. Not that I'm against capitalism or advertising (on principle) or making money; I've done all those, myself. But while great information used to be a high percentage of the information available, now it's a tiny slice of signal in the chaff--when people care more about making money on content than sharing content, the results are subpar. So I love the small internet movement. I love hanging out on a few Usenet groups (now that Google has fucked off). I love neocities. And I LOVE just having my own webpage where I can do my part and share some information that people find entertaining or helpful. There's that gap from being clueless to having the light bulb turn on. (I've been learning Rust on and off and, believe me, I've opened plenty of doors to dark rooms, and in most of those I have not yet found the light switch.) And I love the challenge of finding helpful ways to bridge that gap. "If only they'd said X to begin with!" marks what I'm looking for. I'm not always correct (I challenge anyone to write 5000 words on computing with no errors, let alone 750,000) or as clear as I could be, but I think that's OK. Anyone aspiring to write helpful information and put it online should just go for it! People will correct you if you're wrong[2] :) and you'll learn a *ton*. And your readers will learn something. And you'll have made the small web a slightly larger place, giving us more freedom to ignore the large web. [1] When I say "great information", I don't necessarily mean "high quality". But the intention was there, and I feel that makes the difference. [2] It can be really embarrassing to put bad information out there (for me, anyway). I don't want people to find out I don't know something and think less of me. But that's really illogical--I don't even personally know my critics! And here's the thing: when the critics are right (and they're often right!), you can go fix your material. And then it becomes more correct. After a short time of fixing mistakes critics point out, you get on the long tail of errors, and these are things that people are a lot less judgmental about. The short of it is, do the best you can, put your writing out there, correct errors as they are reported or as you find them, and repeat. I cannot stress how grateful I am to everyone who has helped me improve my guides, whether mean-spirited or not, because it's helped me and so many others learn the right thing.
- deleted 11mo ago[deleted]
- maciejzj 11mo agoOn a side note, has anyone noticed the disparity of attitude and level of intensity of dialogue when it comes to AI in different HN posts? Given that there are many threads where 80% act as if AI would cause second coming I suspected that main topic of discussion here would be "is it worth learning CS at all in 2026?". To my (pleasant) surprise the discussion here is much more "normal". Does anyone suspect that some HN posts have a lot of astroturfing from AI-adjacent organisations?
- npinsker 11mo agoI actually feel like the discussion here has trended relatively negative on AI for the most part. Things change quickly though, and it makes sense for opinions to, too.
- 63stack 11mo agoMy impression is that there is definitely astroturfing around AI, yes
- mjburgess 11mo agoHN has become per-thread view-enforced. It's pretty obvious now what the "correct" views are for any given thread, any dissenting comments are downvoted to death. When the next thread comes along, the opposite view might be the "allowed one". There's a particularly egregious amount of veiled partisanship behind a lot of posting too. This could be a group think phenomenon, or it could be botting. Hard to say. I'd say in at least a few cases, it's someone with access and interest into bot downvotes landing on a thread and using that to suppress dissenting views.
- pardon_me 11mo agoI agree. Thank you for pointing out a skeptical view. It's unfortunate that considering supposedly only "seasoned" participators of HN can downvote, it runs deeper than a surface issue. You will be downvoted without comments replying with the counterarguments. Scientific viewpoints often make way to hope and cope engineering here. This will only work as long as the people involved are insulated from the direct effects of their actions. It's a shame. HN felt like one of the last bastions of the old internet where techies came to discuss tech, science, and occasionally important worldwide news, in a technical and objective way.
- liendolucas 11mo agoI have used the guide when at college and it was an extremely good read at the time. Learnt so much. I should probably buy a printed copy. Being that said, at the moment I'm trying to implement a simple non-blocking TLS server in Python with a custom protocol (no external deps, only built-ins) and couldn't find a single guide online that treats the topic. Having read the Python documentation it appears that there are a lot of nuances and pitfalls to correctly implement it. This was my impression after reading the docs, though I could be wrong. I haven't checked if current Beej's guide covers the topic, in case it doesn't, did anyone embarked in doing this with success? The Python docs on the topic: https://docs.python.org/3/library/ssl.html#ssl-nonblocking https://docs.python.org/3/library/ssl.html#ssl-nonblocking
- Madmallard 11mo agoTakes drastically less effort to get good at programming than other disciplines Want to be a professional accompanist? Good luck. You better have been taught since you were a child and quickly picked up sight-reading and were good at it for the last 20 years.
- beej71 11mo agoI'm sure that's true, but there are different kinds of "difficult" that rely on different kinds of effort.
- TrackerFF 11mo agoI see people argue “But other people hate their jobs in other industries, just push through and grind, money is money” Sure, but I want to point out that software development is kind of unique. I can’t think of too many other professional jobs where the line between hobby and work blends, for so many of its workers. Let us be honest with ourselves, many of the toxic things in this industry are caused by a strong culture and “It’s my hobby, and I’m extremely passionate about it” mentality. So people are willing to learn new skills in their spare time, unpaid of course. They’re willing to pull OT and weekend work, for the mission. And those that don’t, are deemed lazy or fakes, not passionate enough. You don’t see investment bankers / lawyers / management consultants / etc. go on about side projects, leveling up their skills during the weekend, and other things that are considered completely normal in this industry. My point is - those are the types of people you’re up against. Those are the type of people many employers love. If you have zero interest for the craft, and just plan on grinding for the money, there are other similarly lucrative ventures, which might align with your own interests, and where it is accepted to be in it for the money.
- deleted 11mo ago[deleted]
- ecshafer 11mo agoProgramming is pretty lucky that there is also large demand for programmers, and the product is high grossing, because the salaries are good. Most other fields with a passion component are low paying. Almost all of the arts Film, Music, Writing, Art pay very low if you are not the absolute top of the field. Millions of people are out there writing short stories, drawing manga, shooting student films, etc for free to land jobs for salaries that the average CS grad would laugh at.
- OkayPhysicist 11mo agoWe're in that position because the work is both hard and appears hard. The kneejerk response most people have to a wall of source code is to run in terror. We know that "being able to read the moon runes" is not the valuable part of our profession, but it has served as a convenient first line of defense. People are more willing to pay ridiculous sums of money to people doing things "I could never", as opposed to "I could, if I wanted to". Art mostly is in the "is hard, looks easy" category. Just look at the average person's response to Barnett Newman's paintings, for example. IMO, this is the most imminent risk with vibecoding. Not that it'll reduce the demand for software developers, but that it'll damage the perceived difficulty of our work.
- groundzeros2015 11mo ago> And because the problems aren’t real, AI can solve them all really easily. There’s tons of training material out there for them to learn from. > But don’t be fooled. Just because AI can solve your school problems doesn’t mean it can solve the real-world problems you’re going to face in your work. (As of now, it can’t.) This is a good point. And it’s unfortunate we can’t see how much these things are tuned for demos like solving classic HW problems.
- layer8 11mo agoI still have trouble getting used to the fact that “computer science” is often used to just mean “programming” in the US. This is a guide to learning how to program.
- idkwhatiamdoing 11mo agoice overview. A personal struggle of mine as someone who is self taught (with a degree in statistics) and has a full time job that does not constantly require programming, I struggle with learning fundamentals alongside doing actual projects. If someone has any advice in this regard, it would be much welcome.
- jairuhme 11mo agoI don't have any advice on self learning, but I have been getting a MS in CS for similar reasons. I also have a stats degree, work full time, and struggle with self learning. For me, being in a structured program makes it easier for me to manage. Certainly not a requirement, but it is the way I learn best. Maybe look for classes you can take at a local university or online and see if anything grabs your attention.
- calepayson 11mo agoIm a student right now and have a background in a non-CS field so struggle with the impostor-syndrome/fundamentals double whammy. The advice I’ve found most valuable is to basically cosplay as someone who’s a complete pro. What would that person read for news? How do they practice their craft? What books do they read on their free time? Cosplay that role long enough and you become it. I’m still learning but it has been a great signpost for me over the last couple years. Cheers and keep crushing it!
- retrac 11mo agoWrite something. My usual suggestions (although I am biased) would be an operating system or a compiler. Or both! When I was in school those were typical course projects in a CS program. (The program I took was more to the circuit and electronic side of it, and my final year project was to design a CPU in VHDL.) A compiler will exercise most of the fundamentals, and in ways you're probably not too familiar with, if you primarily just do a bit of scripting or numerical computation. Areas like parsing - how do you deal with reading in arbitrarily nested recursive structures? And the abstract -- how should you structure the representation of a program internally, perhaps as a tree? And the concrete -- what opcodes does your processor accept?
- notepad0x90 11mo agoBig fan of the single-page and widescreen! I wish there was an extension that did that magically for random blogs.