Categories
Organization management

On building a tech start-up efficiently without funding

This article was originally published in the blog of Copernicus Accelerator by SpaceTec Partners, Verhaert, and the Copernicus Earth satellite observation programme of European Union.

Building a start-up means building an organisation which seeks to extract revenues from some market.

All organisations consist of people. Communication between people in an organisation takes time. The more people join the communication line, the more time it takes to convey a piece of information between all of them1.

In a bigger organisation, communication could easily take so much time that it will reach the natural limit of human ability. Conveying a message within a group of people could take more time than what the coordinator of the group can afford to spend. Moreover, it can take so long that by the time the message is conveyed to all recipients, the information in the message will be irrelevant or obsolete.

These Human Communication Costs define the limit of how much work can be done when building an organisation as a hierarchical structure2. It is also true for a horizontally organised group of people communicating with each other without a manager.

Examples of a number of connections between members in an organization depending on its size

When building an organisation, a project owner (start-up founder, CEO) risks ending up just communicating and nothing else. In fact, that is how most organisations are built. A project owner’s job could be just to hold meetings all day long.

But from all these appointments, what would be the most efficient company meeting from the Human Communication Costs perspective? It is the meeting in the project owner’s mind where they meet with themselves3.

On the other side, we have the employees and contractors of the company, who – unlike the project owner – possess all the necessary information to implement their tasks.

This is called “the agency dilemma” and because of it there is no guarantee that the CEO’s thoughts and orders will be implemented correctly or on time4. Likewise, there is no assurance that those orders will be relevant or correct.

Now let us remember that there are many business tasks that have already been automated at least partially (especially in the web context), such as marketing (content planning, scheduling, and posting), advertising (bidding and publishing), helpdesk support activities, and the product itself (any software-as-a-service).

The concept of automating a business is not new. However, the idea of automating the process of building an organisation (I call it “computer-aided organisation building”, CAOB) could help avoid Human Communication Costs from the start. With CAOB a project owner can preserve more of their most valuable resource – time.

Moreover, with the support of automation tools, the project owner can mitigate the risks of agency dilemma because any tool – unlike a human – will do exactly what it has been instructed to do.

What does this have to do with start-up funding? To answer this question, I will pose two more questions:

  1. Do you have tasks in your business plan that you could implement yourself faster than the time it takes to delegate it to someone (create a task specification > communicate the specification > follow the implementation > validate the results)?
  2. Do you have any tasks in your business plan that could be implemented with automation software?

If the answer to any of those questions is “yes”, then at least for those tasks you do not need funding. You can start implementing them right now.

You could spend all your time searching for funding just to cover your start-up’s Human Communication Costs. How about using computer-aided organisation building to turn your start-up into a business (instead of after getting funded)?

Your startup’s launch is closer than you might think! Good luck.

1: Wikipedia. Complete Graph Properties – https://en.wikipedia.org/wiki/Complete_graph#Properties. Retrieved 2021-09-09. ↩

2: Frederick P. Brooks, Jr. The Mythical Man-Month. 1995 [1975]. Addison-Wesley. ↩

3: Cliff Harris. Communication. The secret weapon of one-person companies. https://web.archive.org/web/20210116090137/https://www.positech.co.uk/cliffsblog/2020/10/17/communication-the-secret-weapon-of-one-person-companies/. Retrieved 2021-09-09. ↩

4: Wikipedia. Principal–agent problem – https://en.wikipedia.org/wiki/Principal%E2%80%93agent_problem. Retrieved 2021-09-09. ↩

Categories
engineering

Converting outside (JSON) data into Elixir structs

Introduction

When building an Elixir-powered application, you may need to get some data from the outside and create a proper Elixir Struct from it. Structs are more convenient1 than maps2. If your application grows bigger than a couple of .ex files, you might consider using Structs as they provide a guarantee that only defined fields will be allowed in a Struct. In other words, it's easier to mess up key-value usage in a map, than in a Struct.

Problem

When using the Poison library to parse JSON, you get a map, which looks like this: my_map = %{"my_key" => "my_value"}.

If you want to convert that map to a Struct, this will NOT work:

You will get a ...does not implement the Access behaviour error. Structs in Elixir do not allow the Access behaviour3.

Solutions: options

Option 1

Use String.to_existing_atom/1 and Kernel.struct/2 to convert each key in the map. This requires writing some code:

Code snippet author: Patrick Oscity4.

Option 2

Use the as: [%MyStruct{}] option to Poison.decode!5 as recommended by David Tang6. This option does not require any additional coding. However, it also requires some naming discipline: all the fields of your Struct shall exactly match the fields in the incoming JSON. This will give you an error if the JSON has myKey and your Struct has my_key.

Option 3.

If you get more than one JSON object coming in as input, you can use the %{keys: :atoms!} option to Poison.Parser.parse!. With this you will get all JSON parsed into respective Structs. This requires the same naming discipline as Option 2.

A problem with Options 2 and 3

Poison does not respect7 the @enforce_keys attribute of Elixir's defstruct. That is, it will not check for you if the incoming JSON contains all keys that you need in your Struct.

Option 4.

Use Option 1 with @enforce_keys enabled in your Structs. This will guarantee that JSON data with missing keys will not end up in your Structs.

Not an option:

The ExConstructor library8 seems to be abandonded, I don't recommend using it.


1: Structs ↩

2: Maps ↩

3: Access behaviour ↩

4: Elixir - Convert maps to struct - Stackoverflow ↩

5: Poison - Hexdocs ↩

6: Decoding JSON into Elixir Structs ↩

7: Elixir Trickery: Cheating on Structs, And Why It Pays Off ↩

8: ExConstructor - HexDocs ↩