

My journey from C# to CIT
source link: https://www.compositional-it.com/news-blog/my-journey-from-c-to-cit/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

I've recently joined Compositional IT, so now seemed like a good time to talk through how and why I switched from being a C# developer to being an F# developer. I'll discuss how I discovered F#, what I did to become more familiar with it and why I jumped at the chance to join the team!
Learning the basics
For a few years before joining Compositional IT, I worked on a variety of ASP.NET MVC web applications written in C#. In that time, I learnt about some concepts that I wanted to put into practice in my C# code: immutability for value objects; a type for potentially missing data (like option) to avoid nulls; a type for potentially errored data (like result) to avoid exceptions. After feeling frustrated with my experience of using these concepts in C# code, a friend recommended F# and Scott Wlaschin's blog, F# for Fun and Profit. I soon discovered that there was much less friction when using these ideas in F# than C# and many more benefits besides.
Having spent a few months getting comfortable with the syntax and concepts, I tried implementing a hobby project in F#. I'd just read Scott's book, Domain Modelling Made Functional, so was keen to solve a problem where the domain was non-trivial; I settled on an app that would help me keep track of cards while playing the board game Pandemic. My initial aim was to get familiar with implementing logic in F# and not worry about a user interface, so I wrote a class library and some unit tests. That done, it was time actually to make the app. I'd heard good things about the Elm architecture, so decided to try Elmish. I'm really glad I did: it allowed me to create a client-side web application (currently hosted on my personal GitHub Pages site) rendered using React, written exclusively in F#.
Converted
Now convinced that functional programming is a better fit for the software I work on—solving business problems, usually with a web app—I started sharing ideas from functional programming with colleagues. A few lunchtimes were spent talking about the benefits and trade-offs as compared to other paradigms. I even gave a presentation to the organisation's "coding discussion group" on the underlying principles; expect some related blog posts in the near future 😀
I was thrilled when I became aware of the opportunity at Compositional IT: if I got the job, I'd have the chance to program in F# full-time, using SAFE Stack to write F# across the whole stack! I got started on my job application almost immediately. Thankfully, I did get the job and have got stuck in using SAFE Stack within my first few weeks.
I'd just like to sum up by saying this: if you haven't yet taken the plunge, give F# and functional programming a try. If you want to use F# to write a web application, try SAFE Stack. Once you get past any initial differences, you may find the simplicity liberating and realise that you're having a lot more fun—I know I am 😊
Learning resources
- For an introduction to creating and using option and either types in C#, check out the Advanced Defensive Programming Techniques Pluralsight course by Zoran Horvat.
- F# for Fun and Profit is Scott Wlaschin's F# blog, which I used to get started with F#. It's got some good content for beginners and plenty of deeper articles too.
- Mark Seemann's blog often has interesting F# content.
- If you like Scott's blog, his book Domain Modelling Made Functional has great advice on how to build business applications in F#.
- If you want to write web apps in F#, check out SAFE Stack.
- The Elmish Book by Zaid Ajaj is a great way to get started with Fable and Elmish, the 'F' and 'E' in SAFE used to write web front ends.
Recommend
-
56
The Icon Journey October 24, 2017 Chris Dias, @chrisdias TL;DR#...
-
99
Home › Java › Java Interface – Journey Over the Years to Java 9 – Default and Private Methods
-
84
The journey to Microservices ...
-
83
Google Developer Groups Explore...
-
69
“学之经莫速乎好其人,隆礼次之。”——《荀子·劝学》解读:开展学习之旅的要点,最重要的是找到一个好老师,其次是要搞好理论基础的学习。
-
56
XDA interviews Stan Dmitriev from Tuxera, a Finnish company that specializes in file systems. Stan discusses file systems and the future of F2FS.
-
51
除非特别声明,此文章内容采用知识共享署名 3.0许可,代码示例采用Apache 2.0许可。更多细节请查看我们的服务条款。
-
63
It is no secret that I have a passion for Node, it’s the language that got me into development, and the one I most enjoy. As a Software Developer it’s always important to expand your horizons…
-
53
除非特别声明,此文章内容采用知识共享署名 3.0许可,代码示例采用Apache 2.0许可。更多细节请查看我们的服务条款。
-
69
除非特别声明,此文章内容采用知识共享署名 3.0许可,代码示例采用Apache 2.0许可。更多细节请查看我们的服务条款。
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK