4 ms·
Unfamiliar syntax is not the same as bad syntax. Erlang’s syntax is much simpler than Elixir’s, and generally more concise.
by macintux 7y ago
Unfamiliar syntax is not the same as bad syntax. Erlang’s syntax is much simpler than Elixir’s, and generally more concise.
- crusso 7y agoI guess it depends upon what you mean by "unfamiliar". Erlang's syntax is unnecessarily divergent from a lot of mainstream languages. So much so that it makes it more difficult for mainstream developers to get into. Elixir was modeled after Ruby for a reason. That reason was Ruby's very approachable and intuitive syntax.
- deleted 7y ago[deleted]
- lostcolony 7y agoIt makes it easier for people to dismiss it; it actually is easier to learn. Erlang it took me two weeks to become proficient enough to write useful things, without any real FP background. That includes leveraging OTP. Even with that in place (plus a lot of Java, Javascript, some others, plus many more years of experience), it took me longer to be comfortable with Elixir, and there are still bits that surprise me or bite me (pinning a variable to match it rather than rebind it, macros, etc).
- Jtsummers 7y agoWhat's hard about Erlang's syntax? People keep telling me it's hard, but I was literally failing out of college at the time and still managed to learn it without much trouble (perhaps a month of occasional practice). I give that context because I can't imagine that I was struggling that much with school if I'm significantly above average for our field.
- crusso 7y ago"People keep telling me it's hard" Shouldn't that be enough to let you know that people at least don't find it to be intuitive?
- Jtsummers 7y agoNo, because no one has ever explained how it's hard. They just keep repeating that refrain, and to date I haven't heard it from someone who spent more than a day with the language or gave it any serious consideration. If people can enumerate the problems with the language (like I've seen or done for other languages), then I'll entertain the complaint. So far the closest thing to a real complaint has been about variables-not-being-variables (in the C, anything can change, sense). But this is 2020, mutable-by-default is a known bad idea so this is hardly novel or a challenge. The other reason I've heard is the lack of loops. If a professional programmer can't handle recursion, they need to go back to basics. I'm not trying to be mean with that one, but recursion is pretty easy.
- rukittenme 7y agoI agree with you. Erlang is not as hard as people make it out to be. However... Look at this piece of code: https://github.com/erlang/rebar3/blob/master/src/r3.erl#L32-L58 https://github.com/erlang/rebar3/blob/master/src/r3.erl#L32-... In this example the keyword "end" ends with "", ";", and "." all within 6 lines of each other. In this example the keyword "ok" ends with "" and ";". In this example `Self` "exclamation marks" `Ref`. All of this is easily understood with some experience but you have to admit that `erlang.send(Self, Ref)` is much more easily understood than some symbol that has to be googled. And consider this, a junior dev is going to be overwhelmed with all the syntactic sugar. They're just learning how to define and call functions. All of these issues matter if your goal is to on-board as many hobbyists and juniors as possible. (Which shouldn't be the goal of every language). I'm very happy with Erlang. I don't want it to change.
- Supermancho 7y agoI have written a few thousand lines of erlang over the years. > No, because no one has ever explained how it's hard. > recursion is pretty easy. uh, sure. Let's talk about syntactical problems. %% instead of // for comments because legacy+ =:= is === and /= is != , it's legacy+ Macros, atoms and functions are differentiated by context not syntax (?macros do have something). The capital letter variable name is basically an ever changing indicator. PHP $ or perl @ or some consistent indicator would be an improvement+ String handling is terrible, to this day and remember shell:strings(false) because legacy. Screw it, let's hide it in the gotchas of the manual and wait. Some BIFs are named poorly. eg apply instead of "dynamic_call". This is the correct way to look at branching decision syntax: if X < 0 -> negative ; X > 0 -> positive ; X == 0 -> zero end The language doesn't help us with this for no apparent reason, with semicolons almost universally ending up on the end of expressions (sometimes): if X < 0 -> negative; X > 0 -> positive; X == 0 -> zero end + The problems are obviously user hostile and elixir and I magically overlapped. Anything with a trailing + was addressed in elixir which I did not know for sure before writing this list The entire Erlang community response is basically the same (mailing list onward). Any attack on the syntax is either regarded as immaturity or whataboutism so people have just stopped talking about it like when someone gets an unfortunate face tattoo. The problems remain.