Earlier quoted context omitted.
C is utterly predictable. Maybe you're the exploding chainsaw in this metaphor.
How detailed is your knowledge of undefined behavior?
Modern C [pdf]
121–130 of 396 posts
Re: Modern C [pdf]
#122It's nice to see this perspective kept alive. I put some effort into a numerical library (github.com/maedoc/sddekit) in C99, and I didn't find the language lacking until I tried to imitate inherited interfaces with virtual dispatch by hand (empirically I can say, a poor move in C lib design). I did find it useful to apply rules like only use uint32_t, double & bool as primitives. My main wish is that it would be poss…
Re: Modern C [pdf]
#123Earlier quoted context omitted.
In the end giving in the same (or even more efficient) CPU instructions. We both know that is not always true and heavily depends on the type of software though.. Take https://github.com/micropython/micropython for instance: what higher level language but C would allow that to run with the same performance as it has now, on as much different devices? C++ would be a viable answer, but when used e.g. as C + templates i…
Turbo Pascal, Think Pascal, Quick Pascal, FreePascal, Modula-2, Ada, Delphi, MikroElektronika Pascal The availability of compilers for a specific architecture is orthogonal to the language.
Re: Modern C [pdf]
#124Earlier quoted context omitted.
Sure, "systems programming" has a variety of meanings. But, there are a lot of areas where C was the obvious choice in the past but Go might be a suitable replacement today. Areas where concurrency and safety is maybe more important than raw performance: Databases (and there are many now written in Go, including alternative types of databases like time series, key/value, etc.), servers, etc. I tend to consider those…
Databases have been written in Java, too; but the combination of performance unpredictability (not something Go has addressed, since it is also garbage-collected) and a bad C compatibility story has proven to limit the reach of these projects.
Your comment seems to imply that java hasn't been successful for db development. HBase, Cassandra and ElasticSearch would all disagree.
Yes, there are situations where GC is not appropriate. But I think those situations aren't as common as they are made out to be.
Re: Modern C [pdf]
#125I personally prefer Prehistoric C, which only has the two language keywords "ugh" and "grunt". Modern C has too many keywords for my taste.
Re: Modern C [pdf]
#126I'm really surprised by the "hate" for C that is appearing in these comments. What ever happened to actually enjoying the danger of getting low level? Is assembly also useless because it isn't readable? There is a lot of great code written in C, and a lot of crappy code written in C. Because C doesn't protect you from yourself, it exacerbates any design flaws your code may have, and makes logical errors ever more ins…
When developing on one platform for an extended period of time, it is human nature to forget which features are implementation defined as you use them day after day and then have unexpected errors/flaws when porting.
Re: Modern C [pdf]
#127I'm really surprised by the "hate" for C that is appearing in these comments. What ever happened to actually enjoying the danger of getting low level? Is assembly also useless because it isn't readable? There is a lot of great code written in C, and a lot of crappy code written in C. Because C doesn't protect you from yourself, it exacerbates any design flaws your code may have, and makes logical errors ever more ins…
Re: Modern C [pdf]
#128Earlier quoted context omitted.
Historical accident. It could have been written in any other language that compiled to native code, if we had more options available.
Well, there are two types of people in this world 1. the type that do something 2. the type that claim they could do it better than the first group (this is by no means limited to programming, it is for example pretty common in politics) So please show me an OS written in Go or Rust or Ruby or Python or Java that people can actually use for day-to-day tasks.
Re: Modern C [pdf]
#129If he/she knows these concepts well, that means he/she have invested much time, and probably know other things well enough (or can learn them easily).
Re: Modern C [pdf]
#130Another day for the HN crowd to express their distaste for C :)