18 subscribers
40 photos
7 videos
2 files
54 links
In this channel, I will wrote my personal thoughts, experiments on different PLs and mathematics
Download Telegram
The modern software engineering team
😁1
Being smart is hard
Being not smart is also hard
Picking one of them also hard

So just be yourself and do not let AI to choose a way for you
How different languages handle the impossible states or errors?

Java/Python/PHP/C++ - throws an exception middle of the execution whenever developer wants
Go - panics like idiot everywhere or checks fucking error interface in every line of code
Haskell/Rust - if you use partial function panics and stops execution, but show warnings while compilation. If not, the compiler just not let you write impossible state

How other methods are there? Do you know?
When AI is behaving itself like your teamlead
Let’s pause here for a second, because there’s something very cool that’s easy to miss: we can control what a valid API looks like by NOT writing instances for HasLink. For example, it doesn’t make sense to create a link to something involving :<|>; for example, left :<|> right is for composing endpoints left and right into an API, but there’s no link that makes sense for left :<|> right itself. Well, if we don’t write an instance HasLink (a :<|> b), we’ll never be able to construct a link to a malformed endpoint, because toLink won’t compile! We’ve transformed the runtime error (Left "...") from our function endpointLink above, into a compile-time error. How awesome is that?!


Haskell has a mind-blowing power but we are not ready to use this power :)

Link