Ancestors

Toot

Written by onor.io on 2025-01-08 at 14:11

Another thing that language designers should be very aware of: defaults are extremely important! Most developers will never bother to use anything other than a default even if another choice would better suit the use case.

I mean how many people use an unsigned integer as an index in a looping construct? Yet consider how many times you've needed a negative index into, well, any data structure? But because signed integer is the default that's what usually ends up getting used!

=> More informations about this toot | More toots from onorio@mastodon.acm.org

Descendants

Written by onor.io on 2025-01-08 at 14:13

2/2 This is one of the reasons I like languages like F#, Scala and Rust. They default to immutable values but they give the developer the means to make things mutable if it's justified.

=> More informations about this toot | More toots from onorio@mastodon.acm.org

Written by Rebecca Wirfs-Brock on 2025-01-08 at 14:33

@onorio The problem with defaults is a tough one. I'm no language designer, but what about Checked vs Unchecked exceptions? Or public vs private? It depends on the design philosophy, usage scenarios considered, and well, perhaps even guesses at use of the language designers. And they aren't necessarily the day-in-day-out users of the language.

=> More informations about this toot | More toots from rebeccawb@discuss.systems

Written by onor.io on 2025-01-08 at 14:55

@rebeccawb You raise some excellent points. I guess it's my thinking that picking reasonable defaults and leaving the escape hatch (that is, a developer can always get to the non-default use) saves a lot of grief. Of course that's assuming that we can agree on "reasonable defaults" and that's a pretty large assumption.

I'm not a language designer either so I'm just making some broad assertions based on my experience of software development so take anything I say with a boulder of salt. :)

=> More informations about this toot | More toots from onorio@mastodon.acm.org

Proxy Information
Original URL
gemini://mastogem.picasoft.net/thread/113793139643997738
Status Code
Success (20)
Meta
text/gemini
Capsule Response Time
319.376423 milliseconds
Gemini-to-HTML Time
0.733026 milliseconds

This content has been proxied by September (3851b).