Code Watch: At the function junction, have you a compunction?
October 11, 2011 —
(Page 1 of 3)
Writing code is the primary activity of software development. Writing the right code, code that delivers customer value, is the hard part. But right or wrong, the main thing that developers do is work in an editor, transforming inputs to outputs.
For more than a decade, most mainstream developers have done their work guided by the concepts of object orientation, which says that programs should be structured in a way that mirrors real-world objects. The fundamental concept of an "object" is a software module that combines the functions that operate on data and the data itself an object instance for a customer. For instance, it could store the data of a particular person's name, account number and so forth.
This is so ingrained that it may seem natural to those who have known no other way, but 25 years ago, it seemed an academic theory with dubious benefits. As an alternative to the behavior-oriented "structural programming" model and the data-oriented world of "fourth-generation languages," object orientation sometimes seemed like so much mumbo-jumbo, and other times it seemed like it was belaboring well-known principles.
But, over time, object orientation has become the norm. Its dominance is, in my opinion, as much a matter of happy coincidences as any inherent virtue; I utterly believe in the virtues of object orientation, but its uptake in the industry was largely driven by promises of code reuse that were never achieved, and an accidental association with GUI programming, which caused a wholesale reset of development techniques.
Today, we are in a similar situation with functional programming. It will not replace object-oriented programming in the way that OOP replaced structural programming; the concepts of "class" and "object" are clearly attractive for structuring software modules. Rather, functional programming techniques will become ever more common, and programming languages will evolve to have more and more functional features.
It's always easy to predict what has already happened; in truth, functional programming approaches have quietly become commonplace. I say "functional programming approaches" because what I'm talking about is not at all the "pure functional" theory-driven model. Rather, from a strictly pragmatic point of view, if you compare code written at the turn of the millennium with code written today, you'll see today's code has less internal state and more context-carrying arguments, and you'll see yesterday's code uses object-structural techniques where today’s developers would use first-class functions (that is, where an OOP developer might define a single-method interface to capture the idea of a sorting strategy, the functional programmer would simply pass around a particular function as the implementation).
Related Search Term(s): functions
Share this link: http://sdt.bz/36003
Most Read Latest News Blog Resources
Android is the focus of two new design tools
Anywhere Software and Xamarin provide ways for developers to create and test their applications on PCs
|
|
LEADTOOLS HTML5 add-on modules released
Including New HTML5 Zero Footprint Viewer, JavaScript Libraries and RESTful Web Services for Document and Medical SDKs
|
|
How to speed up your Cukes
Using a five-step process derived from Six Sigma, Cucumber tests can go much faster
|
|
WhiteSource offers open-source license management as a service
Software gives companies insight into the open-source components in products
|
SmartBear rolls out new quality solution: API Complete
Software gives organizations ability to write test scripts and monitor APIs by bridging the DevOps divide
|
|
Android is the focus of two new design tools
Anywhere Software and Xamarin provide ways for developers to create and test their applications on PCs
|
|
WhiteSource offers open-source license management as a service
Software gives companies insight into the open-source components in products
|
|
Top five devices you can integrate with your applications
A five-fingered list of common, household items with which you can talk to (via software, of course)
|
Slick...but who needs it?
compilr.com is a well-designed site and the folks behind it seem to have their heart in the right place. But...who needs it?
|
|
How to be a better software developer
Want to be a better developer? You won't get there by mastering an interesting language or learning a new set of APIs.
|
|
Wooing Galatea
Do yourself a favor and check out Galatea 2.2, a wonderful book by novelist Richard Powers.
|
|
The world as story
An artificial-intelligence system at Carnegie Mellon seeks to understand the world by making statements about it.
|
Five SCM Best Practices
Two-thirds of all software projects fail, according to the Standish Group’s CHAOS study. Improper usage of software configuration management...
|
|
|
Best Practices for Branching and Merging Patterns
Development teams often create a branching pattern, usually drawn out on a white board or in a Visio document, that is used as a model to...
|
|
Automated Error Reporting
We invite you to read a short e-zine that tells you all about automated error reporting for .NET applications. This 8-page e-zine is packed...
|
|
The End of Application Redeploys
Imagine that every time you wanted to write, send or receive an email, you needed to restart your computer. How much time would this take, a...
|