6
dUcKtYpEd
14d

Made a simple jwt auth server with express (node.js) . Used one JWT library that took me no longer than 5 minutes to understand almost all of its functionality and therefore quickly get to work.

Started the JWT auth flow for another app in .NET core 2.0. Microsoft has a recommended JWT library with more than 20 million downloads. Sooooo complex. Every tutorial found is a 50 minute minimum read with an outrageous amount of understanding around the library to even get a JWT token generated.

I guess thats part of the reason I've gone into c# was so i could become much more of a seasoned developer that has a more low level perspective but this is ridiculous.

with the npm library its literally a generateToken method that takes your encryption type string, an object of your claims and your secret to use for signing. With the nuget library im having to do the HMAC hashing manually, utilize more then 10 classes and peace them all together.

Comments
  • 2
    There is nothing low level about C#. It's just a better Java with a fetish for the C++ feature expansion mindset. I prefer F# as it takes far fewer keystrokes to get the job done and the ML family is just better than the C++ family for programming in the big.

    Anyway, consider learning F#. It will help you understand the direction C# is taking and help you adapt quicker.
  • 1
    I know EXACTLY what you mean with this.

    To add to this. Making a module which exports said functionality in Node makes more sense than creating a class that implements God knows how many interfaces.

    This OOP pattern in Java and C# adds way too much mental stress on an otherwise simple thing.
  • 1
    A library that is more complex to use than the protocol/standard it implements is just a bad library.
  • 0
    @MoonOwl I would actually love to learn f# but I’m searching for a career sometime in the future in .NET and all of the jobs locally at least expect a c# background. Surprisingly even in the labs of oak ridge their strong c#/.net jobs. I’ve been surprised to find very little python in the area too despite it being an area of abundant labs.
  • 1
    @AleCx04 @Lythenas I totally agree. I think the module library concepts becoming a lot more popular especially with go and python as well. A JWT token really doesn’t need to be as fully understood as the library I’m using demands it to be. I’m hoping someone creates a descent library on top of the concept to simplify it but in this day I’m shocked there already isn’t one
  • 2
    @dUcKtYpEd The beauty of F# is that if you use it to learn functional programming, you're basically learning ML, so that covers OCaml and would lead nicely into Haskell and other functional languages. If you learn C#, you're basically learning dumbed down C++ without C so that programmers who would otherwise be using Java can use it.

    What is your domain if I may ask?
  • 0
    @MoonOwl I’ll look into it more. I have some experience with Elixer and that’s about as far as I’ve gone with functional. The domains Rickelsworkshop.me , I’m working on it’s blog in .net core
  • 2
    @Lythenas I consider it an abstraction failure if the abstraction is more complex that what the entire space it's meant to abstract. Some people call it overengineering but that's what eventually got me to hate the Java-esque 'OOP' ethos that come from enterprise development. It's almost like the whole idea of removing the need for work to be done to accomplish tasks is no longer the purpose of developing technology.
  • 1
    @dUcKtYpEd Elixir is a wonderful language. You will find that the lessons go with you. If you have time look into the work of Church and Rosser, and contemporary folks like Brendan Pierce. Functional programming rewards going into theory and going into functional programming rewards any other programming style.
  • 0
    @MoonOwl love you how summarized that. There is alot of things in .NET that i find sooo over engineered and abstracted too much but in a way that does not help me at all because i have to be made aware of all its workings to make it work. It kinda defeats the purpose of a one purpose library for me when i have to understand all of its pieces to make it carry out its one purpose. Ill check those out, im actually going to an elixer meet up soon so they will be a good read for convo points
  • 0
    @dUcKtYpEd I learnt C# by reading the language specification itself because I found too many people giving advice that was based on misconceptions. The 'best practices' led to me reading code that read like it was translated from another language because of uninteresting obsessions with building system uniformity. Today, you even read senior developers arguing against the use of functionally inspired and unmanaged features simply because they themselves have tough time reasoning through the code. Basically, the dinosaurs killed what could have been a refreshing experience of what Java could have been. While F# may not directly support all the object-oriented features C# it sure as hell has a better development culture. And that is why I eventually moved to F#. I wanted the magical experience of coding back in my life. And this is what has kept me away from enterprise aka dinosaur development.
Your Job Suck?
Get a Better Job
Add Comment