TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

On Scaling Mental Models

147 pointsby selffabout 5 years ago

11 comments

DmitryOlshanskyabout 5 years ago
The problem with most great projects written by small group of brilliant people in any language:<p>- it introduces its own vocabulary, it looks like gibberish until you build up the context<p>- since the group is small and gifted they have no problem creating and using the power tools of their own<p>- there is no documentation so your only way is through experimentation and direct communication<p>- the folks who have built it had to move on to solve another (bigger) problem, leaving no traces of what the vocabulary is, where the design was headed, what should be changed with the new requirements and again next to zero documentation
评论 #22660364 未加载
评论 #22656130 未加载
评论 #22658783 未加载
TuringTestabout 5 years ago
The problem with powerful languages is they&#x27;re great for allowing you to create new abstractions, but they&#x27;re terrible at piercing that abstraction and let you know what&#x27;s going on inside when you need it (such as, when learning what the abstraction means when you find it for the first time).<p>Current modern languages are built around the false dicotomy that you have to choose between one of two representations, like those in the provided example:<p>1. mydict1.merge(mydict2, handle_duplicates=(key, v1, v2) =&gt; v1 + v2)<p>2. mydict1 + mydict2<p>A mid-level language will use the first style so that programmers will know what&#x27;s going on, but then the team will be stuck to using that style everywhere even when they already understand that it&#x27;s &quot;oh, just adding two dictionaries&quot;. Powerful languages let you use the second style but then, as the article explains, it&#x27;s hard for a new programmer to tell what&#x27;s the mental model behind that complex operation.<p>A good powerful Lisp-like language should allow you to build the second abstraction in terms of the first, and use the simple syntax everywhere, but then switch between both representations easily.<p>I.e. you should be able to <i>inspect</i> the meaning of the more abstract syntax by expanding its definition in place and see how it works in context. Programmers typically address this shortcoming with support of powerful (yet ad-hoc) IDE&#x27;s runtime debugging tools. But why that approach is not integrated into the language itself, I have no idea.
评论 #22656373 未加载
评论 #22654473 未加载
评论 #22654526 未加载
评论 #22654347 未加载
评论 #22654523 未加载
评论 #22657327 未加载
评论 #22656981 未加载
noelwelshabout 5 years ago
The problem is programmers crafting the language to their own mental model. One solution is languages that don&#x27;t allow much abstraction. The other solution is to craft a shared mental model. This latter approach is the more powerful in my opinion.<p>Taking the example of adding maps, you (where &quot;you&quot; means the language designers or language community) just need to define what `+` means for primitive types and the composition follows naturally. What does adding maps mean then? It means adding together the primitive types found under each key. If everyone agrees 1) there is a `+` operation and 2) what it means for primitives, there isn&#x27;t much room for confusion. At some point you might want to give this concept a name and then you have basically reinvented monoids.<p>This is one of the differences between my experience in untyped functional languages (primarily Scheme) and inexpressive languages (primarily Java) and typed functional languages (primarily Scala). In the former each abstraction was a perfect snowflake crafted to the specific situation. In the latter we just reuse existing abstractions. The problem with the former is you have to learn the meaning and idiosyncrasies of each new abstraction. In the latter you can leverage your existing knowledge in new domains.
评论 #22656177 未加载
评论 #22658217 未加载
评论 #22654170 未加载
评论 #22658322 未加载
评论 #22654854 未加载
评论 #22660160 未加载
hellofunkabout 5 years ago
This article also supports why the Go language has been so widely adopted and successful, despite its young age. The language can be rather limiting and somewhat disappointing for an individual developer, but offers great benefits to the agility of a team.
评论 #22654462 未加载
amboo7about 5 years ago
How about this? <a href="http:&#x2F;&#x2F;www.linusakesson.net&#x2F;programming&#x2F;kernighans-lever&#x2F;" rel="nofollow">http:&#x2F;&#x2F;www.linusakesson.net&#x2F;programming&#x2F;kernighans-lever&#x2F;</a> You can try with a smaller team and make everyone improve rather than complain.
评论 #22655442 未加载
drewcooabout 5 years ago
So language&#x2F;tooling choice should be a sort of a Harrison Bergeron* affair, to make sure that the least able to program will still be able? I&#x27;m not so sure I agree with that. Nor do I agree with its obvious counter-proposal, meritocracy.<p>I have heard of teams using &quot;communication&quot; to bridge these gaps but I know little of that technology.<p>* <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Harrison_Bergeron" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Harrison_Bergeron</a>
评论 #22658544 未加载
throwaway287391about 5 years ago
&gt; I didn’t use [vim] in 2017. That’s because my employer started doing more pairing, and nobody could pair with me. It was bad enough for the Atom users, but even the other vimmers couldn’t pair with me. They’d press something expecting the vanilla vim action and get something completely unexpected. It’d drive them crazy.<p>I&#x27;ve never done pair programming (other than one project when I was in school and it was required -- bit of a nightmare IMO), but I thought the way it typically worked was you switch off who &quot;drives&quot; (i.e. actually types the code) in long intervals. So why couldn&#x27;t each coder just use their own preferred programming environment? Do they not each have their own machines?
评论 #22654706 未加载
carapaceabout 5 years ago
&gt; “powerful languages don’t scale”.<p>The &quot;scale&quot; he&#x27;s talking about doesn&#x27;t seem to be &quot;of traffic&quot; or &quot;of data&quot; but rather &quot;of programmers required to work on it&quot;.<p>&gt; it’s hard for other people to work with you. They don’t share your mental model, and they don’t come in with all your initial assumptions. This is somewhat addressable if you all start working on the project together but falls apart when people join on later. The expressivity doesn’t scale.<p>So that&#x27;s a failure of <i>documentation</i>, eh?
评论 #22656166 未加载
fjfaaseabout 5 years ago
Articles like this are missing an important point. Namely, that generic data structures in programming languages are used to represent rich semantic data models. This is done by a process that I would call &#x27;implementing&#x27;. It is a mapping of a certain semantic model to, often a rather limited, set of primitives. Some languages, are completely optimized for one type of data structure. Take for example the relational database, in which everything is a relation.<p>During the implementation process some knowledge is lost. What the author is describing is a kind of merge operation. If you would know the semantic meaning of the data that is being represented, it is rather obvious what choice should be made. When a number represent a quantity, it is obvious they should be added, but when a number is a kind of identifier, like an article number, it is obvious that they should not be added. And yes, maybe in that case the number should have been better represented as a string. In the process of implementing it is often smart to represent it like a number, because it is much easier to deal with a 64-bit number than a variable length string.
评论 #22654030 未加载
harperleeabout 5 years ago
This is an interesting hypothesis, and I&#x27;ve also heard something similar said of clojure: it makes lisp just a little bit less opaque (by way of macros not being so popular, introducing {} and [] as a little bit of extra syntax, emphasizing a very targeted philosophy on several aspects, etc.
trabant00about 5 years ago
Just taking on the vim custom keys thing: that was a problem of standardisation. That is why it did not scale. Nothing to do with mental models.
评论 #22654225 未加载