Matt Sh

matt.sh · Personal blog · on HN since 2013

Matt Sh writes about C programming style, Redis internals, job searching, and his experiences as a software engineer.

What HN saysHN commenters link his C style guide as being covered by CS:APP, and discuss his "$220k/year intern" story and Redis data structure posts.
50HN people shared it
23linked it in comments
41stories submitted
4.0Kstory points
2 years agolast shared
2013people per year2026

Most-shared posts

  1. 1
    How to C in 2016
    13 people · 1.1K points · first shared 2016 · 581 comments on HN
  2. 2
    Resume
    4 people · first shared 2024
  3. 3
    Panic at the Job Market
    3 people · 1.7K points · first shared 2024 · 1.6K comments on HN
  4. 4
    Redis Geo
    3 people · 243 points · first shared 2014 · 58 comments on HN
  5. 5
    Job Search 2013 Edition
    3 people · 11 points · first shared 2014 · discussion on HN
  6. 6
    How I survived being a $220k/year intern
    2 people · 429 points · first shared 2018 · 184 comments on HN
  7. 7
    Improving Redis CRC performance
    2 people · 112 points · first shared 2014 · 38 comments on HN
  8. 8
    Replacing 90s C Linux Utilities with Python
    2 people · 4 points · first shared 2018 · discussion on HN
  9. 9
    The Matt Curve
    2 people · 2 points · first shared 2023 · discussion on HN
  10. 10
    Redis as JSON document store
    2 people · 1 points · first shared 2014 · discussion on HN
  11. 11
    APFS Object Map Recovery
    2 people · 1 points · first shared 2022 · discussion on HN
  12. 12
    Anatomy of Startup Frauds
    2 people · 1 points · first shared 2017 · discussion on HN
  13. 13
    The most talented person in the world
    1 people · 260 points · first shared 2024 · 151 comments on HN
  14. 14
    Python Practical Package Packing 2024
    1 people · 35 points · first shared 2024 · 35 comments on HN
  15. 15
    Disrupt Tech Interviews
    1 people · 6 points · first shared 2016 · discussion on HN

What HN people wrote when they linked it

quechimba · 2024-04-04
I had an external hard drive that I overfilled by accident while making a manual backup of media files, and after that I couldn't even mount the APFS volume. Apparently it's something that can happen. In the end I was able to mount and rescue the data using https://github.com/libyal/libfsapfs I followed this guide: https://matt.sh/apfs-object-map-free-recovery
Thorrez · 2020-03-08
Also here[1] it's listed with the date 2017-12-16. It's confusing that the article appears to have 3 titles: "Commit. This.", "How I Survived Being A $220k/year Intern", and "A Senior Developer Who Couldn’t Commit Code". Also obviously confusing that the article page itself is undated. [1] https://matt.sh/
hackermailman · 2017-04-13
CS:APP 3rd version you can buy on Abe Books the global edition for $20, then follow this course and watch 'old videos' https://www.cs.cmu.edu/~213/schedule.html Everything in this style guide is covered in CS:APP https://matt.sh/howto-c There's also http://rust-class.org/ and https://www.nostarch.com/Rust
tronje · 2016-04-12
C, to me, requires a lot of discipline about good coding style and conventions. I personally like that a lot, even though, of course, it sometimes causes one to shoot oneself in the foot. But, and I can't point to exactly why, I don't think I want to change anything. Maybe Rust or something new will come along sometime soon to fix all the issues that exist with C. Oh, and for those who haven't seen it, there was a cool guide to writing neat, modern C on here a few months ago. https://matt.sh/howto-c Worth a read in my opinion.
seiji · 2015-02-18
but struggle when a lot of inserts and updates need to happen. I ran across this with Redis recently. Redis has an internal data structure called ziplist that's a doubly linked list with no pointers. It just uses byte offsets to the next element, so all elements are in one contiguous block of memory. It's great because you can store a lot of values compactly without needing 1 to 5 pointers (8 to 40 bytes) overhead per element in your data structure. But, a problem shows up when you want to insert or delete items. Every insert or delete requires expanding or shrinking the entire solid-chunk-of-memory allocation, which isn't the fastest thing in the world when your allocation is large. Also, inserting into the HEAD requires copying the _entire_ ziplist up exactly one element position because the block of your memory layout just changed. So, obviously these things are useful, but their usefulness degrades as your solid blocks of memory hit cache limits. Everything is super fast when your entire ziplist fits in L1, still about the same in L2, worse in L3, and horrible if your ziplist grows any larger. But, what can we do? We can fix the entire problem by creating a traditional linked lists of solid memory block ziplists. Now, each ziplist can remain small (8 KB to 16 KB), and when we grow bigger, we just cut a new ziplist, pointer-attach it to the previous ziplist, and now we have a minimal-pointer, high-locality data structure with unlimited growth potential without…
SamvitJ · 2024-07-18
I'm not sure where you're seeing that in his resume: https://matt.sh/files/a-resume/resume.html
wodenokoto · 2024-07-18
Regarding the meta comment to LLMs, Gemini gave me this incredibly terrible response: ``` Can you summarise this article? https://matt.sh/panic-at-the-job-market I can't help with responses on elections and political figures right now. I'm trained to be as accurate as possible but I can make mistakes sometimes. ``` Co-pilot in Edge, just gave me a summary. No bananas.
tra3 · 2024-07-17
Worked with chatgpt: > You're my buddy that I've known for a while. You're pretty straightforward, no bullshit kinda guy. Can you summarize this for me real quick: https://matt.sh/panic-at-the-job-market
d_burfoot · 2024-07-17
Ironically, the same author has a blog post deploring the evil of Too Much Technology: https://matt.sh/matt-curve
csmpltn · 2024-07-17
To the OP: I'm certain you're an experienced and seasoned programmer, but your CV (on your website: https://matt.sh/files/a-resume/resume.html) is an example of how not to write one. It's a wall of text and fluff, with too much focus on fanciness and design. I hire and interview people all the time, and your CV leaves me with zero sense of the impact of your work - only with the fact that you've done a bunch of stuff over the years... "Designed & Built a Redis Replacement", "nobody really wants to buy it when free worse performing choices exist". Give me a break...
morgante · 2024-07-17
It's absurd. He has no concept of market rates (and frankly I'm unsurprised that he's not getting hired if his expectations are this out of whack). His resume even confirms this[0], because he seemingly thinks the appropriate level at FAANG would be L10 which is extremely rare. There is a 0% chance that his experience would level him that high. The entire article can be chocked up to a massively inflated sense of entitlement. [0] https://matt.sh/files/a-resume/resume.html
trogdor · 2024-07-17
Totally agree about the linked article. I’m less sure about his resume, though: https://matt.sh/files/a-resume/resume.html
suprjami · 2022-12-23
https://www.learn-c.org/ If you have lots of time: https://hal.inria.fr/hal-02383654 If you can't be bothered reading a whole book: https://matt.sh/howto-c Exercises: https://www.codestepbystep.com/problem/list/c and https://exercism.org/tracks/c Once you have syntax and basic algorithms down well, watch this, the only 2 hour YouTube video I'll ever recommend: https://m.youtube.com/watch?v=443UNeGrFoM Both r/cprogramming and r/C_programming are active, also full of lazy students trying to get people to do their homework. If you come by, describe your problem well with code. Say you're learning for yourself, not for school. Together C & C++ is a good Discord if you prefer live chat: https://discord.gg/tccpp
jerrysievert · 2020-03-08
while not a definitive guide, https://matt.sh/howto-c is a good example of how to approach "modern" c. c99 is fully implemented in windows with msvc (2015), gcc, clang, and intel's compiler, so "right way" should not need to involve c89. most are c11 compliant as well.
sn9 · 2018-10-24
K&R C, Hanson's C Interfaces and Implementations, van der Linden's Expert C Programming: Deep C Secrets, Bryant and O'Hallaron's Computer Systems: A Programmer's Perspective, Gustedt's Modern C, and https://matt.sh/howto-c should keep you well covered. You don't need all of the above, but you shouldn't need much more.
sinkholes · 2018-03-24
This series of posts from a former Pivotal employee provides interesting context: https://matt.sh/anatomy-of-a-fraud https://matt.sh/commit-this https://matt.sh/dumb-pivotal-2018
ddorian43 · 2016-10-03
See making crc 4x faster in redis by keeping precommputed values in a lookup table: https://matt.sh/redis-crcspeed Maybe something like that ?
DictumMortuum · 2016-06-05
By the way, a friend suggested this guide, which is really interesting -> https://matt.sh/howto-c
ue_ · 2016-04-12
>https://matt.sh/howto-c I think Keith Thompson's (not related to Ken Thompson) critique of the link you posted is an even better read: https://github.com/Keith-S-Thompson/how-to-c-response
ghrifter · 2016-01-13
Cool, thanks! I have yet to learn C other than from what I've learned from programming in C++. I am really interested in learning some C however, especially after this post hit front page a few days ago: https://matt.sh/howto-c
keyanp · 2015-12-10
Cassandra is optimized for write heavy workloads, inverse to MySQL. It also effortlessly scales horizontally and is designed to do so. The use case is clear and definitely different than that of MySQL. As for the second point, you can store the JSON data in a Redis "hash" datatype: https://matt.sh/introduction-to-redis-data-types Although MySQL also supports in-memory KV storage with (nearly?) constant time lookups (http://dev.mysql.com/doc/refman/5.7/en/innodb-adaptive-hash.html), I think Redis is a bit easier to partition.

Keyboard shortcuts

/Search
j kNext / previous blog
EnterOpen selected blog
vVisit the blog site
fFollow / unfollow
lSwitch grid / list view
dSwitch dark mode
g hHome
g pTop posts
g tTopics
g fFollowing
g lLiked
g yHistory
g qFAQ
EscBack / close