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.

Properties: The New Variables

24 pointsby bkardellalmost 13 years ago

2 comments

poalmost 13 years ago
I'll admit I'm not very familiar with the original draft proposal and I appreciate the intentions and the desire to make it a bit more accessible to pragmatic people but please indulge me on a little rant here:<p>I could not dislike the 'my-' prefix any more. Can we please as an industry of professionals decide to talk about things without having to baby talk it into a who's-on-first routine? Talking about variables in the first person possessive is difficult when the 'person' we are talking about owning it is an abstract block of code. In this proposal it is 'author defined' but really when I read your code, It is yours… and now it's mine… or maybe it's ours. Or perhaps it belongs to that block of code. What doesn't change is that it's a variable (or property).<p>I know that's probably a minor point but it annoys me.<p>Secondly, I think the $() syntax needs to be weighed against the cost of having nesting there. Is $ not enough to indicate a reference? I guess the idea is to use that to provide a default but I don't like having to always type out the parens for it.
评论 #4199635 未加载
wandereralmost 13 years ago
I want to agree with po from an entirely different point of view--a non-programmer often trying to figure out how a particular program (in a language I don't know) works. If I spot the "my" or "my-" prefix, I take it that the corresponding token (e.g. "mypref", "my-limit") is not a reserved term of the language, but one the programmer is defining or assigning. So the "my" prefix can be helpful (at least to some non-programmers) and I don't want it co-opted to become a reserved word.
评论 #4200959 未加载