Have you ever had the feeling that “this is” already tired? What do you want something new? "This" can be anything: a game, a job, a car. Anything that repeats every day. And in programming? Under the cut, you'll find a story about C # fatigue and choosing a more interesting approach.
I give the word to the author.
Recently, I was a little tired of C #, endless lines of the same type of code cease to warm the soul over time. At such moments, sometimes you want to do something for the soul. In my case, this is Linux and F #.
For the most part, it is important for me that I get out of my comfort zone. In general, I did, changed the system and language.
While organizing my vacation, I was faced with the fact that it was a little incomprehensible where to start. Let's see a little about how things are with F # on Linux.
Main:
Sophisticated workers have already realized that the " lightweight editor" + Microsoft = Visual Studio Code . I hope you already have it :)
So, with the choice of the editor figured out, now with everything else in order:
In principle, in order to start something up, this will be enough, but then the article would quickly end.
We put extensions to support F # syntax, build and manage Nuget packages.
For completeness, you can put the Nuget manager compatible with .Net Core.
We put the extension for debugging (Yes, everything is correct, C # is written).
After that, we are getting this rep , and then we follow the instructions:
dotnet restore && code .
Now reboot the VS Code
and wait until the extension of the "debugger" downloads its packages and will unfold normally.
In fact, now almost everything is ready, it remains only to test.
dotnet new console -lang F# dotnet run
We receive treasured Hello World from F#!
long-awaited F # Interactive starts.
It can also be used for more useful purposes:
Next, look at the build and debug.
We do not need to change the automatically configured file.
Ctrl+Shift+B
again and see that the build is successful:So, your car is set up and ready for new challenges in a wonderful functional language. A nice bonus is that your work can be built into the C # project (by connecting. Dll).
Well, you never know who did not know)
Maximilian Spiridonov - C # developer, MAI student, Microsoft Student Partner. In professional development on .NET I came back at school. More than 2.5 years working with real projects on WPF (MVVM) + C #, MySQL, more than 5.5 years developed on C #. The main area of interest now is mobile development on Xamarin. Also, by chance, in the sphere of interests were C / C ++ and Linux.
Maximilian's previous article on C / C ++ on Linux in Visual Studio Code.
We also invite you to chat on F # in Telegram.
Source: https://habr.com/ru/post/343864/
All Articles