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.

Implicit Scope and Implicit Resolution in Scala

22 pointsby dadeover 7 years ago

2 comments

srequeover 7 years ago
It&#x27;s always ironic to me that people think implicits reduce code clarity, and yet those same people use runtime DI frameworks and possibly AOP. Scala implicits can in my opinion be thought of as a simple compile-time lexically-scoped DI framework. It&#x27;s very much a compile-time equivalent of the @Autowired or @Inject annotation in runtime DI frameworks, except it has the benefit of lexical scoping.<p>The great thing about implicits is that errors occur at compile-time and your IDE can give you all the information you need to understand what implicits are in play. On the other hand, there is no tool in the world that will save you from a complex spring-based application with strange initialization order errors, certain features silently not working for who knows what reason, and often barely-comprehensible stacktraces.
评论 #15843136 未加载
christophilusover 7 years ago
I haven&#x27;t used implicit scopes in Scala, but after watching a demo of them, I think it&#x27;s a feature that can easily be abused and cloud code clarity. Scala more than almost any other language in it&#x27;s class seems particularly full of such features.<p>I&#x27;d love to hear from some seasoned Scala folk: what do you think of these new features?
评论 #15840714 未加载