DEV Community

Cover image for Semantics, Not Syntax; Developer empowerment using functional-first programming

Semantics, Not Syntax; Developer empowerment using functional-first programming

Kirk Shillingford on November 29, 2021

"It's not about syntax; it's about semantics." - Richard Feldman This article is just a collection of my thoughts concerning my favourite language...
Collapse
 
ehdevries profile image
Ed DeVries

This is one of the most compelling and accessible explanations of functional programming principles I've ever read. You've got that same magic as Scott Wlaschin - I feel more smart, not less, after having read your article, and not a monad in sight ;-)

Now if only we could get those sweet union types in C# ...

Collapse
 
kirkcodes profile image
Kirk Shillingford

Being compared to Scott Wlaschin is probably the highest compliment I could receive! Thank you so much!

I would Love some clean syntax for unions in C#.

Collapse
 
aminmansuri profile image
hidden_dude

I still think Smalltalk has most if not all these functional semantics and has a much better syntax. It also was a lot more feature rich.

It seems that people are now getting to the early 70s in language design. Maybe we'll get to the 80s some day and reexamine Smalltalk.

C++ did a lot to confuse people about what OO is and isn't.

Collapse
 
kirkcodes profile image
Kirk Shillingford

I've only ever heard good things about Smalltalk and one of the most prolific F# developers I know cites it as his favourite language and what he considered to be his "preferred flavour of OOP". I'm hoping to do some work with it sometime soon.

Yeah, most of the stuff here isn't new right. We've had lots of the patterns but things fall in and out of vogue. That's why I try not to get too sour (or sweet) on any one thing. I had a bad experience with Java the first time I encountered it but it wouldn't been a mistake to write off all object oriented programming. Haskell too was a struggle initially but there's a balance with,

"A painful implementation doesn't necessarily mean a bad idea."

I'm hoping articles like this get folks to try more new things, and older things.

We should iterate our behaviors like our code, and find what works.

Also, the devs of the 70s and 80s were pretty smart. :D

Thanks for the reply!

Collapse
 
aminmansuri profile image
hidden_dude

One theory is that language innovation basically stopped after about 1980.. I tend to mostly agree with that view. :)

Collapse
 
alrunner4 profile image
Alexander Carter

Smalltalk doesn't have immutable variables, algebraic data types, or type inference, right?

Collapse
 
aminmansuri profile image
hidden_dude

It didn't have type inference for sure, because it was the epitome of dynamic (but strong typing).

It had equivalent ways of doing the other things.

I take a good syntax and feature richness over an overabundance of features any day.

Collapse
 
dylanwatsonsoftware profile image
Dylan Watson

This was a great read! Thanks!
Love the idea of ADTs!
Just wish Typescript had a compiler error for when potential null returns aren't handled.

Not sure I'm convinced by the "whitespace as syntax" thing. Maybe it's one of those things that sounds like a bad idea..but isn't. I can't help but be fearful of it whenever I write python though! Haha

Collapse
 
kirkcodes profile image
Kirk Shillingford

I started on python so I guess I'm used to it. But with a good compiler/linter it feels no different from braces or parens or anything else.

I use TS a lot day to day and I like it but yeah, there's a cpl gaps I wish were a bit tighter.

Collapse
 
squidbe profile image
squidbe • Edited

We've gone this whole way without me mentioning functional programming, and that's deliberate.

Until reading that sentence, I was thinking, "Why isn't he mentioning functional programming since he's talking about FP principles?" 😀

Excellent write-up! You're a skilled writer, and this was a pleasure to read. Ever think about writing a book?

Collapse
 
kirkcodes profile image
Kirk Shillingford

Thank you so much!

I never really considered it. I don't know if I have the patience.