Showing posts from October, 2020

React - When Should I Use It?

      Since I've been learning React, it seems like companies everywhere are using it. Job postings left and right have a wide variety of back-end frameworks, with a React front-end. I think Blazor and ASP.NET are great, but React seems to be the more popular font-end tool (at least here in Utah). I figured I could compile a few of the reasons why I would want to work in React, and why I would want to avoid React. Keep in mind, most of this is my opinion based on my experience and a new developer.     The Good       React is widely used; Facebook built and maintains it, so there is guaranteed support until Facebook goes down, and even then there is a large enough community that it would still last at least a while longer. On top of that, React's ability to efficiently update the DOM gives it better performance than tools like Django. React apps feel responsive, and it shows in the developer experience. It doesn't have a lot of documentation you need to remember, and the res

My Experience with Django

    I learned Django because I was applying for a part-time job as a web-developer for a company called Bright Bridge Web, where I work currently. It's a part-time gig, but it's given me some nice experience working on multiple projects in different languages and frameworks. Most of the code I write is for back-end Django API's, often with React-Native front-ends.     I got started by watching this PluralSight video by Reindert-Jan Ekker, and following along with his code. We built a meeting planner site, and my code for that can be found here . I have mixed feelings about Django; on one hand it's a great way to get something up and running quickly. Since everything is in Python the syntax is usually exactly what you expect. The Django API I work on is simple and easy to edit and add to.      On the other hand, routing in Django is just a pain. It feels like writing boiler-plate code, but if you mess it up it can cause unexpected errors (I've heard Django-Mako-Plus

Elixir Game of Life

    I've been feeling nostalgic for the days when I was coding in Elixir, since I've mostly been coding in C# and JavaScript lately. Elixir is still one of my favorite languages, and I think it's a lot of fun to code in. I decided to revisit a project I built Snow Colleges 2019 Coding Competition. The competition was to build a solver for Conway's Game of Life , and the solver that could find a certain amount of generations the quickest. Since Elixir is such a great language for writing multi-threaded programs, I built a fun solver and took third in the competition.     The project had to connect to an API that would send the starting board and track each solver's progress (I also built a front-end way to view all the players progress which was used in the competition. The code is in C# and, you can check it out here !), so one file in the project is entirely just for handling the HTTP requests, while the actual solver is relatively small. HttPoison was used

Blazor with Auth0 Authentication

      An update on my Blazor portfolio! I've learned to add authentication using Auth0 which allows me to log in and add add things, while hiding the Add and Edit page and not allowing people to delete my posts willy-nilly. I used this tutorial , which was really pretty simple. The biggest difference in my code was that I wanted to have some API calls be public facing while others were hidden behind authorization. This meant I needed to create two different ProjectApiServices to handle my API calls, one of them added the HttpMessageHandler to authorize certain API calls (starting at line 15).     Once that was done, I just had all the calls I wanted to be private call my AuthenticatedProjectApiService, and then anyone who didn't log in would get a 401 error! Neat! However, it looks nicer when a user who can't use a button doesn't see the button at all. That was simple, I just hid these buttons behind an Authorization tag in the Blazor, and then they only showed up when

Spring Makes Java Better!

      Spring is a very popular Java framework that makes working with Java applications easy. It provides dependency injection using the beans, and it also contains other modules for MVC, Web Development, messaging and more. Spring is a lot of things, and although when I first saw it on countless job postings I assumed it was just for building REST API's, but it is for so much more than that. I just finished watching an excellent PluralSight video by Bryan Hansen that covers the basics of Spring, and we didn't even begin to cover how to build a REST API. Still, I completely understand why Spring is so useful in building large applications.        Spring cuts out the clutter and makes your code more business-focused. You can make Beans, which are kind of like components, and you can tell them what to be and what to do. For example, Beans default to singleton (unless you'd rather they be a prototype) so when you want to create an instance of an object, you only create one, w