I recently started implementing the Post, Redirect, Get pattern in my .Net MVC Controllers per a suggestion from my good friend and life coach Ryan Fuller. If, like me you aren’t currently familiar with this pattern and its benefits check out the Wikipedia link in the previous sentence.
My initial implementation required quite a bit of value checking, type casting and magic string management which I was not a fan of. So, I created this simple little helper class that I would like to share with you, whoever you may be.
Original Post: You have to sing the title of this post or it wont work. I hope you like oldies, I don’t. Oldies remind me of doctor’s office waiting rooms for some reason and I’ve never really felt comfortable listening to them. At times they simply make me nauseous.
Something in my industry that has always bothered me is the unsolicited and almost always unwarranted belittling of other technologies. I work in a fairly mixed environment in regards to technologies. Our organization has .Net developers such as myself, php developers, and java developers. I have an honest respect for these other languages as well as the frameworks and systems that they run on but I fear that the wizards who wield their power do not share the same respect for my chosen stack. The reason for my aforementioned fear is validated by the blatant knocking of my stack anytime one of these guys gets the chance. It’s almost absurd how someone can work their disapproval of a tech stack, framework, or OS into a conversation that has nothing to do with technology at all.
I don’t get it. Is it a form of insecurity that they didn’t make the right choice, are they just trying to get a rise out of others, or do they really believe that their stack is the end all?
In the spirit of the age old adage of “don’t knock it til you tried it” I am going to pursue some of these other tech stacks. I am currently going through PHP: Get Started by Christian Wenz which will be followed by Starting in Symfony2 by Leanna Pelham and Ryan Weaver since I’m already familiar with developing web apps in MVC.
I plan to update my blog as I progress through these courses and give any feedback I think is blog worthy.
Update 2016-19-09: I’ve been asked why I chose to start this journey with php instead of something else such as java. Java is very similar to C# and I wanted to go a bit more off the rails on this crazy train. I’ve “hacked” php in the past for side gigs but never truly developed in it. I also have this habit of trying out rails development at least once a year always coming back to Rails for Zombies by Gregg Pollack but have never fell in love with it. So, php it is!
I, like many other C# developers use the var keyword. But why are we using it so much when we know the type that our var will become?
The rule that I and many other developers follow is that it is OK to use var as long as the incoming type is easily discovered by looking to the right of your assignment operator.
var form = new Form(); [good]
var formId = SaveForm(); [bad] what the heck does SaveForm return? A good guess would be an int but what if it’s a GUID or a string?