At some point in the past, Erlang had become cooler than Ruby
Umm... When exactly was that? I've been following these two languages for about 14 years and could not recall anything like that.
What to expect from a programming language that, when you assign a value to a constant, raises a warning instead of an error? And the program keeps going!
The same could be applied to Ruby, BTW. Although Ruby does not have const keyword.
Umm... When exactly was that? I've been following these two languages for about 14 years and could not recall anything like that.
It was about 2014~2016, I guess. You maybe have missed it, the hype was strong.
The same could be applied to Ruby, BTW. Although Ruby does not have const keyword.
So it cannot be applied to Ruby, since Ruby doesn’t have const keyword. 😜
I’m talking about thinks like this:
julia> const a = 1
1
julia> a = 2
WARNING: redefinition of constant a. This may fail, cause incorrect answers, or produce other errors.
2
julia> a
2
julia>
So it cannot be applied to Ruby, since Ruby doesn’t have const keyword.
But it has constants.
irb(main):001:0> PI = 3.14
=> 3.14
irb(main):002:0> PI = 4.01
(irb):2: warning: already initialized constant PI
(irb):1: warning: previous definition of PI was here
=> 4.01
I’m not defending Ruby, I don’t recommend Ruby to anyone, I’m just trying to be fair in my hits. You cannot expect to write an immutable variable in Ruby – Ruby doesn’t propose to support such a feature.
But, when you write a constant in Julia, it’s fair to expect it to be constant. 🤷
(But it isn’t.)
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Umm... When exactly was that? I've been following these two languages for about 14 years and could not recall anything like that.
The same could be applied to Ruby, BTW. Although Ruby does not have
const
keyword.It was about 2014~2016, I guess. You maybe have missed it, the hype was strong.
So it cannot be applied to Ruby, since Ruby doesn’t have
const
keyword. 😜I’m talking about thinks like this:
But it has constants.
However, at no time Ruby tries to mislead you by using the token
const
– which is the point.But I have to admit it shouldn’t use the word “constant” anywhere, not in code (it doesn’t), not in documentation (it does).
I’m not defending Ruby, I don’t recommend Ruby to anyone, I’m just trying to be fair in my hits. You cannot expect to write an immutable variable in Ruby – Ruby doesn’t propose to support such a feature.
But, when you write a constant in Julia, it’s fair to expect it to be constant. 🤷
(But it isn’t.)