Good morning (?)!

If you enjoy reading this newsletter consider helping us by spreading the word via Twitter or simply forwarding to a friend.

Now on with the articles!

Articles

(Nov 12) #scheme

Design by contract (DbC) is a software design philosophy whose goal is to formalize an application's API. This is done by defining pre and post conditions as well as invariants to your components. For example, we can define a method that adds to numbers together to accept only positive numbers and ensures that the return value is also positive. Some languages have this built-in to the syntax like Eiffel. In this article, Veit Heller implements this functionality in Scheme using macros.







(Nov 09) #cpp

Using as an example the approximation of the golden ratio, the author of the article demonstrates how Coroutines TS can be used to separate the presentation from the logic of a function.







(Nov 11) #javascript

As we've discussed in the past, dependant types are types that depend on their parameterized values. Via Wikipedia "A 'pair of integers' is a type. A 'pair of integers where the second is greater than the first' is a dependent type because of the dependence on the value." While TypeScript doesn't support them, it does support conditional types. In this article Athene Noctua uses this feature of TypeScript to define a type that can either be a banknote or a coin depending on the cash amount given.







Programming language of the day: Plutus."Plutus is a strictly typed pure functional programming language used for defining smart contracts in Cardano. The syntax is fairly Haskell-like, but unlike Haskell, the language is eagerly evaluated."



And that's it for today! Discuss this issue at our subreddit r/morningcupofcoding.

Did you like what you read? Let us know by clicking one of the links below.

Liked - Disliked

I hope you enjoyed reading the latest issue of Morning Cup of Coding. If you did, consider supporting it by becoming a patron (Patreon), buying me a coffee (PayPal), donating anonymously (coinbase), or purchasing an MCC mug (RedBubble); it helps me keep this going.

Cheers,

Pek