官术网_书友最值得收藏!

Not all is gold...

However, let's strive for a bit of balance. Using FP isn't a silver bullet that will automagically make your code better. Some FP solutions are actually tricky — and there are developers who show much glee in writing code and then asking What does this do? If you aren't careful, your code may become write–only, practically impossible to maintain... and there go Understandable, Extensible, and Reusable out of the door!

Another disadvantage: you may find it harder to find FPsavvy developers. (Quick question: how many Functional Programmer Sought job ads have you ever seen?) The vast majority of today's JS code is written in imperative, nonfunctional ways, and most coders are used to that way of working. For some, having to switch gears and start writing programs in a different way, may prove an unpassable barrier. 

Finally, if you try to go fully functional, you may find yourself at odds with JS, and simple tasks may become hard to do. As we said at the beginning, we'll rather opt for Sorta FP, so we won't be drastically rejecting any JS features that aren't 100% functional. We want to use FP to simplify our coding, not to make it more complex!

So, while I'll strive to show you the advantages of going functional in your code, as with any change, there will always be some difficulties. However, I'm fully convinced that you'll be able to surmount them and that your organization will develop better code by applying FP. Dare to change!

主站蜘蛛池模板: 靖州| 彝良县| 凯里市| 菏泽市| 海晏县| 遂宁市| 平陆县| 青铜峡市| 石屏县| 炎陵县| 托克托县| 济源市| 茌平县| 靖远县| 二连浩特市| 陈巴尔虎旗| 沙洋县| 巫溪县| 井研县| 松潘县| 南郑县| 探索| 华坪县| 巴马| 双鸭山市| 平陆县| 海原县| 巢湖市| 托克逊县| 库车县| 德安县| 黑水县| 清苑县| 牡丹江市| 明光市| 深州市| 岳阳县| 汤阴县| 西和县| 玉门市| 景洪市|