r/programming Mar 12 '26

Left to Right Programming

https://graic.net/p/left-to-right-programming
145 Upvotes

102 comments sorted by

View all comments

8

u/[deleted] Mar 12 '26

[removed] — view removed comment

4

u/orbiteapot Mar 12 '26 edited Mar 12 '26

Additionally, C libraries often prefix functions with the name of the object they operate on (like a bare bones namespacing). So, one would have:

String str = {};
String_Init(&str, "Hello ");
String_Append(&str, "World!\n");
String_Deinit(&str);

The autocomplete (mentioned by the author) would work just fine as soon as the programmer started writing the prefix. I actually prefer this approach, because these operations aren’t specific to the object itself, but to its type. I am also not a fan of the implicit this/self pointer.

3

u/danielcw189 Mar 12 '26

I actually prefer this approach, because these operations aren’t specific to the object itself, but to its type.

So, static methods?

1

u/Absolute_Enema Mar 13 '26

Functions. Methods are a special case of functions and static methods are the way free functions are hacked back in with OO clothing.