Professional Documents
Culture Documents
FEATURE COMPUTING
Why Functional
Programming
Should Be the
Future of
Software
Development
It’s hard to learn, but your code will produce fewer nasty
surprises
This website utilizes technologies such as cookies to enable essential site
BY functionality, as
CHARLES SCALFANI well as for analytics, personalization, and targeted
23 advertising
OCT 2022 purposes. To learn more, view the following link: Privacy Policy
MANAGE PREFERENCES
https://spectrum.ieee.org/functional-programming 1/19
2/15/24, 11:08 PM Why Functional Programming Should Be the Future of Software Development - IEEE Spectrum
SHIRA INBAR
Y
OU’D EXPECTTHE LONGEST AND MOST COSTLY
https://spectrum.ieee.org/functional-programming 2/19
2/15/24, 11:08 PM Why Functional Programming Should Be the Future of Software Development - IEEE Spectrum
Y
OU’D EXPECTTHE LONGEST AND MOST COSTLY
phase in the lifecycle of a software product to be the initial
development of the system, when all those great features
are first imagined and then created. In fact, the hardest part comes
later, during the maintenance phase. That’s when programmers pay
the price for the shortcuts they took during development.
So why did they take shortcuts? Maybe they didn’t realize that they
were cutting any corners. Only when their code was deployed and
exercised by a lot of users did its hidden flaws come to light. And
maybe the developers were rushed. Time-to-market pressures
would almost guarantee that their software will contain more bugs
than it would otherwise.
https://spectrum.ieee.org/functional-programming 3/19
2/15/24, 11:08 PM Why Functional Programming Should Be the Future of Software Development - IEEE Spectrum
https://spectrum.ieee.org/functional-programming 4/19
2/15/24, 11:08 PM Why Functional Programming Should Be the Future of Software Development - IEEE Spectrum
SHIRA INBAR
https://spectrum.ieee.org/functional-programming 5/19
2/15/24, 11:08 PM Why Functional Programming Should Be the Future of Software Development - IEEE Spectrum
Back then, this was a radical idea, and many programmers resisted
the loss of a statement that they had grown to rely on. The debate
went on for more than a decade, but in the end, the GOTO went
extinct, and no one today would argue for its return. That’s because
its elimination from higher-level programming languages greatly
reduced complexity and boosted the reliability of the software
being produced. It did this by limiting what programmers could do,
which ended up making it easier for them to reason about the code
they were writing.
https://spectrum.ieee.org/functional-programming 6/19
2/15/24, 11:08 PM Why Functional Programming Should Be the Future of Software Development - IEEE Spectrum
g
process but can be changed by any number of processes, even
simultaneously.
Now, imagine that every time you ran your microwave, your
dishwasher’s settings changed from Normal Cycle to Pots and Pans.
That, of course, doesn’t happen in the real world, but in software,
this kind of thing goes on all the time. Programmers write code that
calls a function, expecting it to perform a single task. But many
functions have side effects that change the shared global state,
giving rise to unexpected consequences.
https://spectrum.ieee.org/functional-programming 7/19
2/15/24, 11:08 PM Why Functional Programming Should Be the Future of Software Development - IEEE Spectrum
How
Thiscan those
website flaws
utilizes be eliminated?
technologies such asItcookies
turnstoout thatessential
enable the answer
site
functionality, as well as for analytics, personalization, and targeted
has been around for decades: purely functional programming
advertising purposes. To learn more, view the following link: Privacy Policy
languages.
https://spectrum.ieee.org/functional-programming 8/19
2/15/24, 11:08 PM Why Functional Programming Should Be the Future of Software Development - IEEE Spectrum
https://spectrum.ieee.org/functional-programming 9/19
2/15/24, 11:08 PM Why Functional Programming Should Be the Future of Software Development - IEEE Spectrum
https://spectrum.ieee.org/functional-programming 10/19
2/15/24, 11:08 PM Why Functional Programming Should Be the Future of Software Development - IEEE Spectrum
A comparison of Javascript and Purescript shows how the latter can help programmers
avoid bugs.
https://spectrum.ieee.org/functional-programming 11/19
2/15/24, 11:08 PM Why Functional Programming Should Be the Future of Software Development - IEEE Spectrum
https://spectrum.ieee.org/functional-programming 12/19
2/15/24, 11:08 PM Why Functional Programming Should Be the Future of Software Development - IEEE Spectrum
InThis
functional programming,
website utilizes there
technologies suchare no statements,
as cookies only site
to enable essential
functionality,Mathematical
expressions. thinking
as well as for analytics, that we learned
personalization, in middle
and targeted
advertising purposes. To learn more, view the following link: Privacy Policy
school can now be employed when writing code in a functional
language.
https://spectrum.ieee.org/functional-programming 13/19
2/15/24, 11:08 PM Why Functional Programming Should Be the Future of Software Development - IEEE Spectrum
The biggest problem with this hybrid approach is that it still allows
developers to ignore the functional aspects of the language. Had we
This website utilizes technologies such as cookies to enable essential site
left GOTO as an option 50 years ago, we might still be struggling
functionality, as well as for analytics, personalization, and targeted
with spaghetti
advertising code today.
purposes. To learn more, view the following link: Privacy Policy
https://spectrum.ieee.org/functional-programming 14/19
2/15/24, 11:08 PM Why Functional Programming Should Be the Future of Software Development - IEEE Spectrum
https://spectrum.ieee.org/functional-programming 15/19
2/15/24, 11:08 PM Why Functional Programming Should Be the Future of Software Development - IEEE Spectrum
p g g p
I was left to pick up bits and pieces from here, there, and
everywhere. And I can attest to the gross inefficiencies of that
process. It took me three months of days, nights, and weekends
living and breathing Haskell. But finally, I got to the point that I
could write better code with it than with anything else.
https://spectrum.ieee.org/functional-programming 16/19
2/15/24, 11:08 PM Why Functional Programming Should Be the Future of Software Development - IEEE Spectrum
g y y
While such learning resources can only help, for this transition to
take place broadly, software-based businesses must invest more in
their biggest asset: their developers. At my company, Panoramic
Software, where I’m the chief technical officer, we’ve made this
investment, and all new work is being done in either PureScript or
Haskell.
But there are still challenges when working with a language that
relatively few others use—in particular, the lack of online help,
This website utilizes technologies such as cookies to enable essential site
documentation, andasexample
functionality, as well code.
for analytics, And it’s hard
personalization, totargeted
and hire developers
with experience
advertising in these
purposes. languages.
To learn more, viewBecause of that,
the following my company
link: Privacy Policy
https://spectrum.ieee.org/functional-programming 17/19
2/15/24, 11:08 PM Why Functional Programming Should Be the Future of Software Development - IEEE Spectrum
https://spectrum.ieee.org/functional-programming 18/19
2/15/24, 11:08 PM Why Functional Programming Should Be the Future of Software Development - IEEE Spectrum
https://spectrum.ieee.org/functional-programming 19/19