HNHacker News
TopNewBestAskShowJobs

msaltz

506 karma · joined April 3, 2017

Software engineer interested in machine learning and distributed systems
submissionscomments
msaltz··on C for All
In my opinion, what C is lacking isn’t primarily language features - it’s: 1) a common, readable style standard that people can agree on 2) modern agreed-upon idiomatic ways to write readable and safe code. There are certainly common C idioms but many exist for historical reasons and not because they’re necessarily the best things to do, and 3) a standard library that exemplifies the above two things, provides common functionality needed between projects, and fosters a sense of community

Efforts like those of the poster don’t really address these things.

When I tell people I like C, the response differs depending on experience level. Less experienced people who haven’t spent time in C++ either will say “Gross, pointers”. People used to C++ will say “what about templates and constructors/destructors”, and “are you going to write your own library for vectors and maps every time?” And people who are experienced (more experienced than me) and like C have generally said that the main things they miss from C++ are constructors and destructors (and mostly destructors), and templates (but only for container types), but that they can live without them.

C is a small language that can be relatively easy to write (once you pick/write a suitable stl-equivalent), and extremely easy to read (and to the extent that you can look at a line and know exactly what’s going on under the hood). IMO it should stay that way.

Take a look at zproject [0] for what I think is a good effort to standardize C style and project structure. Even if you disagree with the particular design choices, the spirit of it is what I think is needed to keep people from just assuming C is for dinosaurs.

[0] https://github.com/zeromq/zproject/

msaltz··on Ask HN: Best way to learn modern C++?
One of the trickier things about C++ for me (in terms of “getting lost”) when I first started was that there’s no standard C++ project structure. It varies based on the build system you use, whether what you’re building is just an API or something else, and personal preference. I recommend looking at some open source C++ projects like Tensorflow (Google), LevelDB (also Google), folly (Facebook), MongoDB, and Thrill (a Spark clone in C++, https://github.com/thrill/thrill). Also pick your own projects you’re interested in. Take a look at basic tutorials for build systems like make, CMake, and Bazel. Hopefully that’ll give you an idea of what a modern C++ project actually looks like, and will help you start your own.

For books I’d like to add to the current top comment (may go away) API Design for C++. It’s a great reference on exactly what it sounds like.

msaltz··on The Problem of Doctors’ Salaries
One thing not mentioned is the cost of medical school (both in time and money) in the US vs. other countries. I’d imagine that a decrease in doctors’ salaries in the US could cause a significant drop in the number of people willing to spend the amount of time and money necessary to become a doctor. If we want to decrease the pay to match other countries, I think we’ll also need to decrease the investment required to become a doctor in order to maintain a reasonable level of supply.
msaltz··on Ask HN: How do I switch from being a passive consumer to an active producer?
I was having similar thoughts/issues lately (a couple months ago), and I came up with a way to be more systematic about achieving goals, etc. I wrote about it here: https://hackernoon.com/an-agile-approach-to-life-7bb2e9ccbc8...

Tldr; Think of myself as a product, and try to use a sort of agile development style to improve myself. I assign myself "sprints" (one or two at a time, one to two weeks each) and basically during my free time when I think "What should I do now?" I just do the sprint and it takes the pressure off. I've still been doing it since I wrote the above post and it's been working pretty well. I've read 5 novels in the past two months or so (EDIT: for context, more than I'd read in the past year), and I've tried a variety of what I call "personal sprints" that include things like "Wake up at the exact same time for two weeks", or "Say yes to all invitations for things for two weeks". I sort of have the mentality now that "The sprint is the law" and it's helped me have a level of discipline that I haven't achieved in the past. It's really fun because it's low pressure and experiment-based ("Let's try making excessive eye contact for a week, lol") and if something doesn't work out, you didn't spend much time doing it anyways.

Another less related thing is that I read that habit forming is sort of like a muscle, and once you form one habit, it can become easier to form others. So for a little while I was doing habit "layering" where I'd have a priority list for habits and basically as long as I did the top thing on my list, I was happy, even if I didn't get the others. Gradually I moved to the top two things, and so on.

Hope that helps.

← PreviousPage 2 of 2