dogweather

dogweather

The real problem isn't "how do we organize files better?" but rather "why are we organizing files at all?"

I’ve been brainstorming about ways to solve the N-dimensional code organization problem, and am thinking about developing a Smalltalk-like code-browsing experience. Even after I left my Smalltalk job and moved to Java, I configured Eclipse to give me the same IDE experience: an object browser that let me focus on Classes and Methods, which was the level of abstraction I was working at. (And not files.)

How I see the problem:

When developers ask “Where does this file go? What do I call it?”, they’re really asking:

“How do I map this multi-dimensional concept onto a single hierarchical path?”

Example: A customer email notification worker

  • Domain: Customers
  • Technology: Worker
  • Integration: Email
  • Access: Internal

I think that the unit of thought should be:

  • Modules (not files)
  • Functions (not line numbers)
  • Concepts (not directories)
  • Relationships (not imports)

This is probably the most promising direction for truly solving the n-dimensional organization problem.

Most Liked

Taun

Taun

I wholeheartedly agree. As a matter of fact, that was the topic of my talk at this year’s GigCity Elixir.

It wouldn’t be popular with the VI EMACs crew but for those that are willing to use VSCode, might find an IDE that is more like the Smalltalk IDE very useful.

Features like

  • Show me the call tree for this function
  • Show me the headers for functions of this type in this module. Types defined by an @tag.
  • Just show me the function I am working on and just the headers in a list window for all the others. So I don’t have to constantly scroll through a wall of code.
  • If the module file name is by convention, then just use that convention and let me say “new Module X” and create the file but just show me the module definition. I should never need to look for the file. Just apps, modules and functions.
  • Show me the function @doc as it would look rendered in a separate pane from the function definition.
  • Let me easily see all callers as a list based on the AST. Then let me select each caller to drill down. Or let me trace a series of calls using AST and again make each reference a link to the definition. Without losing my place in the tree.
  • Let me select code to be executed right now using local constants and ask me for sample argument values. Or run the @doc iex test by selecting it and run with output in a separate pane/space.
Sorc96

Sorc96

It’s kind of crazy that we somehow haven’t moved past files when it comes to storing our code.

As Kent Beck said: Source code in files? How quaint. How seventies.

I think that at the very least it should be possible to add tags to modules/classes/whatever a language uses so that we can always view the codebase the way we need to. This would remove the endless war between structuring directories by layer vs by domain. We could easily get a by-domain view when working on business logic and a by-layer view when dealing with project-wide infrastructure code, for example.

Of course, the potential is much higher than that and I would love to work with a richer representation of my code.

Nezteb

Nezteb

After playing with Pharo and Glamorous Toolkit a few years ago, I totally understand what you mean by this!

I’m hoping the end-game of the upcoming official Expert LSP implementation gives us a similar experience with Elixir. I’ve not had many issues with ElixirLS and friends, but a unified/official LSP will make our lives so much easier!

lud

lud

I’ve built my own tool for that kind of problem:

mix archive.install hex modkit
mix mod.relocate -i
aviagarwal1212

aviagarwal1212

I think you might like some of the ideas behind unison.

Each Unison definition is identified by a hash of its syntax tree.

Where Next?

Popular in Discussions Top

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
hauleth
Maybe some of you know that there was (is?) something like BERT-RPC which in short is simplified version of External Term Format (also kn...
New
szsoppa
Hey folks! For the third year in a row, we’re running the Elixir Survey by Curiosum! It’s been live since yesterday, and 300+ people hav...
New
tcoopman
Yesterday I watched OpenTelemetry: From Desire to Dashboard and it triggered me to take a new look at telemetry in Elixir. But I don’t k...
New
dogweather
I’ve been brainstorming about ways to solve the N-dimensional code organization problem, and am thinking about developing a Smalltalk-lik...
New
New
karlosmid
The |> operator appears in many languages, mostly in the functional world. F# has essentially the exact same operator, as does OCaml. ...
New
kusokuzeshiki
I tried to generate pages with claude code and fluxon ui. I ask to claude code to generate real world page samples, the results are thes...
New
PragTob
:wave: I’m currently extracting the statistics calculation part from benchee and stumbled upon how to present error conditions. In the c...
New

Other popular topics Top

Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
yurko
Here are few pieces of (common) Linux knowledge that we use for reasonably small one server apps. We use Ubuntu but this should work for ...
New
shahryarjb
Hello, I get Persian date from my client and convert it to normal calendar like this: def jalali_string_to_miladi_english_number(persi...
New
William
I would like to know that is there any online source for learning Phoenix Framework for building E-Commerce Store? Any advantage on build...
New
lessless
I believe there are people here who are dealing with CSV files import on the daily basis, and since Excel is a really popular tool there ...
New
sergio
I couldn’t find any guides that worked well with Phoenix 1.6.0 and esbuild. I hope this helps people test the waters and eases you into t...
New
New
Jim
As a follow up to my earlier question: I have the code compiling and running but not getting a successful login from the rest server. ...
New
danschultzer
None of the current solutions worked well for me, so I went ahead and built a user management system from scratch. This project took far...
548 27727 240
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New

We're in Beta

About us Mission Statement