A nice case for introducing the F word 🥁 in your workplace
⭐️ F# as a .NET Meta Language — see Milner in ACM/Turing awards to get to know the cool granddad of this F-boy— shines as being a very FUN and amazing language, but 💤 I get it, you need some of those Ah Ah! moments for yourself, I cannot teach you that.
To make a comparison, it would be like debugging a bug in production, only based on what a colleague of yours said, instead of really trying to double-check and understand…
dotnet new -lang f#
JS (or ECMAScript) being born as a Browser(Client-side) language (Mozilla/Netscape), works natively in your browser, or else it needs a backend runtime to be able to execute on your computer by its own. That’s why Node.js exists.
npm init creates the package.json file and allows you to start adding packages and scripts to your node environment.
JS is an interpreted language, doesn’t need to be compiled, can be directly executed, paying this with performance and extra security vulnerabilities…
Mmmm immutable OK, but, can you make my life easy?
You have been doing F# great, and you love Type Providers, especially the
awesome FSharp.Data. Unfortunately Json provided types from FSharp.Data are immutable, and here is the whole focus of this post. Give me that “mutation”!
Inspired from this post Programmers Today are like Scribes in the middle Ages, in the discomfort of realizing the truth, but hoping for a re-lit of Reason.
And this is not my own reply, but I tend to affiliate well enough with this answer
I wonder how people think all programming languages are equal. Can we think of anything…
While reading learn go in y minutes some time ago, I noticed some common «concepts» in the language design of go-lang and F#, a language for .NET I really love.
✔️Here for reference if you want to play around with both languages:
Important Notice: I am not a Go programmer myself, but an F# enthusiast, so feel free to correct my imprecisions or mistakes :)
Note: I am not talking about performance here, but now-a-days NET5 (and upcoming NET6) are pretty well oiled…
scripting with #r NuGet and comparing some python syntax
mkdir fsx && cd fsx; touch new.fsx; code .
I will also compare a bit of F# and Python between the lines, as python is the de-facto standard for scripting in 2021.
return a + b
let sum a b =…
We will be creating a simple HTML View rendered in memory in a single MVC controller, where HTML and CSS will also be strongly typed (as code).
We won’t need any external .cshtml or .html file as F# allows HTML to be expressed within a very idiomatic style using Feliz.ViewEngine DSL as static functions and list parameters.
E.g. this HTML div:
simply becomes a standard F# function invocation from a static Html module:
Giraffe has a similar html templating DSL but it’s a bit more verbose, so I go for Feliz…
As you might already know, F# is a dotnet language, so you don’t need to install anything extra, you get it out of the box with dotnet-sdk.
If you haven’t before, I invite you to shake hands with your neighbor F#, and play out a bit, before reading further; here is a quick and awesome getting started.
dotnet new console -lang F#
Solitary unit test can be defined as a test class where the one and only concrete service is the service under test (all other dependencies, except for data/value types are mocked)
A social (sociable) unit test is instead one which uses concrete service dependencies to test the class currently under test. Also called component test.
I believe as usual there shouldn’t be a strict rule around that, but is worth noting some differences, in order for us to sort the…