HN user

davidwf

97 karma
Posts0
Comments44
View on HN
No posts found.

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.

Goto (2007) 5 years ago

You are correct, will edit. C is hard, writing C in the browser sans coffee is harder. :-)

Goto (2007) 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

  }

This is very situational, but I have recently been part of a project that does a lot of C server-side development and we have found that static linking our non-glibc dependencies has really improved our developer experience. Using ceedling's dependency plugin[1] and producing a single "statically" linked library has made our C development much closer to using a language with a more modern package manager. Don't get me wrong, if I was trying to distribute binaries to machines I didn't control I'd definitely be willing to invest in the Linux packaging "fun", but for a server-side application it's been a good choice for our team overall.

[1] https://github.com/ThrowTheSwitch/Ceedling/tree/master/plugi...

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. :-)

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".

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.

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.

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."

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!

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.

There is a fantastic piece on this topic that really resonated with me: https://markfreedman.com/returning-to-development-from-manag... I'll try not to duplicate it too much in my story.

I started out as a Java-by-the-yard consultant, but I was at a "fast-paced" consulting company and so was very quickly given as much responsibility as I could handle, which as it turned out was a lot. I never set out to be a manager as such, but the opportunities were there, and I climbed the ladder and did well w/ external accolades.

At about the decade mark in my career and a location and employer jumps later, I was a manager-of-managers w/ about 75 reports, and making a lot of money, in a highly visible position at my company where I got a lot of support and accolades. And I was miserable! I mean, I can only use that word in hindsight -- it took a lot of introspection to pick apart my circumstances and really dig into what I truly wanted out of life.

I did a serious course correction here -- I did a lot of self-learning to ramp back up on modern coding, and I was very fortune to land a technical (but not "developer") FAANG job. I learned as much as I could there, and even took a (much more junior) management role, but I quickly realised that even at a more "technical" company I was still miserable if I wasn't the one building things.

I'm currently 1.25 years into a GREAT job, and although it's not perfect, I'm delighted every day to open up Vim and write Python, C, and some other fun stuff. It took me nearly 3 years to go from "I think I want to be a developer again" to actually working full time as a developer, but I also stayed employed (and had 2 children!) during that time, so you could certainly make the switch faster if you really wanted to.

Really great in-depth article! At this point in my life I feel like there's such a large amount of content for "beginners" written by people who have only been coding for five years, and a huge dearth of "intermediate" content for people who are adults, and who do know how to code, but who would benefit from being walked through the deeper parts of the language, and this article really fits into that sweet spot for me.

One of the things I love most about games like "Advent of Code" is seeing how other folks go about solving problems! I was personally thrilled that I got the problems done at all given that I was learning a whole new language, but now I'm feeling motivated to try these techniques against my own solutions to see how fast I can get them.

Great article overall but I wanted to add in a recommendation for _Her_ -- I've read it many times and still don't know what happens, but there's something about the act of reading it that transports me to a different, more youthful place every time, and not just in the way that reading other books from my youth does. Highly recommend, and very sad to hear this news.

Wow thank you! I totally missed the "Source code and live demo" button during my first cursory glance through the chapters, but indeed, there it is. :-)

I have to say this looks really cool.

Maybe this is a really dumb question, but as someone who really knows nothing about computer graphics, how can you actually run these examples?

I realize that I could Google and research and find a list of "canvas drawing tools" in a variety of languages that I could then evaluate (despite, again, knowing nothing about graphics), but it'd be SUPER-SUPER-awesome to have a quick note "there are lots of ways to go about making these things happen in the real world, but here's one I recommend if you have no other priors." :-)

Really cool book idea, keen to have a go at it!

I am not a language expert, but Clojure (inspired by CLOS IIRC) does method resolution based on an arbitrary function that can ask any "is it a duck?" question of the arguments:

https://clojure.org/about/runtime_polymorphism

It's common for code to "choose" which method to call based on the class of the arguments, but it's also common to choose which method based on whether a particular key is in the hashmap, etc.

I was in exactly this situation and I actually bought a handwriting book and "re-learned" how to do it by working through the book and focusing on writing with my shoulder instead of my wrist. I saw immense improvement in three weeks or so, and doing handwriting practice was also extremely satisfying and a good mental break after a day of coding.

I used this book, no affiliation other than I liked it: https://handwritingsuccess.com/write-now/

Inspired by this Slate article: https://slate.com/human-interest/2009/09/why-your-kids-have-...

I keep a Google Document of these to share just in case people ask about my YouTube interests.

I Actually Watched All of Them

I have actually watched ALL of the videos on these channels and I don’t even feel bad about it :-) I actually like new videos from some of the ones below (like NativLang, for example) but they maybe don’t hold up in the early videos.

- Space Time: PBS Physics, sooo good -- https://www.youtube.com/channel/UC7_gcs09iThXybpVgjHZ_7g -- Great first video: https://www.youtube.com/watch?v=K8gV05nS7mc

- Lindsay Ellis: Really, really intelligent video essays about film and culture -- https://www.youtube.com/channel/UCG1h-Wqjtwz7uUANw6gazRw -- Great First Video: https://www.youtube.com/watch?v=vpUx9DnQUkA&t=1s

- Periodic Videos: Chemistry, including a video for every element -- https://www.youtube.com/channel/UCtESv1e7ntJaLJYKIO1FoYw -- Great first video (obviously): https://www.youtube.com/watch?v=6rdmpx39PRk

Other Math and Science

- 3Blue1Brown: Amazing math visualizations -- https://www.youtube.com/channel/UCYO_jab_esuFRV4b17AJtAw -- Great first video, how e^pi*i works: https://www.youtube.com/watch?v=v0YEaeIClKY

- NumberPhile: Fun math videos -- https://www.youtube.com/channel/UCoxcjq-8xIDTYp3uz647V5A -- Great first video: https://www.youtube.com/watch?v=wBU9N35ZHIw

- PBS Eons: Biology! -- https://www.youtube.com/channel/UCzR-rom72PHN9Zg7RML9EbA -- Great first video: https://www.youtube.com/watch?v=gMdv3JlPizw

- PBS Infinite Series: Math math math, really really hard math -- https://www.youtube.com/channel/UCs4aHmggTfFrpkPcWSaBN9g -- Great first video: https://www.youtube.com/watch?v=63HHmjlh794

- SciShow: Science! More poppy but fun -- https://www.youtube.com/channel/UCZYTClx2T1of7BRZ86-8fow -- Silly first show: https://www.youtube.com/watch?v=ZELEjE92D-c

-- Actual physics: https://www.youtube.com/watch?v=J4Ej3Q_QquA

- VSauce: Science-y? -- https://www.youtube.com/channel/UC6nSFpj9HTCZ5t-N3Rm3-HA -- Great first video: https://www.youtube.com/watch?v=ktkjUjcZid0

- Practical Engineering: -- https://www.youtube.com/c/PracticalEngineeringChannel -- Great first video: https://www.youtube.com/watch?v=0olpSN6_TCc

Other Humanities

- Alliterative: Connections via language -- https://www.youtube.com/channel/UCG6tBbWzY_ZR4_rd72vp6CA -- Great first video about gin and gimlets: https://www.youtube.com/watch?v=V7jEH6E6l90

- Bon Appetit: Such fun food stuff! -- Gourmet Makes: https://www.youtube.com/watch?v=H2nY7Tu1Qgs -- It’s Alive: https://www.youtube.com/watch?v=zx8pYMkkKXg

- Masaman: Genetics and human migration (and low production values sadly) -- https://www.youtube.com/channel/UC1vVNQN-TCy8d3Mb_Owr2Kw -- Great first video: https://www.youtube.com/watch?v=fc2Qcca8xkE

- NativLang: Animated shorts about language -- https://www.youtube.com/channel/UCMk_WSPy3EE16aK5HLzCJzw -- Great first video: https://www.youtube.com/watch?v=J7vreUPCl9c

- Vox: Never for the news, but for the “other” series -- https://www.youtube.com/user/voxdotcom/featured -- Check out this amazing video about Venezuela and Columbia: https://www.youtube.com/watch?v=NU0RqwweuWY -- Or this video about giant steps: https://www.youtube.com/watch?v=62tIvfP9A2w&list=PLJ8cMiYb3G...

- Cogito!! (No links yet…) -- https://www.youtube.com/channel/UCKMnl27hDMKvch--noWe5CA -- Great first video: https://www.youtube.com/watch?v=1oQ5Jd7p2aY

I have an odd dream to visit Georgia (the country). I know extremely little about it, but the combination of language-geek attraction (Georgian is a totally out there language with its own script) and the absolutely stunning images of everything I see really makes me want to go.

99pi and Changelog are great!

I listen to a lot of podcasts, in alphabetical order:

A Million Little Gods <- Serious but accessible philosophy discussions, Season 2 was an absolutely mind-blowing discussion of "race"

Bundyville <- Limited series about the far-right movement in the western USA

Fandible <- Personal favourite actual-play RPG podcast, geeky but I love it

Freakonomics Radio <- I resisted at first because of the brand name, but the general content is so good.

Functional Design in Clojure <- Exactly what it says, works surprisingly well as a podcast. I really appreciate that it's "intermediate-level", and really focused on "how do you build real software"

Lexicon Valley <- Incredible and well-presented linguistics topics w/ some idiosyncratic music choices thrown in

JS Party <- from the same folks that make changelog. I honestly don't listen to every episode after the change in format after the incredible Season 1, but I stay subscribed and listen when the topic grabs my attention.

Sinica <- I came for the China content, but I stayed because these are the smartest conversations I hear about any topic anywhere.

Software Engineering Radio <- I don't listen to every episode, but it's good when it's good, mentioned by a few other commenters.

Stuff You Missed in History Class <- well worth an archive binge, there's a LOT of fascinating content deep inside.

This American Life <- I still listen even though I don't live in America anymore. :-)

I missed this article in previous rounds, but during your interview with the Changelog regarding RedwoodJS I remembered the anecdote about "writing the tutorial first" and it really stuck with me.

I find this especially useful when I'm building complete solutions from lots of other technologies -- it's easy to fall into the trap of "well my API will behave like API X because that's what I'm using under the hood". Readme driven development really encourages thinking harder and producing something that's greater than the sum of its parts.

My answer is: as much as possible! I willingly took a 50% paycut this year and left my $big_company job to invert the 80% meeting / 20% tech ratio, and it was the best decision professional decision I've ever made.

On a day-to-day basis, there's always going to be a cyclical element -- I just spent two weeks writing code nine hours a day to push through a big feature, and now I expect to spend a week or two on less focused work, catching up on all the things I ignored while I was heads down.

I also try to turn non-code work into coding work. In lieu of doing a BUFD, I'll try to throw together a proof-of-concept or do a spike. Whenever there's a production issue, I try to turn that into a project to eliminate that class of issue. If there's some repetitive administration to do, I try to automate it.