I am all for developers pushing themselves, learning new things and refining their skills, but the one thing that really annoys me about front-end development right at this moment, is the opinion terrorists who are raving about functional programming.
I am a firm believer in using whatever it takes to get things done. Whether you still use jQuery or you prefer to write things from scratch without libraries or frameworks.
You’ll always encounter developers (usually younger ones) who want to use React or the latest Trend.js library. When you’re on the cutting edge though, you’re always playing catch up to an extent.
And let me make this one thing clear: there is a difference between not caring about what people think of your code and writing bad code.
You should always put love and care into the code you write, but fixating on what methodologies and specific styles to use (especially if they’re new to you) is wrong. Write great code, but write it on terms that you understand.
As shown earlier, most of these opinions are opinionated Medium articles. But this isn’t a new argument, some have been advocating for functional programming for years.
There are benefits to adopting a functional programming style, one of those being the lack of state, I am not saying I am against it. However, if you’re only switching to it because it’s the popular thing to do right now, then I feel bad for you son.
Let’s be honest with ourselves: functional programming is hard and you rarely see it in the front-end development space being done right.
Developing an application using a functional programming style requires immense discipline. If you don’t come from a background in working with functional programming concepts, it will be an uphill battle for you to unwire how your brain has learned to work (especially if you’re senior level).
While functional programming is touted as the best thing since sliced bread and inheritance is the root of all evil, if you’re a shitty developer, it isn’t going to make you better. It won’t stop you from writing stupid, buggy and unoptimised code. No style, methodology, framework or library will make you a better developer.
I have seen quite a few attempts from developers trying to switch to a functional programming style and I have never seen it done right. Developers are inherently lazy, always trying to automate things and jump on the latest tools to streamline their development workflow.
You might start out with the best intentions, but once the weight of an impending deadline starts crushing you, we both know you’ll start to cut corners. We both know that desire to adhere to that new-fangled functional programming style will wain.
I realise that this article might come across as being just as bad as those articles. I am not telling you to use or not use a functional programming style, but I am telling you to think for yourself and see if that kind of approach will even benefit you.
As it currently stands, I use ES2015 classes in my Aurelia applications (yes, cue the boo’s from the inheritance haters). I also use functions as well to break different tasks up into tasks, but I don’t stick to one style. I write whatever gets the job done.
Front-end development is hard enough already with a sea of mixed specifications from ECMAScript, W3C and WHATWG, the goal posts are always moving.
Why are we as developers always making things so hard for ourselves? Tooling is already the bane of my existence without needing to worry whether or not my function is “pure”.
Choose a functional programming style for your own reasons, not because someone on Medium told you.