
Rather than saying “I’m going to eliminate all mutations and all statefulness”, rather say “I’m going to use functional style to make mutations and statefulness apparent and obvious so that I can understand them.” The key to doing database updates in functional style is to take a more relaxed view of functional languages. Updating a database is a side effect on a massive amount of external state, and so very non-functional-style. Things get a little more difficult when you consider database updates. LINQ is entirely based on the idea of constructing immutable query objects that can be turned into efficient database queries. (I only showed “in memory” LINQ examples, but it works against databases as well.) When querying a database, functional programming works extraordinarily well. How does functional programming work when interacting with databases? You should have a basic grasp of the ML language before you try to read this book. It is very pragmatic.Ī very advanced book I like on functional programming is Chris Okasaki’s book “Purely Functional Data Structures”. You can find some of the tutorial material from this book online here. “Real World Functional Programming” by Tomas Petricek and Jon Skeet is quite good. F# tends to be used in domains that have a lot of scientific or financial computations.Ĭan you recommend some good books related to C# functional programming? Both are good general-purpose programming languages.
#Mindnode snap to grid code#
They’re both great languages which I would choose for a given task would depend on factors like how familiar is the team with the given language, how much code do we have in one or the other language already, and so on. F# is primarily a functional language which supports programming in an OO style. This is a bit of a “which is better, a gorilla or a shark?” questions, but I’ll give it a shot.Ĭ# is primarily an OO language which supports programming in a functional style.

What is the advantage of using C# over a functional language like F#? How would you choose one or the other for a new project? The video will be posted in a couple of weeks I’ll put up a link when I have it.Ī number of people asked questions that we did not have time to get to: I had a great time and we had a capacity crowd. Thanks to everyone who came out to my beginner talk on using functional style in C# on Wednesday. I will never stop learning and improving my craft. I will not make promises without certainty. I will produce estimates that are honest both in magnitude and precision. I will continuously ensure that others can cover for me, and that I can cover for them. I will do nothing that decreases that productivity. I will do all that I can to keep the productivity of myself, and others, as high as possible. I will fearlessly and relentlessly improve my creations at every opportunity. I will make frequent, small, releases so that I do not impede the progress of others. I will produce, with each release, a quick, sure, and repeatable proof that every element of the code works as it should. I will not knowingly allow code that is defective either in behavior or structure to accumulate. The code that I produce will always be my best work. In order to defend and preserve the honor of the profession of computer programmers, I Promise that, to the best of my ability and judgement:

As always, what’s important is to set the rules for the project and stick to them… It is a legitimate preference to want the additional lines of parameters to align with the opening parenthesis. A typical example is a list of arguments for a method that is too long to fit on one line:

There are legitimate cases where the beginning of a line is aligned with some boundary inside the previous line. The second argument is that what you align is not always line beginnings. Additionally, if you change the tab width in your editor settings, the code will look different to you than to its author. If you replace a tab with anything else, the rest of the line will move. If, for whatever reason, you have to replace a space with another character, nothing else will move. Tabs are weird in that context because they are the only useful characters that are a different width than everything else. The first argument for me is that a good programming font has to be a monospace font. I just had one of them on the weekly Orchard meeting, where I’ve joked that spaces are objectively superior to tabs, by which I meant that there are objective arguments in favor of spaces that I find subjectively compelling. Coding convention discussions are always fun.
