Rolling

Rolling

Experience with Elixir in comparision to R - how to develop without something like RStudio?

Hello,

In the last several months I tried to learn Elixir and Phoenix. Thanks to some good learning material I think I have learned the basics.

I have some experience with some other programming languages, mainly Java and R. Both have an exceptional IDE (intelliJ and RStudio) which support me a lot in my daily routines (commands on cli, debugging, etc.).

While I feel it is not so hard to think in functional programming (coming from an OOP background), it is very hard for me to program “blindly” in Elixir. In RStudio I can always see and inspect all the variables in memory so I can step through my code line by line and see how it changes my variables. My approach to programming is trial and error: I write a new line of code, try it (in most cases by using breakpoints and then inspect my variables, but in RStudio you also can execute just a selected line) and when it does what I wanted it to do I move to the next line…

I miss this extremely when I am developing with Elixir so I guess I’m doing it wrong. What is the right approach with Elixir? Writing testing functions? Are there any guides/tutorials for this?

The books I know show and explain what is the correct code, but not how to come to it. Hopefully you can understand what I mean. It is not so easy to explain…

Most Liked

pmangalakader

pmangalakader

Have you happened to use the pry feature in elixir ? and also try to use observer which provides certain monitoring facilities…

This thread here is very much related to this:

Also, this uses Visual Studio Code, that provides some GUI comfortability:

https://forum.elixirforum.net/search?q=visual%20studio

There are various plugins for Vim, Atom, etc., please do check the elixir-lang official site for supported editors.

Thanks.

AstonJ

AstonJ

Welcome to the community :023:

We have a few options - tho many are not a full blown IDE they come pretty close :smiley:

First, you may find this poll interesting:

And here are some other threads of interest:

And a few more at the code-editors tag.

On the Elixir website there is also a list of code editor support with install instructions :smiley:

CODE EDITOR SUPPORT

I’d recommend trying a few and seeing which one you prefer, and if you run into any issues or have any other questions just let us know :smiley:

Rolling

Rolling

I was afraid of being misunderstood by not being able to explaining my situation properly…

I am not so much looking for an IDE. I know that there is not some thing as RStudio.

I wanted to know how people program in Elixir. Do they know exactly that every code line is correct so that they do not need to see the variables’ values at any time? No need to debug?

I will have a look at ‘pry’, thanks.

kokolegorille

kokolegorille

It is not usual to follow variables changes because variables are immutable.

You might get used to sequential coding, but it’s more

input -> function -> output

or more like a pipeline of transformation… like

output = input
|> apply_change1()
|> apply_change2()
|> apply_change3()

In that case, You can insert some inspect/1 in the pipeline to see how data changes.

csisnett

csisnett

@Rolling Welcome to the forum!

When I start writing a function and I want to experiment I usually do the following :

start an iex session: iex -S mix, alias Project.Module the modules I’m using so that I don’t have to write the long names every time I’m just use Module to refer to them

Whatever operations I wanted to do inside the function I try them in the console one by one, check that they work as expected or fix them

To get the values from a specific expression I usually do:

iex (5)> 2+2
4
iex (6)> var = v 5
4

and if I change a module I need to load it again: r Module in order to be able to call the updated functions

Where Next?

Popular in Questions Top

belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
sergio
In Ruby, I can go: User.find_by(email: "foobar@email.com").update(email: "hello@email.com") How can I do something similar in Elixir? ...
New
pmjoe
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
yawaramin
In the Dialyzer docs ( http://erlang.org/doc/man/dialyzer.html#requesting-or-suppressing-warnings-in-source-files ), there is a way to tu...
New
LegitStack
I’m hoping you guys can give me some general advice and perhaps code examples if you’re feeling up to it. I’m very interested in Elixir,...
New
Kagamiiiii
Student & New to elixir. Nice language. I want to convert a english character, e.g. “a”, which is stored in a variable, to it’s asci...
New
sacepums
Hey guys. I'm new to elixir and im really stocked about it. But I ran into a bit of problem - I need to convert a date sting, for examp...
New
sabri
Can someone explain the settings of pool_size of Ecto in config file? and what is the recommend size? Thanks
New
wernerlaude
In AR this is so simple @articles = current_user.articles How to do in Ecto? def index(conn, _params) do current_user = conn.assig...
New

Other popular topics Top

minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
fireproofsocks
I’m working on defining a simple Ecto schema for a table (in PostGres), but I don’t see where I can define a column as NOT NULL. Conside...
New
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 record...
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
qwerescape
Is there a way to get the call stack or stack trace at any point in the code? Not from exceptions, but an expression that returns how the...
New
johnnyicon
Hi all, I've just started learning Elixir and Phoenix Framework, so please pardon my n00bness at this stage. I'm trying to use Postg...
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
Fl4m3Ph03n1x
About me? ( if you have nothing better to do than reading about some random guy in the internet :stuck_out_tongue: ) Hello all, this is ...
New
Nvim
Elixir appears to be a superior language to Python. I don’t see any advantage of Python over Elixir. Are there any?
New

We're in Beta

About us Mission Statement