Recent submissions

Comment · 1 year ago
Comment · 1 year ago
I highly recommend Zed Shaw's "Learn C the Hard Way": https://learncodethehardway.org/c/

I worked through this and felt well-prepared to actually use C in anger when I had to.

Comment · 5 years ago
Really really love Antora. I've been pushing hard for it for internal docs -- one very nice attribute is that it can collate docs from multiple Git repos. This way, you can have documentation close to the code, like I want as a developer, while having a single "documentation site" like most management and non-technical users want.
Comment · 5 years ago
You are correct, will edit. C is hard, writing C in the browser sans coffee is harder. :-)
Comment · 5 years ago
It's a very common pattern for C memory allocation checking. A public example I know off the top of my head can be seen here: https://github.com/zedshaw/learn-c-the-hard-way-lectures/blo... (the implementation of the CHECK macro). That's in a C tutorial but I've implemented a version of that macro frequently.

Let's say you need to dynamically allocate two buffers in a function and want to make sure they are freed at the end of your call. You can use this macro like so:

  int two_bufs(int n, int m) {
    int *buf_1 = NULL;
    int *buf_2 = NULL;
    buf_1 = calloc(n, sizeof(int));
    CHECK(buf_1);
    buf_2 = calloc(m, sizeof(int));
    CHECK(buf_2);
 
    // ... lots of cool things with buf_1 and buf_2

  error:
    free(buf_1);
    free(buf_2); // Safe if null

  }
Comment · 5 years ago
Comment · 5 years ago
You aren't! I'm a state-school bachelor's-only don't-even-have-a-CS-degree person; neither of my parents have a 4-year-degree. I had a FAANG job, left it for a better one, own a house in 2/5 of the most expensive cities of the world, etc., etc.

Elitist assholes definitely exist everywhere, but in my experience a lot of what I viewed as "showing off" when I was younger was really just "being normal" for a different "normal". When a 25-year-old software developer talks all the time about Stanford and Lambos, he's not trying to show off, he's just talking about what he knows, just like the guy talking about tail-gating at <insert SEC school here> and then going four-wheeling all the time.

I don't want to devalue experience and education in any way; those things have value! But time is linear and the past has happened -- you just have to move forward with what you have and go after what you want, and don't get distracted by the fact that others started out with a lot more than you. I double-pinky-promise you that if you are good at something, keep getting better at it, and aren't an asshole yourself, you can work at any company you want. :-)

Comment · 5 years ago
100% true for me as well -- I found the Illuminatus Trilogy via reading the Jargon File when I was an embryonic techie oh so long ago and that whole scene has been super-influential on me ever since.
Comment · 5 years ago
Sure! The "core" I mentioned above talks about the common psychological concepts of Id, Ego, and Superego (and more), and analogises them to separate processes running on your brain's processor, with a "layered approach". Lower-level processes have a higher interrupt priority. For example, fight-or-flight happens at a subrational level, and therefore "rational" thinking won't change the way you handle a fight-or-flight response, since the triggering of that response inherently interrupts your rational thought-loop.

I'm not saying that this is literally correct -- the brain is way more complicated than that! But I find it quite useful as a metaphor for processing and understanding social dynamics that I inherently find "irrational".

Comment · 5 years ago
I'm reluctant to even mention it, but I'll bite. :-)

I found the first half of "Prometheus Rising" by Robert Anton Wilson to be incredibly useful for understanding human dynamics -- I use the framework presented there every day. The core of this is in my opinion just a very straightforward computer-focused analogy that gives me insight into the behaviour of other people and myself that I haven't found elsewhere.

Of course, outside the core is a LOT of wild new age, Crowley-Leary-Regardie syncretism that provokes strong negative throw-the-book-across-the-room reactions in most people. A lot of very reasonable people would look at the wikipedia page or the cover of this book and not only think that the book is crap, but also that I'm a crazy hippie for even considering reading it.

Comment · 5 years ago
I personally left my FAANG role behind for a role that had way more of what I wanted to do (coding) and way less of what I hated (paperwork), and it was one of the best decisions I've ever made in my life.

I think it's important to keep in mind "signal bias" -- I'm never on other social media, and I'm only on HN every weekday over my breakfast and morning coffee. I don't spend time building my brand or writing blog posts or shouting from the rooftops about how great my life is because I'm trying hard to stay busy actually enjoying how great my life is. In my experience, there really are a lot of folks who've made similar decisions, it's just that part of managing your life is also giving up on trying to convince strangers that you're awesome.

Comment · 5 years ago
Disclaimer: I'm an employee of ExpressVPN and work on this codebase.

The specific reason for the size disparity is that we require he_conn->{username,password} to be null-terminated, whereas we do NOT require he_msg_auth->{username,password} to be null-terminated. I remember raising the same point and being convinced that we had a good reason for doing so, but I also haven't had enough coffee to remember what the good reason was!

Regardless of whether this is a "bug" or not I do think that the disparity points to something that unnecessarily causes confusion, will have a think about making it more consistent.

Regarding style -- I also ~hate if(x==0) without the space after the if but we committed to consistency instead of arguing over it via clang-format. To quote Rob Pike, "Gofmt's style is no one's favorite, yet gofmt is everyone's favorite."

Comment · 5 years ago
Hi! I've done work in Sydney from 2011-2013, India 2013-2014, and now Singapore from early 2020 up to today.

Overall, I would say that there's larger gaps between companies than there are internally to countries. Especially in India, I was consulting and definitely spent time on an Infosys campus in Bangalore where they had unscrewed half of the overhead lights to save money, but I also worked with some places that felt more or less like any other high-tech company anywhere else in the world.

Similarly, when I was looking for work here in Singapore, there were definitely folks that were looking to hire folks with 15 years of experience and pay them $80k/year, but there were also several companies that offered high-paying jobs with interesting work. There were definitely FEWER companies, but the flip side is that the hit rate was much higher -- I ended up getting at least a first interview with 70% of the companies I sent my resume to here, as opposed to the 20-25% I generally find in the US. In general, companies are very keen to hire "American" tech talent, especially if you have a "name-brand" on your resume.

In terms of compensation, if you are relocating, you really do have to look at the holistic quality-of-life. I ostensibly took a "paycut" in US$ terms from my Google NYC job for my role here in Singapore, but I also went from a tiny 2 bedroom apartment and a 45 minute subway ride to a 3 bedroom walking distance to work with a full-time nanny who works 6 days a week, cleans, and cooks in addition to watching our two kids.

Living "overseas" has been a great joy in my life -- I may end up back in America for some time but I also see myself living elsewhere for as much or more time. I can't recommend it enough -- the world is a pretty incredible place!

Comment · 5 years ago
Comment · 5 years ago
One use case that I'm really excited about considering this for is testing! I'm currently working on a project that uses a very straightforward C style and for the mainline processing we don't see a lot of duplication problems and aren't using macros much at all. However, as we try hard to get high unit test coverage I often find myself doing "macro magic" in my tests to remove boilerplate, and I'm excited to try out this tool to make our tests more awesome.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton