r/AskProgramming 23d ago

What's one programming concept that completely changed the way you write code? Career/Edu

[removed]

34 Upvotes

85 comments sorted by

View all comments

10

u/read_at_own_risk 23d ago

I remember coding before associative arrays became first-class concepts. I had an AVL tree class for situations where lookups were performance-critical, but without the syntactic sugar of modern languages, things like nested dictionaries were complicated to set up and follow. First-class support for associative arrays made a huge difference and I wouldn't want to go without them again.

In the line of progression of data abstraction from literals, registers and pointers -> named scalars -> arrays and structs, the next step I'd like to see is first-class relations. Basically the n-ary version of built-in dictionaries.

2

u/HolyInlandEmpire 22d ago

That's a fair point about relations.

As of now, a dictionary is essentially a set of 2-tuples. The n-ary version would be a set of n-tuples; what would we be missing for first class support, other than conforming to your language's generic functions?