top | item 18162934

(no title)

sankyo | 7 years ago

> I can’t really imagine myself working on a million line project

Any project of this size is too big and is better off being broken up.

You need tests no matter what kind of typing you are using.

The best thing about Clojure is that it is immutable by default. Start writing pure functions that transform you data step by step until you send it on its way with a side effect. I don’t miss types much at all - immutable maps lists, sets and pure functions get the job done and it is fun to program.

Static typing fans hardly ever acknowledge how difficult the types make it to read the code. Too much focus on that one time when someone made a typo and there was no unit test.

This has been argued infintum, nobody is changing their mind. WTF am I doing here?

discuss

order

tigershark|7 years ago

How is this F# code difficult to read?

    let add n1 n2 = n1 + n2
Where do you spend time reading the types? Though it’s fully typed and if you pass an int and a string or some type for which the + operator is not defined you’ll get a compile time error.

xrd|7 years ago

This. "Static typing fans hardly ever acknowledge how difficult the types make it to read the code. Too much focus on that one time when someone made a typo and there was no unit test." Well said.

tigershark|7 years ago

Same question to you, what do you find difficult to read in the code that I posted in the previous comment?

F-0X|7 years ago

>Static typing fans hardly ever acknowledge how difficult the types make it to read the code

I think types make code much more understandable. I like them to be explicit so there's no mental overhead of thinking "what type might this be" - and the larger the codebase, the more this pays off.