Functional programming in

Swift Functional programming is cool – even for an ERP guy! #swiftlang

I’ve just one objective with learning Swift – it’s to create ERP apps for iOS. The reason I went into Swift was that it made programming iOS easier – a lot easier!

Trying to gasp Swift, you have to come over «Functional Programming». To me, it didn’t say anything. Worse, as I’m a SQL programmer burned by object-oriented programming, I suspected functional programming to be equal or worse.

But somehow one of the articles caught me. The title, Reprogramming your mind for the Functional Swift Matrix – made me so curious that I passed through it. Not only once but three times, the last with a Playground.file open and testing it out.

A nice illustration from a Huffington post article

What I learned was that there was a simpler way to create for loops, namely map. I also noted my brain reacting stimulated, and then I looked up the article references. One of them was an hour long explanation from a year ago. It was nice, and I recognized a lot of functional stuff I had seen before. Like generics, «first citizen» functions, optionals in addition to map.

In ERP we have something called «Audit trail». A log of every change that an auditor can control. And we have the habit of prohibiting changing transactions. So this words made my day. They’re from a pretty good introduction:

Data is immutable

So my forty year on ERP on immutable enterprise data is meeting a brand new language based on immutable data. That’s just fantastic for this old SQL guy!

Comments are closed.