Logo

dev-resources.site

for different kinds of informations.

[Book Review] Beej's Guide to Network Programming

Published at
7/13/2024
Categories
computerscience
socket
c
Author
uponthesky
Categories
3 categories in total
computerscience
open
socket
open
c
open
Author
10 person written this
uponthesky
open
[Book Review] Beej's Guide to Network Programming

Intro - what is this book about?

Yes, I finally finished reading this book.

As a person who has never taken a computer networking course in university, I had thought for a long time of learning that subject intensively. However, I could not find a solid university course that is open to public(something like MIT’s introduction to algorithms). And many of the textbooks prefixed “introduction” spent hundreds of pages explaining quite low-level concepts such as routing algorithms or even physical wires that connect the continents!

Then I found Beej's Guide to Network Programming that is recommended frequently on the Internet. At a glance, I found it easy to read because of the author’s way of explaining concepts in a humorous manner. But at the same time, compared to other computer network books, this book contains many code examples, so that I thought it suits more for the programmers who want practical socket programming practice.

And after reading through all the chapters except chapter 9(because it is more like a reference for a bunch of C socket functions), I found it a good read.

Good parts

Friendly introduction to technical concepts

The book starts with a few basic concepts such as IP, port, and socket. However, it doesn’t go deeper into introducing very technical algorithms or physical devices used for network communications. As a developer who deals with web applications daily, I found it more relevant to my job. Even though the book sometimes mentions bits and bytes, it is still readable and you usually never do any bitwise operations while reading the C code in the book.

Plenty of code examples

For those who want to get their hands dirty with code, this book is for you. Except for the general overview parts on computer networking, most of the explanations in the book come with code examples in C. This is particularly useful for knowing how actual network communications occur inside our web applications. For example, the polling operation sweeps through all the registered sockets to check whether there are incoming events to be handled.

Moreover, the examples don’t import any external libraries, so you don’t have to deal with irritating third-party dependency problems.

Soso parts

Mainly focused on socket programming only

This book is very good as a friendly reference to socket programming and relevant system calls. However, it does not go “higher” or “lower”:

  • "higher": Most of today’s web applications rely on the HTTP protocol. It could have been better if the book contained more explanations on this higher layer with actual running code.
  • "lower": I think the book could have shown how a packet looks like using tools such as Wireshark that snatches packets generated by the examples. Introducing a few Linux/Unix commands for networking could also have been helpful for understanding how our application code interacts with the kernel.

However, I found another good resource written by the same author: Beej's Guide to Networking Concepts. It seems to cover many core concepts more comprehensively than this book with a lot of coding exercises. I hope this “concept” book will fill the gap of the “programming” book.

Not recommended for those who are not familiar with C code

If you don’t know much about C programming, this book could be overwhelming. It doesn’t explain any basic concepts such as pointers or type casting. Although we don’t suffer from dependency hell like when dealing with CMake, if you don’t know much about C then reading code would still be difficult.

Personally I am okay with C code. However, the book could have been more beginner-friendly if it were written in Python, which has almost all the counterparts of the socket functions of C in its socket library. The "concept" book by the same author uses Python this time, so we can expect some fun there.

Conclusion

Overall, the book is filled with practical code examples that are useful when understanding a network application using socket system calls. Of course, you won’t really need to use these functions when writing your own application, because many languages support their own wrappers for those "low-level" socket networking functions(Python has libraries like socketserver and http). Nonetheless, I think once in your career as a developer you should understand what is going on behind all these highly abstracted communications using HTTPS or websocket. In that sense, this book is a good read and also a good reference.

socket Article's
30 articles in total
Favicon
Getting Started with Web Sockets in Node.js
Favicon
Realtime Location Tracker & Communications
Favicon
Building an Event-Driven Socket Server in Python
Favicon
Creating an IoT Device Frontend: A High-Level Overview
Favicon
🔥 Building a Real-Time Chat App with Sockets in Next.js 💬
Favicon
Real-time notifications with React and Socket-IO
Favicon
How to Use Socket.IO to Build Your First Multiplayer Tic-Tac-Toe Game
Favicon
Enhance your Retool application with real-time chat functionality using a custom component!
Favicon
Building a Skribbl.io Clone: From Concept to Completion
Favicon
Real-Time Features in MERN Applications
Favicon
Building a Real-Time Video Chat App with WebRTC, Socket.io, Node.js, and React .
Favicon
Chat Server in Ruby Sockets
Favicon
[Book Review] Beej's Guide to Network Programming
Favicon
Networking and Sockets: Syn and Accept queue
Favicon
Networking and Sockets: Endianness
Favicon
Getting Started with Networking and Sockets
Favicon
Let's Dive into the World of Web Sockets: A Beginner's Guide
Favicon
Building Real-Time Views Component: A Socket.IO and Next.js Tutorial
Favicon
Full Stack Chat App with Socket.io
Favicon
Multiplayer Checkers game made with PhaserJS, ReactJS, NestJS, SocketIO
Favicon
Exploring ChronoSocketHub: A Comprehensive Real-time Communication and Job Scheduling Solution for Node.js
Favicon
Azure SignalR no .NET 8
Favicon
Connection io socket is not showing in console
Favicon
Use socket.io in react native with nodejs server
Favicon
A Full Stack Chatting App using Socket.io
Favicon
How can I use remote control with Fire TV without ADB in IOS
Favicon
Sockets for real-time data flow with Django Rest Framework
Favicon
Visualized radio-streaming w/ React/Vite/Node/Socket.io
Favicon
Golang CLI-based Socket MultiChat Tutorial
Favicon
Building Interactive Real-Time Apps with Socket.IO in Node.js:

Featured ones: