1,518 karma · joined Mar 15, 2023 (3y ago) · 543 submissions
comment 9mo ago · link · parent
I think every OO language should be using Smalltalk's message-passing style rather than holding hard references, and Objective-C is a great model. But discard the rest.
comment 9mo ago · link · parent
My two biggest considerations when picking a language are:
- How well does it support value semantics? (Can I pass data around as data and know that it is owned by the declaring scope, or am I chained to references, potential nulls, and mutable handles with lifetimes I must consider? Can I write expression-oriented code?)
- How well does it support linear pipelining for immutable values? (If I want to take advantage of value semantics, there needs to be a way to express a series of computations on a piece of data in-order, with no strange exceptions because one procedure or another is a compiler-magic symbol that can't be mapped, reduced, filtered, etc. In other words, piping operators or Universal Function Call Syntax.)
I lean on value semantics, expression-oriented code, and pipelining to express lots of complex computations in a readable and maintainable manner, and if a language shoots me in the foot there, it's demoralizing.
comment 9mo ago · link · parent
comment 9mo ago · link · parent
comment 10mo ago · link · parent
comment 10mo ago · link · parent
comment 10mo ago · link · parent
comment 10mo ago · link · parent
comment 10mo ago · link · parent
comment 10mo ago · link · parent
It works fantastically well, and don't let anyone tell you that you MUST bloat the CLI interface of your program with every possible dial or lever it contains. We should all be cogent of the fact that, in this very young and rapidly evolving profession, textbook and real-world best practice often do not overlap, and are converging and diverging all the time.
comment 11mo ago · link · parent
It's a tradeoff I am more than willing to take, if it means the processing semantics are basically straight out of the textbook with no extra memory-semantic noise. That textbook clarity is very important to my company's business, more than saving the server a couple hundred milliseconds on a 1-second process that does not have the request volume to justify the savings.
comment 11mo ago · link · parent
In Nim, strings and seqs exist on the heap, but are managed by simple value-semantic wrappers on the stack, where the pointer's lifetime is easy to statically analyze. Moves and destroys can be automatic by default. All string ops return string, there are no special derivative types. Seq ops return seq, there are no special derivative types. Do you pay the price of the occasional copy? Yes. But there are opt-in trapdoors to allocate RC- or manually-managed strings and seqs. Otherwise, the default mode of interacting with heap data is an absolute breeze.
For the life of me, I don't know why other languages haven't leaned harder into such a transformative feature.
comment 11mo ago · link · parent
comment 11mo ago · link · parent
The programming landscape 30+ years ago and its severely constrained resources strongly biased our idea of "good software" in favor of cleverness. I think we can say we know better now. Having been responsible for picking up someone else's clever code myself.
comment 11mo ago · link · parent
Does that mean that if you're trying, you're fighting a losing uphill battle against something you'll never excel at? I think many skills are learned and must be earned with discipline. But the culture places excessive weight on excelling in specific fields that most people simply can't brute-force. Hence the prevalence of chemical assistance at the highest ends of productivity, intellectual competition, and athletics.
We probably need to place more emphasis on doing things that come naturally to us. Emphasis on doing. But also enjoy downtime and not-doing occasionally.