So those hardware engineers, in an effort to give us more and more cycles per second, have resorted to adding more processors into our chips, and there seems no end to how many processors that will lead to as the years march onwards. So let me ask you this, O skilled and competent programmer: How are you going to take advantage of every computer cycle available to you when your computer has 4096 cores in it? How will you marshal your function executions when they must run within 16384 processors all contending for the same memory buss? How will you build responsive and flexible websites when your models, views, and controllers must share 65536 processors? Honestly, we programmers can barely get two Java threads to cooperate. And threads are baby-food compared to the meat and potatoes of real processors fighting over the buss. For over half a century programmers have made the observation that the processes running in a computer are concurrent, not simultaneous. Well, boys and girls, welcome to the wonderful world of simultaneity! Now, how are you going to deal with it? And the answer to that is, simply, “Abandon all assignment, ye who enter here.” Clearly, if the value of a memory location, once initialized, does not change during the course of a program execution, then there’s nothing for the 131072 processors to compete over. You don’t need semaphores if you don’t have side effects! You can’t have concurrent update (pardon me: Simultaneous Update) problems if you don’t update! So that’s the big deal about functional languages and it is one big fricking deal. There is a freight train barreling down the tracks towards us, with multi-core emblazoned on it and you’d better be ready by the time it gets here. About the Author Robert Martin (Uncle Bob) (@unclebobmartin) has been a programmer since 1970. He is the Master Craftsman at 8th Light inc, an acclaimed speaker at conferences worldwide, and the author of many books, including: The Clean Coder, Clean Code, Agile Software Development: Principles, Patterns, and Practices, and UML for Java Programmers. He is a prolific writer and has published hundreds of articles, papers, and blogs. He served as the Editor-in-chief of the C++ Report, and as the first chairman of the Agile Alliance. A somewhat different version of this article, as well as much more about functional programming, can be found at the author’s blog [U1]. You can send him your feedback [U2] on this article or discuss the article in the magazine forum [U3]. External resources referenced in this article: [U1] http://blog.8thlight.com [U2] mailto:michael@pragprog.com?subject=functional programming basics [U3] http://forums.pragprog.com/forums/134 PragPub January 2013 7
Purchased by unknown, nofirst nolast From: Scampersandbox (scampersandbox.tizrapublisher.com)