Why don’t people use functional languages more.

“There are only two kinds of languages: the ones people complain about and the ones nobody uses” — common quote

This is a fun statement if you think about it. Because the languages everyone complains about are obviously better than the ones nobody uses. It seems controversial but a simple thought example shows why it has to be this way.

Imagine a world where the mainstream languages were worse than the niche languages like Haskell or Crystal. In this world Haskell has a clear 2x productivity advantage over Java. Since Haskell is clearly better than Java most projects that use Haskell will execute roughly twice as fast. Double productivity is enough that companies using Haskell will be able to achieve the same results with less money spent on developers and thus achieve higher profits. We should see companies that don’t use Haskell going out of business. Eventually we would expect all greenfield development to happen in Haskell. 

You might say well, “Haskell isn’t really twice as good as Java, it is only 20% more productive overall”. Well, 20% averaged out over hundreds of thousands of software engineers is a huge amount of money. My employer would very happily take a 20% increase in productivity if it were on the table. 

However, in the real world we don’t see all greenfield development happening in Haskell. Instead lots of greenfield development happens in Java, Javascript or the .Net ecosystem. 

There has never been a consensus moment in the industry around niche functional languages. Instead people say they wish they could use them while making actual money writing Java code. 

Personally, I would really like to use a better language than Java. Unfortunately, we don’t seem to live in that world. 

Expecting people to become ‘Senior’ Engineers in 3 years is ridiculous.

Becoming a ‘Senior’ engineer in three years is a ridiculous concept. Programming is a complex enough endeavor that you can’t learn the basics of most areas in 3 years of work experience. By the 3 year mark great programmers will have achieved a high level of expertise in one programming domain. For example 3 years might be enough time to master web development with Django. But web development with Django is just one of many domains within computer programming. Mastering Django does not require a software engineer to learn anything about operating systems, low latency computing or graphics computing. In some environments web developers might not have any involvement with DNS or how their software is made available to users as deployment is handled by a infrastructure as code team. 

 In my case I was promoted to ‘Technical Architect’ and team lead in under three years at my first job. I was really good at my job and worked well in the consulting business. At that point in my career I knew a lot of stuff application development, frontend development, automated testing, devops, etc. But I felt under qualified and wanted more money so I ended up taking a demotion to move to FAANG. 

Why can people get promoted to ‘Senior’ Engineer so quickly in the software industry? The main reason is the expansion of the workforce. With double digit employment growth each year, there are a lot of inexperienced programmers in the workforce. Having three years of experience is a big deal in an environment where a large portion of working programmers have under three years experience. 

The issue is that three years is not really enough time to master software development. Honestly, in three years you are more of a ‘journeyman’ programmer than a senior one. You wouldn’t expect a three year senior to be able to bootstrap a new engineering team or to set the engineering culture at a new company or division. There is simply too much to learn about how software works. 

In my particular case, I felt that my ability to deliver projects was great. But when it came to designing software abstractions or building software architecture, I felt like I didn’t know enough to do a good job. I had read books like ‘Domain Driven Design’ on software design patterns, but knowing patterns and actually designing software are not the same thing. In my opinion software agency work is not the best place to learn software architecture design. You simply don’t stay embedded on projects long enough to see the longterm costs and evolution of your designs. 

Design Documents for Distributed Companies

How do you hash out architecture and design at a remote only company? Slack chats and phone calls are a slow way to communicate with an entire team. And miscommunication with people 1000s of miles away can cost you the time and money you were hoping to save by working remotely. 

The Design Document workflow

Some companies have a design document centric workflow. At the beginning of a project instead of writing Jira tickets or tasking out stories, an engineer will spend some time writing a 3-10 page document which describe the plan of attack for the project. This doc will include assumptions, design decisions and constraints, as well as a summary of the changes to be made. The document is not an exhaustive specification, but can include proposed interface or library changes. Then the team will have a review session to read and ask questions about the design. Next after some revisions, and possibly a follow up session, development will begin. 

Google Docs or any other shared document tool is sufficient to support the document review process. If you want to make the process truly asynchronous you could rely only on document comments and skip the meeting all together. 

Typically, a design document should be required both embarking on any significant project or feature addition. Adding a new button to a web form would not need a document, but building a new web service or adding a major feature would. 

When I worked in a distributed consulting company we used this workflow for proposals and Level of Effort estimates. But software design was usually handled by discussion and whiteboarding followed by implementation with half-hearted documentation occurring at the end of the project. A design document process would have helped share design between the east and west coasts keeping more of our projects on the same page.  

Wide vs Deep software

Voice assistants are wide software. In the industry we call it the ‘long tail’ of functionality. There are hundreds of ‘tasks’ that your Alexa or Google assistant can perform for you. You probably don’t know that most of them even exist. But not knowing that these tasks exist costs you nothing. The fact that you can buy pizzas via Alexa has no impact on your ability to get news briefs. You can do either without ever engaging with the other. 

This ‘long tail’ attribute makes voice assistants extremely wide software. Alexa can do hundreds of things which could be stand alone applications. But the trade off is that voice assistants are extremely vast and don’t do anything particularly well. Over the time the ‘main’ functionalities will be refined and optimized. But Voice assistants will always suffer from the ‘long tail’ problem in that they have extremely wide feature sets. 

Wide software spreads across multiple domains. More domains means  leaky abstractions and mapping software. 

Deep software focuses on a single domain. Perhaps it is an order book or a workflow execution engine. Deep software has a clear purpose and domain. Wide software does everything. 

Over time deep software converges on clean abstractions and easy to understand code. Wide software on the other hand is never finished. Wide software is naturally expansive. There is always a reason to add a new functionality to a voice assistant. And in fact there is no real barrier to entry. Adding a new functionality to a voice assistant is a net positive to the system as a whole. The negatives of adding a new domain are already baked in and many customers will enjoy the new functionality. 

Deep software can be finished. It can solve a problem in one domain and be done. Hadoop is an example. No one has heard about miraculous developments in HDFS this decade. Hadoop is essentially feature complete and in maintenance mode. In reality development continues, but is it really new stuff or refinements?

Wide software cannot be ‘finished’. Wide software is an infinite sinkhole. Adding more code makes the sinkhole more valuable so more code keeps getting added. There is no real way to ‘solve’ the problems of wide software. You can partition wide software such that each domain exists separately. But if you allow one domain to reference another, now you are back into the pit. 

Software Leviathans which I’ve discussed in another post (https://www.sledgeworx.io/software-leviathans/) are wide software. Supporting more domains typically increases the value of the leviathan as a whole. A voice assistant which can order dry cleaning is better than an assistant that can’t order dry cleaning. Overall there isn’t a trade off between the two. One has an additional ‘ability’ with no downside to adding that ability. You would have to make a voice assistant that only handled one domain to escape this constraint. 

Wide Software isn’t magical. Wide software does too many things to be incredible at any of them. Since there are countless features the team has to spend a lot of time making sure they don’t break anything. In software leviathans not breaking things is particularly difficult because nobody actually knows what all the features are. 

Since wide software is always being pushed to add something new. Energy and design focus are constantly shifted towards new features and problem domains. New domains expect old domains to support new features. 

Wide software suffers another problem which is that even if some domains in the project are invested in continually say music for example. Even if music functionality is iterated on again and again. That particular domain being awesome doesn’t change the flavor of the beast. It is still a ball of mud, dirt, rocks, etc.