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.

Death by Duck-Typing

3 pointsby abscondmentabout 15 years ago

2 comments

telemachosabout 15 years ago
I'm not sure I follow the argument (or agree with where the author places the blame).<p>Notwithstanding Ruby's handling of type safety or its implementation of arrays, isn't it my job (as the programmer) to know what kind of object I'm getting from the helper library? That is, when I get 'h' (in his example), the black box is how 'h' gets filled, not <i>what kind of collection object it is</i>.<p>Or am I confused?
评论 #1146319 未加载
评论 #1147574 未加载
dangrossmanabout 15 years ago
Be glad arrays in PHP are implemented internally as hash maps, so the average inexperienced web developer doesn't run into issues like these.