Hacker News new | ask | show | jobs
by itsmemattchung 1431 days ago
Two recommendations:

  1. Switch to a team (or company) where they are developing in the language you want to learn. 
  2. Work through the book "Computer Systems: A programmer's perspective"
Nothing beats daily programming in said language on a daily basis. Similar to yourself, I was predominately writing in higher level interpreted languages. Although I did teach myself C by working through books, writing programs and more, it was not until I started writing C on the job that really accelerated my learning. Very quickly, hit my fair share of segfaults ... discovered that we never called malloc (i.e. allocating memory on the heap) during runtime, stepped through our mark-and-sweep algorithm.

As for the book recommendation, it will cover all the above topics you are interested in such as heaps, stacks, memory management, etc. There are lots of other books that I studied during my CS education but self studying "Computing Systems: A programmer's perspective" really switched a light bulb on in my head.

2 comments

Thanks. I really like the first approach.

Now that I work as half data engineer and half infra (cloud). I do have a few hobby projects using C/C++ (e.g. embedded for C and game programming for C++), but nothing really completed and polished. How do I convince someone to give me a job to work on low level systems, even as a junior?

Should I continue working on low level projects and hopefully they are good enough, or there are other approaches?

TBH I'm willing to do free part-time work on sys programming if given the chance, but industry doesn't work like this.

>How do I convince someone to give me a job to work on low level systems, even as a junior?

>Should I continue working on low level projects and hopefully they are good enough, or there are other approaches?

The way i had done this in the past was to really learn the language well (today you will also have a GitHub repo of projects to show), practice algorithms/data structures/interview questions in C/C++ and finally, understand the tight coupling between C/C++ and underlying OS i.e. "Systems Programming". This is the preparation phase.

In the execution phase, you contact companies/recruiters/friends/anybody at all with suitable openings and make it very clear that you really really want the job even if it means taking a pay cut i.e. Salary/Money should not be the goal. Make it clear and open that you are looking for a break into that domain and you are willing to put in any Time and Effort reqd. Finally, try smaller companies rather than big ones at first; their requirements are less strict.

HTH

Thanks! That looks very good and right on my study path. I'm glad that the preparation phase can be prepared by some CS courses.
For "Embedded C" you absolutely need this : https://www.safetty.net/publications/pttes

PS: You may find other helpful recommendations in my comment history.

Thanks! That looks very interesting. I'll also browse your previous comments.
Can get my hands on the 2nd edition for cheap, or is the 3rd edition required? It's quite expensive.
I have all three editions. The 1st one is 32-bit only, the 2nd covers both 32 and 64-bit and the 3rd is 64-bit only.

If you can, buy the 3rd edition (this is one of the few books worth its price) and then pickup the 1st edition for cheap/free from somewhere. Try for Used/Secondhand copies to save money.

There is a lot to learn from the book; all of them necessary for a beginner to connect the dots and get the full picture. So don't get stuck on any one chapter/problem but make sure to cover all the chapters in sequence skipping over unnecessary details in the first couple of passes. As an example you don't need to know the nitty-gritty of PIC/GOTs/PLTs/Assembly minutiae etc. in the beginning but just understand the concepts of Relocatable code and Executable vs. Shared Object files.

The authors have written up a summary [0] of the differences: in short, 3e reflects the changes in typical computer hardware over the last decade or two.

Note also that there are two versions of the third edition: the standard edition (colorfully striped shape on the cover) and the international edition (globe made of circuit boards on the cover) which is quite a bit cheaper. The contents of the chapters are the same, but the exercises at the ends of the chapters have been rewritten, by the publisher's lackeys, not by the original authors, for the international edition, very poorly by all accounts.

[0] http://csapp.cs.cmu.edu/3e/changes3e.html

Do the labs too: these exercises are the most valuable. In particular, the binary bomb forces you to really understand the stack, heap, assembly instructions.
1st or 2nd edition is fine