← Back to context

Comment by devoutsalsa

1 day ago

You can write a single file Elixir app if you want to. There's nothing preventing this. Setting up a simple web server w/ Plug is straightforward. You'll have the same problems you'd have with a non-trivial Flask app, which is that scrolling through a huge file is a pain.

My only issue when it comes to Erlang and Elixir (or Java and Kotlin) is that there are just so many files I need to open and keep track of. I do not blame the languages, of course, but it is the reason for why I use Go for less serious projects instead of Erlang / Elixir, because in Go it would typically be contained in one file, whereas in Elixir it would span across multiple files.

  • You gotta be trolling...

    You're literally responding to someone pointing out you don't need multiple files in elixir.

    And the same is true for Java and kotlin. Heck even the official spring boots demo videos define everything in a single file nowadays.

    Multiple files is just a convention, because otherwise your project will become unhandy eventually. That applies to Go as well.

    • I am talking about the typical / usual case. In fact, you typically use "mix phx.new" for projects using Phoenix in Elixir, and it creates lots of files, as opposed to "import ..." in a single Go file. I never said that it is impossible to do in Elixir (or Java), but it is not the typical case.

      15 replies →