Live data from Hacker News

Ask HN: What should a systems/low-level software engineer know?

news.ycombinator.com

101–110 of 231 posts

Re: Ask HN: What should a systems/low-level software engineer know?

#101
post #39

Earlier quoted context omitted.

A quick word of warning: be sure to treat C and C++ as two completely separate languages that just happen to have similar syntax. Yes, you can use C++ as "C with classes" (I and many others sure have at times), but you're doing yourself a disservice most of the time if you do.

Huh. I always perceived C to be a subset of C++.

C++ is largely backwards compatible to C, but idiomatic code is very different in modern practice between the two. A somewhat dated blog post I wrote on the topic a decade ago:

https://blog.directededge.com/2009/05/21/c-and-c-are-not-the...

Re: Ask HN: What should a systems/low-level software engineer know?

#102

Earlier quoted context omitted.

Maybe look into mainframes such as the i series. You won't experience churn there. And there will be an increasing need for younger developers in this area in the near future as many of the current developers will be retiring. Also, you won't be required to work on pet side projects, push them to Github, blog about them and post Show HN comments to build up street cred for future job interviews. But I have no idea ho…

There's still quite a few local govt that I've worked with that still use AS/400s / iSeries type stuff for all financials. One just bought a brand new one a year or so ago because it was cheaper to buy a new one than replace it with any other system. I learned enough to know when to call IBM for support, but with that experience it wouldn't be too difficult to find another job managing one. I remember 12+ years ago,…

I saw one at Turkey Hill yesterday, with the text banner. The banner was pretty sweet. You'll find them all over the place. I'm pretty sure a lot of places are still using these systems like department stores and whatnot.

Re: Ask HN: What should a systems/low-level software engineer know?

#103

Embedded programing pay sucks compared to the web. I wouldn't do it. Just look at the number of web jobs vs system programmer jobs.

I've done embedded a few times in my career (usually higher level, embedded Linux) though I also did some stuff with PIC microcontrollers for a bit.

The pay sucks, but it is much more enjoyable work than web development. There's a lot less BS to deal with.

Re: Ask HN: What should a systems/low-level software engineer know?

#104

Earlier quoted context omitted.

What. What good programs are written in C that don't have well-structured memory management the way C++ does it with RAII? Edit: "But in reality, why C is still the best programming language for large projects (IMO) is exactly that the programmer is allowed to choose a suitable structure, such that the program can fulfill the technical requirements. Other languages force the project into a structure that somehow neve…

What are your thoughts on D or Rust as they compare to C++?

Rust makes intuitive sense to anybody that knows C++ and Haskell (deeply enough to have seen the ST type constructor). There are some natural, healthy memory management decisions you might make in C++ that you can't do in Rust, but that's life. The obvious example would be if you want one struct member to point into another. I like Rust traits or Go style interfaces over classes. cppreference is far far better than any Rust documentation, which aside from Rust by Example, is an unnavigable mess. Oh, and it would be nice if C++ had discriminated unions.

I don't know enough about D to really comment on it (I read the black book on it 9 years ago, and the examples crashed the compiler), but... it has better compile times, right? There's a module system? I'd have to look at the D-with-no-GC story, figure out how hard it is to interop with C++ API's. I think I'd have better feelings about D (or C++) if it didn't have class-based OOP.

Re: Ask HN: What should a systems/low-level software engineer know?

#106

If your are looking towards embedded: * put a cap between power and ground * get some nice ESD-birkenstocks * don't listen to anybody telling you how it's done The start of the art is BS and we need a revolution. There will be so many people who tell you that you can only do it in C and if you don't, you can't be taken seriously. The result is that everybody is keeping to C and nobody invests time in bringing new ide…

What would putting a single cap directly between power and ground be? Wouldn't that be a short circuit or boom?

A filter cap. It is in parallel to the actual load and once it's charged, there is not current anymore. It only booms when the voltage is to high.

Many chips, like a bluetooth chip, don't draw power continuously, but there are spikes. These spike in current can lead to the voltage dropping to low. A filter cap acts against that.

Sometimes, especially in prototyping circuits, where nobody took care of properly designing a power supply, filter caps are the first cheap shot at fixing weird behavior.

If you wanna know more, google the term, there is way better explanations then mine, form people with way more profound knowledge.

Re: Ask HN: What should a systems/low-level software engineer know?

#107
post #90
post #72

Earlier quoted context omitted.

C enum values are convertible from int; C++ enum values aren't. This is one of the biggest differences in fairly idiomatic C code and has been the case for a very long time (i.e. not dependent on newer C features not being in C++). #include typedef enum EFoo { FOO_A = 1, FOO_B = 2 } TFoo; int main() { TFoo foo = FOO_A | FOO_B; printf("foo = %d\n", foo); } This compiles in C but not C++.

What? https://godbolt.org/z/vnwvch

That's not the same code, is it? GP's code does not seem to compile in C++: https://godbolt.org/z/5oAIYE

But it does in C: https://godbolt.org/z/zdTKiE

Re: Ask HN: What should a systems/low-level software engineer know?

#108

If your are looking towards embedded: * put a cap between power and ground * get some nice ESD-birkenstocks * don't listen to anybody telling you how it's done The start of the art is BS and we need a revolution. There will be so many people who tell you that you can only do it in C and if you don't, you can't be taken seriously. The result is that everybody is keeping to C and nobody invests time in bringing new ide…

What would putting a single cap directly between power and ground be? Wouldn't that be a short circuit or boom?

Capacitors do not conduct any current in steady state but rather conduct more current with higher frequency. The equation is i = C dV/dt

So depending on what frequencies you want to filter out you can change the capacitance C.

Re: Ask HN: What should a systems/low-level software engineer know?

#109

Earlier quoted context omitted.

What. What good programs are written in C that don't have well-structured memory management the way C++ does it with RAII? Edit: "But in reality, why C is still the best programming language for large projects (IMO) is exactly that the programmer is allowed to choose a suitable structure, such that the program can fulfill the technical requirements. Other languages force the project into a structure that somehow neve…

RAII is a disaster. Piecemeal allocation and wild jumping across the project to do all these little steps (to the point where the programmer cannot predict anymore what will happen) is not the way to go. Then all the implications like exceptions and needing to implement copy constructors, move constructors, etc. in each little structure. As to what C project doesn't just emulate RAII: Take any large C project and you…

I guess you're the yin to my yang, because I've got a compiler written in C that doesn't use any global variables at all: https://github.com/srh/kit/tree/master/phase1

It wasn't really implemented for performance, and maybe the language is more complicated -- no doubt it's a lot slower. On the other hand, I can look at any function and see what its inputs and outputs are.

Re: Ask HN: What should a systems/low-level software engineer know?

#110
post #90
post #72

Earlier quoted context omitted.

C enum values are convertible from int; C++ enum values aren't. This is one of the biggest differences in fairly idiomatic C code and has been the case for a very long time (i.e. not dependent on newer C features not being in C++). #include typedef enum EFoo { FOO_A = 1, FOO_B = 2 } TFoo; int main() { TFoo foo = FOO_A | FOO_B; printf("foo = %d\n", foo); } This compiles in C but not C++.

What? https://godbolt.org/z/vnwvch

Try creating a foo https://godbolt.org/z/AlHDhg
Post reply on HN