lud

lud

Hi,

I hope this is not too silly as a subject but I need your input, specially from native english speakers.

If you look at gen_fsm, you will see that the State is generally a short term, like open or close, while the term Data contains, well, the data of the FSM.
In a GenServer, the term state can be short but will often contain more than that, generally multiple maps, monitors, caches, etc. Since my beginnings in Erlang, I used to call state the representation of the data carried along in some process or group of functions.

Then there is the word status. In french, we have statut, which is a literal transaltion, and can be used to describe a single word representing a person status, like the facebook status “single” or “engaged” (don’t know the real english terms for facebook).

I am working with Java developers who use status to represent the full state of an entity, a system, etc. whereas state is generally implemented with a Java enum, like ONLINE, OFFLINE, etc. We extensively use both words and I am sometimes confused when I have to name things.

From my research it seems that they are right, and that state should be a short term like in gen_fsm, and status should be the more complex data structure.

So I would like the opinion of Erlang/Elixir developers because in those languages the state word is also used extensively to represent data structures.

Thanks!

Showing Posts 1 to 8

John-Goff

John-Goff

This one is really up in the air in my opinion, I could see arguments made in either direction. My gut instinct as a native English speaker is to say that the state would be a more complex representation and status would be a shorter, more ephemeral bit of data. I’m also biased by my experiences though, so I’m probably more naturally inclined to the elixir/erlang way of doing things.

al2o3cr

al2o3cr

Erlang has opinions about what both of those words should be used for: see :sys.get_state and :sys.get_status.

Sebb

Sebb

gen_fsm uses state just because its a state-machine implementation.
But that does not mean that state has to be “a short term”.
If you look at UML Statemachines for example, you have extended state also. (Not “(extended) status”).

dimitarvp

dimitarvp

As a non-native English speaker, I had the same impression. Status is stuff like “order has been paid”, or “message delivery failed”, or “rent is past due” etc. It’s often just one small piece of data, bound to one object.

State on the other hand feels much more like a bigger thing that’s being kept somewhere persistently. You can say that your building’s utility payments is state (usually kept on paper by one person). Also your taxes are state. An Ecto.Changeset is a state that you pass around and maybe modify and pass the new version to another function. A database is state. :ets cache is a state. Redis / Kafka queues are state.

lud

lud OP

Thank you all, for the time being it seems that we lean towards the small-status / big-state way.

ityonemo

ityonemo

Also to pdimitar’s comment I would also say that by convention, status is not only “short” but also usually taken from a finite and enumerated set of options

lud

lud OP

Good remark! There is also a part about that just in @Sebb 's link Status vs State - #4 by Sebb.

derek-zhou

derek-zhou

I am no native English speaker, but I’ll give my 2 cents anyway.

Status sounds like an abstraction, something that will last for a while, eg: IRC status, marital status.

State when used in this sense feels like much more short term, ephemeral, eg: state of mind.

— All posts loaded —

Where Next? Top

Trending in Discussions Top

AstonJ
As the title says, please share what you’ve been up to with Elixir. Whether that’s been learning it, looking into it, making stuff with i...
2977 94592 917
New
cblavier
Hey there, It’s been more than a year since we started using LiveView as our main UI library and building a whole library of UI componen...
New
mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
heathen
Quite interesting article Google brought me. Didn’t find any mentions about it here. What do you think in general? Would you use togethe...
New
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
New
axelson
Hi there! :wave: @frigidcode and I (but mostly him) have been running an Elixir Book club, we’re almost done with Designing Elixir Syste...
New
budgie
A little off-topic, but I feel like people here have a good head on their shoulders. I used to be quite good at making software. Was luc...
New

Other Trending Topics Top

GenericJam
Edit: 2026 May 15 - This post is archived. Mob is alive!! Main docs: mob v0.7.11 — Documentation A bit of explanation for the slightly c...
New
JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
georgeguimaraes
Just published claude-code-elixir, a plugin marketplace for Claude Code with Elixir support. These are the plugins I’ve been using for my...
New
Dmk
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews