Remix.run Logo
tombert 2 hours ago

I don’t expose it at the boundaries, just within functions. With everything outside of the function I take a Map interface in and/or return the Map out.

It makes no difference to the outside code.

jpollock an hour ago | parent | next [-]

You are communicating with future readers of the code. The presence of ConcurrentHashMap will lead future engineers into believing the code is threadsafe. This isn't true, and believing it is dangerous.

tombert an hour ago | parent [-]

No, they'll believe that that specific map is thread safe.

xorcist 2 hours ago | parent | prev [-]

That's really not much better. No function is an island, as wise man almost once said.

tombert 2 hours ago | parent [-]

It’s actually a lot better. That’s literally the whole point of interfaces and polymorphism: to make it so the outside does not care about the implementation.