Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Enforcing things at the type level certainly has its place, but I have to think that wading through that TicTacToe API would probably introduce a lot more cognitive load than a nice simple dynamically typed one that raised errors when you did the wrong thing. You can still have correctness guarantees if you validate actions at runtime.


I am not sure that it has its place in distributed systems. That sort of tight service coupling was the SOAP model. A REST model will tell you the valid actions at runtime ie the valid moves or actions as URLs, a looser coupling and also safe.


How does static typing increase coupling?


You have to recompile both sides of the API if you change the types and redeploy together.


A change of types would almost always accompany a change in semantics.

Wouldn't you need to redeploy both anyway when you have a change of semantics? If you retain the old API with the old semantics, you could of course retain the old type, too.


No, you can add a field on a server that some clients do not yet use without changing the semantics for the clients that do not know about it, for example.

The loosely coupled model is more or less Duck typing for interfaces.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: