Gary L Cox Jr
Gary L Cox Jr

Gary Cox

Senior Software Engineer
About :

Gary started with Dovetail in 2012 as a Senior Software Engineer.  He specializes in front-end and back-end development on the team with a focus on quality.  His experience spreads from Government, State, and Enterprise level development.  When he is not coding, he can be seen in the garden or outdoors with the kids.


Subscribe to Gary L Cox Jr's RSS feed and never miss a post.

Posts by Gary L Cox Jr:


Gary L Cox Jr
December 14, 2015

Comparing Flux with Redux

Working with React, we compared flux with redux, our team decided to use redux. The devtools redux offers was icing on the cake. Diving in, we wanted a central location for all of our API calls. The API middleware would need to handle dispatching a pre-request, successful request, and failures. To handle this, we set our actions in the following format

Actions

Configure middleware

Configuring our middleware looks something like:

I’ve removed some code for brevity, the main point is displayed. We make an axios API call and handle the response in the middleware dispatching to the correct action handler, or reducer.

Configure store

To configure our store so that it knows about our middleware we simply do the following:

Inside our compose we just need to add our API middleware. Now our


Gary L Cox Jr
December 10, 2015

Pointfree Javascript

In a recent post Functional Javascript, we talked about using functions to simplify our coding practice.  I would like to dig in a bit more and talk about pointfree.  Pointfree is a function that doesn’t know what its data is.  For example:

Notice our first function takes in a parameter of name, because it knows its data it is not pointfree.  Our second function does the same as the first but doesn’t know its data.  Therefore, it is pointfree.  For some, the second function is foreign and confusing and the first is something closer to what you might be used to seeing.  However, even the first could be confusing, what is compose, how come the functions don’t have parenthesis, and how can this work when the function doesn’t know its data?

Compose

Compose is just a


Gary L Cox Jr
December 3, 2015

Improving my own javascript style…

Here at Dovetail, developers are encouraged to keep themselves current with today’s coding practice.  Last year, I started studying functional coding to improve my javascript style, along with learning to write cleaner maintainable code.  The easiest way to explain is to take some code and we will begin to refactor it.  Here is a good example:

Red Flags?

I hope as you read through this code you spotted all sorts of red flags.  I know there are other ways to iterate over the data instead of using a for loop, look past that for a sec.  This code works, you can copy and paste it into jsbin and see for yourself.  One obvious issue, splice is being used to remove a user from the array. Why is that an issue? Notice on the last line I didn’t


Gary L Cox Jr
June 27, 2014

Often times we find ourselves coding strings into our javascript that when seriously thought through, should have been constants. One good example I found in my own code was a factory that sends statistics down to our server. The factory was coded to take in a topic along with the action performed. This is all good, the issue was in the controllers sending the data into the factory. I found I was sending hard coded strings which didn’t sit well with me. An example of this would look like:

The first part of the signature as you can see I am sending a hard coded string of LinkClicked. How can this be a problem later? Well, a couple of issues here.

I could misspell this in another controller and our stats will be off The stat topic itself could


Gary L Cox Jr
June 13, 2014

Connecting to Workday’s web services shouldn’t be a trivial event. At least at first one would feel this way. There are a few areas one needs to know in order to get this working correctly as well as achieving authentication on the Workday side. By now you should have been given your tenant ID from Workday, this will be needed later. To get started we need to create the web service client. Using Visual Studio there are two ways this can be done svcutil or right click the project and select Add Service Reference, I prefer to use svcutil as I felt it created a cleaner codebase than the Service Reference did.

Some Gotchas to cleanup Open your Human_Resources.cs file, and using Ctrl + Shift + F, select Find and Replace and type in the find [][] and in


International: +1 (512) 610-5400
Toll Free: 1 (800) 684-2055