Undefined Behavior in C and C++ (2024)
In some ways, that's because C is a lower-level language, closer to assembly; it just gives you what the underlying machine gives you.
Topics /
The most popular blog posts about software engineering on Hacker News. 21,845 posts.
In some ways, that's because C is a lower-level language, closer to assembly; it just gives you what the underlying machine gives you.
It's not about technology for its own sake. It's about being able to implement your ideas.
This article is written with considerable snark–put on your flameproof suit if needed. I’m not actually a jerk when interviewing people, but I do get frustrated when candidates fail to do basic preparation. If you’re unsure about how to prepare for a programming interview, read on… I know this might come as a shock to…
A hash table is data structure that is used to search for exact matches to a search key. For searching, they work like this: Take a search key (example: the word “cat”) Hash the search …
Objective-C remains an impediment for many programmers coming to the Mac or iPhone platforms — few programmers have ever experienced it before learning Cocoa, forcing two learning curves at once for new Cocoa developers. How did Apple end up with such a weird language? And for a company known to replace CPU…
I semi-regularly hear developers who claim that using Rust would not gain them anything because they would have to use `unsafe`. But this is not true. Local reasoning matters.
In Part 2 article I'll describe how I personally would write the code specified in Part 1. I'm not claiming this is in any sense objectively the best, and I'm certainly not suggesting it's the only.
Nineteen distribution channels later: what it actually costs to give a terminal editor away for free on Linux, and why the next step is a static musl binary that updates itself.
I defined a QT Object that contains an integer value and uses QT signal along with awl::Observable based on virtual functions to notify the subscribers when the value changes:
I still have my Nokia 5800 lying around. It runs Symbian. That platform is quite different from Android. For one thing the internal storage size is 81 MB - less than what your single android app takes up, even in RAM, and it works faster than modern smartphones - e.g. the SMS app opens instantaneously. Another…
(Most) C++ implementations provide at least 8, 16, 32, and 64-bit signed and unsigned integer types. There are annoying implicit conversions, discussions about undefined behavior on overflow (some think it’s too much UB, others think it’s not enough), but for the most part they do the job well. Newer languages like…
Creating a programming language is apparently all the rage these days, and it’s got me thinking about what I would really like to see in one. I’m starting to suspect the things I want are either impossible or mutually incompatible, so I’d better write them down and let smarter people tell me why I can’t have…
This morning Miroslav Bajtoš asked "Why do C++ folks make things so complicated?" in response to my article on regular expressions in C++. Other people asked similar questions yesterday. My response has two parts: Why I believe C++ libraries are often complicated. Why I don't think it has to be that way. Why would…
It’s time to reformulate the principles guiding my work. [Revised definition of complexity in response to misunderstandings]
Me and my close friends have been interested in starting a project together and I suggested we use Haskell. I do not think the suggestion was received well or perhaps in seriousness. I have a tendency to joke about almost everything and have put forward that we use many interesting but not practical languages in the…
Extracting my gym’s QR check-in from its Flutter app, with a rooted phone and a lot of ripgrep.
Gap buffers are a common data structure for representing a text buffer in a text editor. Emacs famously uses gap buffers — long-standing proof that gap buffers are a perfectly sufficient way to represent a text buffer.
F# is not just for math and big data, it's a general purpose language that will greatly reduce the amount of bugs in your code.
Historically, LLVM's major releases always added "0.1" to the version number, producing major versions like 3.8, 3.9, and 4.0 (expected by March 2017). With our next release though, we're changing this.
Do we need to measure complexity? With what metrics? What benefits can it brings? This is the questions we'll answer in this article.
While working on an article for the Monad.Reader, I’ve had the opportunity to think about how people learn and gain intuition for abstraction, and the implications for pedagogy. The heart of …
Monorepos and Forced Migrations By most metrics, Google is a great place to work. Top tier compensation, free food, and largely co-workers who want do...
A community and blog for embedded software makers
I took Heroku for granted, and a month into setting up my own infra, I now know how much it bought me.