Over 5 Years of F#

Originally when I was planning on doing a post for the F# Advent Calendar I was thinking I would do one on a tool I’m building for C# in F# that mimicks some of the functionality of the fantastic library FSharp.Data.SqlClient. But then I was thinking, “I’ve been messing around with F# for a while and have done some production work with it; why not share some of the experiences that I have had with F#? [Read More]

Desert Code Camp 2017

Desert Code Camp 2017 was yesterday. I was slated to give four presentations yesterday. I ended up giving three. Three of them were on F#. I did Introduction to F# in the morning and had two more ready to go in the evening. But by that time everyone in the morning had already gone home, I’m guessing, and so the evening attendees probably would have enjoyed hearing Introduction to F# again! [Read More]

Database Programming Yin Yang

There are two different ways people like to write their SQL scripts when calling the database. One way is to write the SQL statements in their application code. Sometimes they will write an ORM to make this process similar to their language constructs. Sometimes they will write the SQL code directly in procedures. Pros and Cons of Developing in the Application Pros Low friction between application and database. [Read More]

An Introduction to Functional Programming in JavaScript

This is the talk I gave at the JavaScript meetup in Phoenix. One the othe largest programming meetups in the valley. Here are the slides to the talk. Here’s some books that can help you get ramped up into the functional programming paradigm Introducing functional programming with Underscore.js by Michael Fogus. And for a more in depth look into functional patterns Professor Frisby’s Mostly Adequate Guide to Functional Programming. [Read More]

The Power of Static Typing

From what I understand static typing makes programmers more productive and gives implicit documentation to the code base - although explicit documentation is also very helpful. It also seems to make the tools we use much more powerful. One of the problems of static typing is that your code becomes more verbose. With programming languages like F# the compiler will implicitly type as much of your program as possible. Where it fails, you need to type it yourself. [Read More]

Authentication and Authorization in ASP.NET Core

One thing that really got me frustrated in WebAPI 2.0 was creating custom authentication. Eventually I found a blog post by Rick Strahl that showed how to roll your own authentication/authorization. I wanted to implement a login (Basic Authentication) with username/password that would return a token for later (Bearer Authorization) use. It was quite simple but really frustrating because there wasn’t a whole lot of documentation on the subject. Now I want to do something similar for ASP. [Read More]

F# with Web API and Railway-Oriented Programming

I presented at the 2016 Desert Code Camp. The topic was WebAPI with F#. I also did a video series to go along with the talk. The talk and video series basically goes over how to use F# in a functional manner by building out all the pieces from scratch. Here’s the series, hope you enjoy it! F# WebAPI From Start to Finish. Some set up steps and notes that are important to the success of the project: [Read More]

Validation in F#

The full code for this article is up on GitHub. I like to the keep things as simple as possible and, ideally, reusable. At my previous employment I came up with a method of validation, but I was never entirely happy with the results. Some of the code repeated itself, and it was difficult to extend to arrays and array comparison. So, I went back to the drawing board building on top of the ideas that I created with the first validation library I created. [Read More]

Swagger is too Restrictive

Swagger has a definite idea of what makes a good URL. But if you want to do anything outside of that good luck. I think, that even though it seems like a good idea to push people towards a standard it doesn’t allow the user to really create RESTful APIs which suit their own needs. Let’s say that you have a reports resource. Sometimes you would like to get the JSON data of the report. [Read More]

JavaScript-Style Promises in F#

Working in enterprise level back end software often times I need to get information from many different sources. When you have enough of these sources the time it takes to get all the information can really add up. That’s when F# async work flow really comes in handy. Except, there is a gotcha. Let’s say we have two sources we need to fetch data from: let myData () = async { let! [Read More]