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

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
jerry
Good day to you all. I have been struggling to get a query involving like and ilike to work. Can anyone assist me on this, please? pro...
New
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
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
Phillipp
Hey, I have a NanoPi-M3 and try to install Elixir on their Ubuntu image. I followed the Raspberry Pi installation instructions from the ...
New
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
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
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers' Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
lucidguppy
I have a super simple question about elixir - how would I take a file like this foo bar baz and output a new file that enumerates th...
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New

Other popular topics Top

JakeBecker
TL;DR: I’ve just released an implementation of Microsoft’s IDE-independent Language Server Protocol for Elixir. It adds language support ...
1140 51847 244
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
ycv005
I have followed this StackOverflow post to install the specific version of Erlang. And When I am running mix ecto.setup then getting fol...
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod -- where is this set? Thanks.
New
mcarvalho
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
New
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list....
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New
lucidguppy
I have a super simple question about elixir - how would I take a file like this foo bar baz and output a new file that enumerates th...
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New

We're in Beta

About us Mission Statement