https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtklabel....
6,468 karma · joined May 31, 2011
[ my public key: https://keybase.io/ap; my proof: https://keybase.io/ap/sigs/SYtj6sAMdb8hiO4D3m5al83Ak1RBvSEHZzN_9vDftg8 ]
https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtklabel....
edit: Just last night a friend was watching MiB and Tommy Lee Jones looks at a Motif UI. It was obviously SGI but it was IRIS ViewKit and not the later Interactive Development Environment. Narrowed down likely creator being Van Ling from Banned From The Ranch Entertainment. If you’re out there…
struct _GtkLabel;
typedef struct _GtkLabel GtkLabel;
// Use GtkLabel* in declarationsWe mainly use C++, not C, and we do this with polymorphic allocators. This is our main allocator for local stack:
https://bloomberg.github.io/bde-resources/doxygen/bde_api_pr...
… or this for supplying a large external static buffer:
https://bloomberg.github.io/bde-resources/doxygen/bde_api_pr...
typedef struct foo_ foo;
enum { FOO_SIZE = 64 };
foo *foo_init(void *p, size_t sz);
void foo_destroy(foo *p);
#define FOO_ALLOCA() \
foo_init(alloca(FOO_SIZE), FOO_SIZE)
Implementation (size checks, etc. elided): struct foo_ {
uint32_t magic;
uint32_t val;
};
foo *foo_init(void *p, size_t sz) {
foo *f = (foo *)p;
f->magic = 1234;
f->val = 0;
return f;
}
Caller: foo *f = FOO_ALLOCA();
// Can’t see inside
// APIs validate magicE.g. `char p = (char )&astruct` may violate strict aliasing but `uint8_t p = (uint8_t )&astruct` is guaranteed legal. Then modulo, traps, padding, overflow, promotion, etc.
Seems it was cast away
> I avoid doing this. Just use `struct string { ... };'. It makes it clear what you're handling.
Well then imagine if Gtk made you write `struct GtkLabel`, etc. and you saw hundreds of `struct` on the screen taking up space in heavy UI code. Sometimes abstractions are worthwhile.
Clearly it isn’t just “broken” for everyone, “Claude Code modernizes a legacy COBOL codebase”, from Anthropic:
If there are 40 years of undocumented business quirks, document them and then re-evaluate. A human new to the codebase would fail under the same conditions.
Most bizarre experience. Never had a bank account with Chase ever again after that incident.
It always surprised me how the top-of-the line analyzers, whether commercial or OSS, never really implemented C-style reference count checking. Maybe someone out there has written something that works well, but I haven’t seen it.
Called, charges reversed, 1 month later they were all reinstated, no reason. Called, charges reversed again, 1 month later they were all reinstated and my Apple Card was cancelled by GS. Since I still had it linked as my payment method w Apple this again locked my whole family out of subscriptions. GS gave no explanation for why the account was closed, but it was after they reversed the charges a second time. Balance was $0, account closed, no recourse. Then 1 month later all the reversed charges were reinstated and on the now locked account and I had no recourse but to pay GS’s ransom because it was a closed account that would be reported if I didn’t pay.
I have CCs from a number of banks and it was by far the most ridiculous consumer experience. No wonder GS wants to exit the consumer market because they are terrible at it. Chase is better, but it’s no AmEx. Sad that it’s not AmEx.
Now I’m wondering if I can get a new account under Chase because I’m definitely never calling GS again.
Just goes to show that all of us reading HN don’t actually share with each other how we’re reading HN :)
Too funny… thank you!!
As an American English speaker, I have in the past used UK spellings when communicating at work with a group that I know only contains British English recipients. There is nothing wrong with that -- anything that makes communication more fluid should be welcome.
I believe the arrogance angle exists in a situation where an American English speaker with no British English education is using British spellings when communicating with other _American English_ speakers to purposefully create an air of superiority. If you do this, even if no one says anything, they definitely notice.
For other English dialects, my personal take is that most Americans (at least the ones who travel or interact with foreigners personally or at work) will assume they either are or are heavily influenced by British English due to history.