ruby elixir
I have been writing Elixir full-time for about a year, but I came to it from Ruby. As you probably know, Elixir was created by a former Ruby developer, José Valim, and his idea was to keep the beautiful syntax of Ruby in Elixir.
我一直在专职撰写Elixir,但我是从Ruby来的。 您可能知道,Elixir由前Ruby开发人员JoséValim创建,他的想法是将Ruby的漂亮语法保留在Elixir中。
In the company I currently work for, we created an Elixir School to help other colleagues start developing in Elixir. They’re mainly Ruby developers, but also some front-end developers want to study it.
在我目前工作的公司中,我们创建了一家Elixir学校,以帮助其他同事开始在Elixir中发展。 他们主要是Ruby开发人员,但也有一些前端开发人员想要研究它。
For one of the lessons, I created slides with a syntax comparison of Elixir, Ruby, and JavaScript. In this article, I would like to share that with you.
对于其中一课,我创建了具有Elixir,Ruby和JavaScript语法比较的幻灯片。 在本文中,我想与您分享。
串 (String)
原子 (Atom)
布尔型 (Boolean)
清单 (List)
元组 (Tuple)
列表与元组 (List vs Tuple)
Lists are stored in memory as linked lists, meaning that each element in a list holds its value and points to the following element until the end of the list is reached. This means accessing the length of a list is a linear operation: we need to traverse the whole list in order to figure out its size.
列表以链接列表的形式存储在内存中,这意味着列表中的每个元素都保留其值并指向下一个元素,直到到达列表的末尾。 这意味着访问列表的长度是线性操作:我们需要遍历整个列表才能确定其大小。
You will find a good explanation in AppSignal article about this, I highly recommend you read it, as it is important to understand.
您将在AppSignal文章中找到关于此的很好的解释,我强烈建议您阅读它,因为它很重要。
地图 (Map)
零 (Nil)
插补 (Interpolation)
串联字符串 (Concatenation String)
串联列表 (Concatenation List)
范围 (Range)
If语句和三元运算符 (If statement and Ternary operator)
案例陈述 (Case Statement)
管道操作员 (Pipe Operator)
理解 (Comprehension)
匿名函数 (Anonymous Function)
定义模块和功能 (Define Module and Function)
All slides you can be found on my speaker deck.
您可以在我的扬声器甲板上找到所有的幻灯片。
The links that helped create this article:
有助于创建本文的链接:
翻译自: https://medium.com/@vermaxik/compare-elixir-with-ruby-and-javascript-syntax-61cf599f262d
ruby elixir