+0.41 Beej's Guide to Network Programming (1994-2020) (beej.us S:+0.60 )
993 points by ColinWright 1843 days ago | 165 comments on HN | Moderate positive Editorial · v3.7 · 2026-02-28 13:35:06
Summary Education & Free Expression Champions
Beej's Guide to Network Programming is a freely available educational resource that demonstrates strong alignment with the UDHR through its explicit commitment to knowledge access and freedom of expression. The guide champions these principles through its licensing architecture (CC BY-NC-ND with translation exception, public domain code), structural openness to mirroring and translation, and direct encouragement for educational use by teachers. While the technical content itself does not address human rights themes, the framework through which it is shared embodies Articles 19 (freedom of expression and information), 26 (right to education), and related provisions.
Article Heatmap
Preamble: +0.42 — Preamble P Article 1: +0.42 — Freedom, Equality, Brotherhood 1 Article 2: +0.26 — Non-Discrimination 2 Article 3: ND — Life, Liberty, Security Article 3: No Data — Life, Liberty, Security 3 Article 4: ND — No Slavery Article 4: No Data — No Slavery 4 Article 5: ND — No Torture Article 5: No Data — No Torture 5 Article 6: ND — Legal Personhood Article 6: No Data — Legal Personhood 6 Article 7: ND — Equality Before Law Article 7: No Data — Equality Before Law 7 Article 8: ND — Right to Remedy Article 8: No Data — Right to Remedy 8 Article 9: ND — No Arbitrary Detention Article 9: No Data — No Arbitrary Detention 9 Article 10: ND — Fair Hearing Article 10: No Data — Fair Hearing 10 Article 11: ND — Presumption of Innocence Article 11: No Data — Presumption of Innocence 11 Article 12: ND — Privacy Article 12: No Data — Privacy 12 Article 13: ND — Freedom of Movement Article 13: No Data — Freedom of Movement 13 Article 14: ND — Asylum Article 14: No Data — Asylum 14 Article 15: ND — Nationality Article 15: No Data — Nationality 15 Article 16: ND — Marriage & Family Article 16: No Data — Marriage & Family 16 Article 17: +0.42 — Property 17 Article 18: ND — Freedom of Thought Article 18: No Data — Freedom of Thought 18 Article 19: +0.74 — Freedom of Expression 19 Article 20: ND — Assembly & Association Article 20: No Data — Assembly & Association 20 Article 21: ND — Political Participation Article 21: No Data — Political Participation 21 Article 22: ND — Social Security Article 22: No Data — Social Security 22 Article 23: +0.40 — Work & Equal Pay 23 Article 24: ND — Rest & Leisure Article 24: No Data — Rest & Leisure 24 Article 25: ND — Standard of Living Article 25: No Data — Standard of Living 25 Article 26: +0.74 — Education 26 Article 27: +0.54 — Cultural Participation 27 Article 28: ND — Social & International Order Article 28: No Data — Social & International Order 28 Article 29: +0.44 — Duties to Community 29 Article 30: ND — No Destruction of Rights Article 30: No Data — No Destruction of Rights 30
Negative Neutral Positive No Data
Aggregates
Editorial Mean +0.41 Structural Mean +0.60
Weighted Mean +0.51 Unweighted Mean +0.49
Max +0.74 Article 19 Min +0.26 Article 2
Signal 9 No Data 22
Confidence 20% Volatility 0.15 (Medium)
Negative 0 Channels E: 0.6 S: 0.4
SETL -0.31 Structural-dominant
FW Ratio 57% 27 facts · 20 inferences
Evidence: High: 2 Medium: 7 Low: 0 No Data: 22
Theme Radar
Foundation Security Legal Privacy & Movement Personal Expression Economic & Social Cultural Order & Duties Foundation: 0.37 (3 articles) Security: 0.00 (0 articles) Legal: 0.00 (0 articles) Privacy & Movement: 0.00 (0 articles) Personal: 0.42 (1 articles) Expression: 0.74 (1 articles) Economic & Social: 0.40 (1 articles) Cultural: 0.64 (2 articles) Order & Duties: 0.44 (1 articles)
HN Discussion 20 top-level · 17 replies
yakubin 2021-02-11 11:27 UTC link
Socket programming never clicked for me before I learned about the protocols themselves first. My brain just rejected using an API for something I didn't understand. So if you're like me, I highly recommend reading Comer's "Internetworking with TCP/IP" first, and sitting down to socket programming later.
teleforce 2021-02-11 11:30 UTC link
If I remember correctly this network programming tutorial has been around for more than 20 years now, how times flies!

If you want a cross platform network programming guide in C, Lewis Van Winkle has written an excellent reference book[1].

[1]https://www.amazon.com/Hands-Network-Programming-programming...

LeonM 2021-02-11 11:31 UTC link
Back in 2010 I had my first embedded programming job. I needed to do some network programming in C (controlling a PLC over ethernet). My boss at the time told me "just read Beej's guide and you'll be fine". He was right. That system is running 24/7 since then.

Good to see that the guide is still being updated.

edit: typo

gspr 2021-02-11 11:56 UTC link
I had the most wonderful déjà vu the other day. I needed to do some serious-ish network programming for the first time in 20 years. I googled around a bit for a refresher. What do I find? Beej's guide – the same Beej's guide that was my first introduction to the topic 20 years prior!

It was wonderfully poetic to me that the same document that taught me how to make a wildly dangerous IRC bot in my teenage room for the lulz also re-taught me the stuff I needed to deliver a low-latency ML offloading demo at my serious(-ish) job 20 years later. Gave me a real warm fuzzy feeling :-)

PS:

HN disucssion anno 2015: https://news.ycombinator.com/item?id=9445692

Anno 2017: https://news.ycombinator.com/item?id=13983212

majke 2021-02-11 12:14 UTC link
I attempted to write something for more advanced audience. Not sure if it's a successful attempt though...

https://idea.popcount.org/2019-11-06-creating-sockets/

https://idea.popcount.org/2019-12-06-addressing/

folex 2021-02-11 12:43 UTC link
Strangely no mention of High Performance Browser Networking https://hpbn.co

I also would mention Distributed systems for fun and profit http://book.mixu.net/distsys/ while being not exactly about network programming, it is likely a next step for anyone who's building apps that is scattered across several backends/services connected by the network

quake 2021-02-11 12:54 UTC link
I love this guide!

My first job out of university reqiured networking a small Linux device to an FPGA running a UDP stack, with nothing else. I'd never done anything with networking in C before, and this guide just made everything click

jjice 2021-02-11 13:31 UTC link
One if the best guides/books on programming I've ever read. This taught me the foundations of network programming and the fact it's available for free is incredible. I just took a second and ordered the paperback right now because of how fantastic it is.

Aside from the book being really in-depth and understandable, Beej adds in quite a bit of humor and that is something I love in a good software book.

stiff 2021-02-11 14:06 UTC link
Production failures due to bugs in both TCP-based servers and clients happen all the time, long time ago I invested a little time to learn basic socket programming in C and the ROI on this has really been spectacular. "Unix Network Programming" by Stevens is a great book on this topic, in particular it carefully discusses all the different ways things can go wrong. Wish there was something more up to date that could be recommended, but I don't know anything of comparable quality, so I think you still have to read it and later work out all the Linux-specific details, more modern APIs like epoll etc.
icare_1er 2021-02-11 14:18 UTC link
This one and "Programming from the gound up" [https://download-mirror.savannah.gnu.org/releases/pgubook/Pr...] are the two bibles i used and often go back to.
yrgulation 2021-02-11 14:40 UTC link
To anyone writing tutorials or guides, this is the gold standard - at least for me. After many years I still remember writing my first tcp client following this tut. I wish more content would be as focused and concise as this.
trillic 2021-02-11 15:07 UTC link
Beej's guide got me through my networking class in college. As a result I actually understand networking. Thank you Beej!
petejames 2021-02-11 16:27 UTC link
Beej is a Lambda School instructor. He taught me CS.
udev 2021-02-11 16:32 UTC link
I have special warm feelings for Beej's guide.

I remember particularly enjoying the warm and jovial tone in his guide.

I first read through it some 20 years ago while being a student in an easter-european university, where the tone and style of professors was very "dictatorial", dry, and overly-technical.

Beej's style of exposure was a breath of fresh air, and brought a major realisation for the then young-me, that you can teach complex topics in a friendly manner.

macksd 2021-02-11 17:02 UTC link
This "Beej" fellow is a legend. This is an example of very clear documentation that scales well with your level. When I was learning C/C++ as a teenager, I found the guides to be very accessible. They were recommended all the time to people asking questions on cprogramming.com forums. As I've referred back to them as a professional I still find them comprehensive and helpful. This is an excellent model and level of quality for other technical writers to aim for.

Brian Hall: thank you!

armadsen 2021-02-11 19:01 UTC link
I had the privilege of working with Beej for a couple years at my last job. He was one of my favorite coworkers I've ever had. Just great to be around and work with. Incredibly sharp, but also humble, easygoing, and eager to just solve problems.
beej71 2021-02-11 19:49 UTC link
All your kind words are literally bringing tears to my eyes--thank you!

My current plan is to keep writing freely-available guides for as long as I can reach the keyboard. And maybe even longer with what will undoubtedly be awesome futuristic speech recognition--or mind-reading! That's not scary at all!

I'm leaning on bash/zsh scripting one I finish the utterly gigantic C guide I'm on now... hopefully later this year. But I'm always open to suggestion for topics... :)

idolaspecus 2021-02-11 20:35 UTC link
It sounds like Beej needs to write a "Beej's Guide to Writing Guides".
ajarmst 2021-02-11 23:54 UTC link
A couple of decades ago, I spent a few years teaching an introduction to network programming using C on an embedded board running uCLinux for Network Engineering students. While my primary text was Stevens, Beej's guides were an invaluable secondary reference for my students. There were many, many occasions where students who were were having difficulty understanding my explanations could recover using Beej's approachable, application-oriented notes. Eventually, I found myself frequently abandoning my own notes and just lecturing from Beej's work. I miss the days when I still worked with students that close to the metal, helping them build their own network devices. Thanks for the reminder of a time I still have fond memories of.
KuiN 2021-02-11 11:57 UTC link
Same here, my first job out of university was network programming on embedded Linux and Beej's guide was an invaluable resource.
gspr 2021-02-11 12:03 UTC link
I thought I'd add: I know that this is a very normal thing in some sense. Many textbooks remain relevant for decades and decades (I'm a mathematician, we know this perhaps better than most). But still, it's rarely the case for an online document – one about computer technology even more so!
frr149 2021-02-11 12:27 UTC link
That's three volumes... Anything shorter you can recommend?
jcrubino 2021-02-11 12:50 UTC link
Beej's is the classic of classics.
Person5478 2021-02-11 13:17 UTC link
Same for me only it was mid to late 90's and I was interested in understanding MUD code.

I have fond memories of that guide and it's always a treat when it pops back up.

wdb 2021-02-11 13:36 UTC link
Yes, I used the guide in 2006 I think or it at least looks similar. I had used it to write a little webserver in C to talk between the Flash UI and the internals of the device. Worked well :)
justin66 2021-02-11 15:38 UTC link
If that book is as good as you say, it's a pity he published with Packt. Their stuff is typically very bad.
astrobe_ 2021-02-11 17:24 UTC link
Maybe it's just me but it took a long time before I found another "big" API as horrible as BSD sockets is.

Well, some APIs are not meant to be used directly, but hidden behind a class or more application-specific functions.

toast0 2021-02-11 19:26 UTC link
> It was wonderfully poetic to me that the same document that taught me how to make a wildly dangerous IRC bot in my teenage room for the lulz also re-taught me the stuff I needed to deliver a low-latency ML offloading demo at my serious(-ish) job 20 years later. Gave me a real warm fuzzy feeling :-)

My experience with CTCP flooding large channels channels and causing netsplits in my youth provided a perfect base of understanding for when my production servers started flooding status updates to each other and couldn't stay connected.

PS sorry, undernet admins and users. Also, thanks to the admin on #quebec who asked me to flood his channel so he could tune his bot to block flooders.

beej71 2021-02-11 19:50 UTC link
The feeling is mutual!
aynsof 2021-02-11 19:58 UTC link
Your guide single-handedly got me through network programming in C at university. This was back in the early 2000s. Thank you! And I'm so happy to see your guide still getting updated.
legerdemain 2021-02-11 20:05 UTC link
Wait... the Lambda School that's constantly on HN for its disgruntled students, questionable success rates, and murky financials? What possessed beej to associate his name with them?
daotoad 2021-02-11 20:11 UTC link
> while being a student in an easter-european university, where the tone and style of professors was very "dictatorial"

I know it's just I typo, but now I have an image stuck in my head of a large rabbit, dressed up like Mussolini, lecturing about computer science.

Beej's guide was so amazingly helpful and welcoming when I found it over a decade ago.

Poorly written guides that try to be friendly or conversational are often worse than dry and terse guides of similar caliber, which really makes me appreciate the good and truly great ones.

And Beej's Guide is a truly great one.

paraboul 2021-02-11 20:31 UTC link
Your page was what bring me into "magical" programming as a teen 20 years ago. Being able to communicate with a remote program on a free shell and actually understand how it works was the best feeling.

This indirectly shaped my life in many ways. Thank you!

ColinWright 2021-02-11 22:01 UTC link
When was the first edition? I feel like I remember using it in the early 90s ... maybe 1991? The mods have put the dates "1994-2020" in the title, but I feel like I remember it from earlier than that.

Edit:

OK, on 2003/07/06 15:11:16 the wayback machine captured Version 1.5.5 (13-Jan-1999). At the end it says:

Copyright © 1995, 1996

Hmm.

tetrahedr0n 2021-02-11 22:23 UTC link
For the brief amount of time I was your student at Lambda, you made a huge impression. Beyond this tutorial, you're a gifted teacher and inspirational person. Much respect and love!

I'll read your future-brainwave-transmission tutorials, anytime, even if they run the risk of causing minor insanity!

cloudedcordial 2021-02-12 04:10 UTC link
I feel so nostalgic when I read this Beej's Guide. It's a resource that my computer science professor highly recommended back in the early 2000s. The writing is so clear and concise that it's a pleasure to read (as opposed to some dry and technical materials). It's more useful than some textbook that cost hundreds of dollars. It saved me so much time and sleepless nights to figure out how to complete my network programming assignment.

Let me give you a virtual elbow bump! You really made an impact in my academic and professional career!

Editorial Channel
What the content says
+0.70
Article 19 Freedom of Expression
High Advocacy Framing Practice
Editorial
+0.70
SETL
-0.28

The content explicitly advocates for freedom of expression and information through its licensing philosophy. It frames knowledge sharing as a fundamental good ('dying to share the information'), and the author maintains open communication channels for corrections and improvements.

+0.70
Article 26 Education
High Advocacy Practice
Editorial
+0.70
SETL
-0.28

The entire guide is framed as an educational resource. It explicitly advocates for educator use: 'Educators are freely encouraged to recommend or supply copies of this guide to their students.' The content describes itself as a 'tutorial' designed to help learners understand complex material.

+0.50
Article 27 Cultural Participation
Medium Framing Practice
Editorial
+0.50
SETL
-0.24

The content celebrates participation in intellectual and cultural life through FOSS. The dedication section frames the guide's creation as rooted in collaborative culture: 'I dedicate this guide to... the entire Free and Open Source Software Community.' The author acknowledges 'literally thousands of you who have written in with suggestions for improvements.'

+0.40
Article 23 Work & Equal Pay
Medium Practice
Editorial
+0.40
SETL
0.00

The content explicitly empowers readers toward work by teaching technical skills. 'This document should give the average competent C programmer the edge s/he needs to get a grip on this networking noise'—framed as career skill development.

+0.40
Article 29 Duties to Community
Medium Practice
Editorial
+0.40
SETL
-0.22

The content demonstrates community responsibility through the choice to release source code publicly and encourage others to build upon it rather than hoard intellectual property.

+0.30
Preamble Preamble
Medium Framing Practice
Editorial
+0.30
SETL
-0.42

The content explicitly frames its licensing philosophy—Creative Commons with translation exception and public domain code—as a commitment to universal knowledge sharing and removal of artificial barriers.

+0.30
Article 1 Freedom, Equality, Brotherhood
Medium Framing Practice
Editorial
+0.30
SETL
-0.42

The content frames all learners as equals in dignity; no hierarchy or stratification of access based on identity, credentials, or demographic status.

+0.30
Article 17 Property
Medium Practice
Editorial
+0.30
SETL
-0.42

The content treats source code as shared intellectual property by releasing it to the public domain, rejecting proprietary ownership models.

+0.10
Article 2 Non-Discrimination
Medium Framing
Editorial
+0.10
SETL
-0.45

The content does not explicitly discuss discrimination or protected characteristics, but the framing implicitly treats all programmers as worthy of instruction regardless of background.

ND
Article 3 Life, Liberty, Security

Not engaged with provided content

ND
Article 4 No Slavery

Not engaged with provided content

ND
Article 5 No Torture

Not engaged with provided content

ND
Article 6 Legal Personhood

Not engaged with provided content

ND
Article 7 Equality Before Law

Not engaged with provided content

ND
Article 8 Right to Remedy

Not engaged with provided content

ND
Article 9 No Arbitrary Detention

Not engaged with provided content

ND
Article 10 Fair Hearing

Not engaged with provided content

ND
Article 11 Presumption of Innocence

Not engaged with provided content

ND
Article 12 Privacy

Content teaches socket programming without explicit engagement with privacy considerations, encryption, or secure communication practices.

ND
Article 13 Freedom of Movement

Not engaged with provided content

ND
Article 14 Asylum

Not engaged with provided content

ND
Article 15 Nationality

Not engaged with provided content

ND
Article 16 Marriage & Family

Not engaged with provided content

ND
Article 18 Freedom of Thought

Not engaged with provided content

ND
Article 20 Assembly & Association

Not engaged with provided content

ND
Article 21 Political Participation

Not engaged with provided content

ND
Article 22 Social Security

Not engaged with provided content

ND
Article 24 Rest & Leisure

Not engaged with provided content

ND
Article 25 Standard of Living

Not engaged with provided content

ND
Article 28 Social & International Order

Not engaged with provided content

ND
Article 30 No Destruction of Rights

Not engaged with provided content

Structural Channel
What the site does
+0.80
Article 19 Freedom of Expression
High Advocacy Framing Practice
Structural
+0.80
Context Modifier
ND
SETL
-0.28

The site actively enables freedom of expression through multiple structural mechanisms: public translation permitted, open mirroring allowed, source code public domain, content available without censorship or gatekeeping, communication channels open for feedback.

+0.80
Article 26 Education
High Advocacy Practice
Structural
+0.80
Context Modifier
ND
SETL
-0.28

The site removes all barriers to educational access: free online, no registration, no paywall, explicitly distributable to students. Encourages translation for multilingual education. Open mirroring enables global educational distribution.

+0.60
Preamble Preamble
Medium Framing Practice
Structural
+0.60
Context Modifier
ND
SETL
-0.42

The domain structure enables free, unrestricted access; mirroring and translation are explicitly permitted and encouraged; no paywall or registration barrier.

+0.60
Article 1 Freedom, Equality, Brotherhood
Medium Framing Practice
Structural
+0.60
Context Modifier
ND
SETL
-0.42

The site structure enables equal access regardless of geography, language, identity, or economic status; mirroring and translation remove barriers that would create hierarchical access.

+0.60
Article 17 Property
Medium Practice
Structural
+0.60
Context Modifier
ND
SETL
-0.42

The site structure enables unlimited copying, modification, and redistribution of code; no licensing restrictions on reuse or derivative works.

+0.60
Article 27 Cultural Participation
Medium Framing Practice
Structural
+0.60
Context Modifier
ND
SETL
-0.24

The site enables cultural participation by accepting translations, improvements, and derivatives. Public domain code enables others to participate in and build upon the intellectual work. Open feedback channels invite community participation.

+0.50
Article 2 Non-Discrimination
Medium Framing
Structural
+0.50
Context Modifier
ND
SETL
-0.45

No structural mechanisms for discriminatory access detected; the site applies identical terms to all visitors.

+0.50
Article 29 Duties to Community
Medium Practice
Structural
+0.50
Context Modifier
ND
SETL
-0.22

The site structure fulfills community responsibility by enabling distribution and derivative use. Public domain dedication prioritizes communal benefit over individual control. Mirroring permission enables others to disseminate and maintain the resource.

+0.40
Article 23 Work & Equal Pay
Medium Practice
Structural
+0.40
Context Modifier
ND
SETL
0.00

The site structure enables work readiness by providing free, skill-building education. No barriers prevent practitioners from learning network programming skills required for professional practice.

ND
Article 3 Life, Liberty, Security

No structural elements detected

ND
Article 4 No Slavery

No structural elements detected

ND
Article 5 No Torture

No structural elements detected

ND
Article 6 Legal Personhood

No structural elements detected

ND
Article 7 Equality Before Law

No structural elements detected

ND
Article 8 Right to Remedy

No structural elements detected

ND
Article 9 No Arbitrary Detention

No structural elements detected

ND
Article 10 Fair Hearing

No structural elements detected

ND
Article 11 Presumption of Innocence

No structural elements detected

ND
Article 12 Privacy

No privacy-related structural features evident from provided content

ND
Article 13 Freedom of Movement

No structural elements detected

ND
Article 14 Asylum

No structural elements detected

ND
Article 15 Nationality

No structural elements detected

ND
Article 16 Marriage & Family

No structural elements detected

ND
Article 18 Freedom of Thought

No structural elements detected

ND
Article 20 Assembly & Association

No structural elements detected

ND
Article 21 Political Participation

No structural elements detected

ND
Article 22 Social Security

No structural elements detected

ND
Article 24 Rest & Leisure

No structural elements detected

ND
Article 25 Standard of Living

No structural elements detected

ND
Article 28 Social & International Order

No structural elements detected

ND
Article 30 No Destruction of Rights

No structural elements detected

Supplementary Signals
How this content communicates, beyond directional lean. Learn more
Epistemic Quality
How well-sourced and evidence-based is this content?
0.73 low claims
Sources
0.8
Evidence
0.8
Uncertainty
0.7
Purpose
0.9
Propaganda Flags
No manipulative rhetoric detected
0 techniques detected
Emotional Tone
Emotional character: positive/negative, intensity, authority
measured
Valence
+0.3
Arousal
0.3
Dominance
0.4
Transparency
Does the content identify its author and disclose interests?
0.85
✓ Author ✓ Funding
More signals: context, framing & audience
Solution Orientation
Does this content offer solutions or only describe problems?
0.68 solution oriented
Reader Agency
0.8
Stakeholder Voice
Whose perspectives are represented in this content?
0.50 3 perspectives
Speaks: author
About: learnerseducatorsprogrammersstudentsWindows usersLinux users
Temporal Framing
Is this content looking backward, at the present, or forward?
mixed unspecified
Geographic Scope
What geographic area does this content cover?
global
Complexity
How accessible is this content to a general audience?
technical high jargon domain specific
Audit Trail 1 entries
2026-02-28 13:35 eval Evaluated by claude-haiku-4-5-20251001: +0.51 (Moderate positive)