3,244 karma · joined March 19, 2014
I don't want to get into it but Erlang is dynamic by design. There have been several attempts to bring static typing to it over the years which have failed. People are still trying, though!
Really though who cares? `=` is already misused in most programming languages.
Learn multiple languages.
The whole "I want to do everything in the language I already know" is why the least interesting--and straight-up pretty terrible albeit very capable--languages are dominating our field.
As I understand it, there have been a few "high profile" attempts to bring static typing to Erlang, all of which gave up when it came to typing messages. Your comment essentially confirms my bias, but is Gleam making real strides in solving this, or is it poised to merely cater to those who demand static-typing with curly braces--everything-else-be-dammed?
Erlang and Elixir don't overload the `+` operator. In fact, they don't overload ANY operators. If you can forgive the syntactic choice of the operator itself (which I think it pretty fair considering Erlang predates Postgres by a decade and F# by two decades), this allows them to be dynamic while maintaining a pretty high level of runtime type safety. For example, one of the "subtle bugs" people refer to when criticizing dynamic languages (even strongly typed dynamic languages) is the following would work when both args are given strings or numbers:
function add(a, b) { a + b }
Erlang/Elixir eliminate this particular subtle bug (and it goes beyond strings and numbers) since: def add(a, b), do: a + b
will only work on numbers and raise if given strings.I was responding to your blanket claim that server-side is misguided in general.
I have no idea what you consider complex, but most people pushing toward server side UI are not advocating that it's a one-stop solution, just that it simplifies a large majority of situations that many of us are in which is building CRUD apps. You can even get pretty complex, like say an email client though at that point we're in a grey area where you could kind of go either way. If we're talking something like building PhotoShop in-browser or even a calendar or gantt chart (which I have worked on) then, no, I would not personally advocate server side and instead use a good client-side view library.
The Elixir/Erlang comment was that it makes server-side even easier as you can hop into running production systems and debug them.
This was my experience as well.
That's the result of Elixir being dynamic and not having built-in monads. You always have to check the docs/code.
> The other thing is that sometimes a function can both throw an exception and also return a success tuple.
I would say this is just poor design (though maybe someone could point me to an exemplary use of this?). As I see it (which is from how I've read it described and how most good lib do it):
- If function can error and the caller can do something about it, return :ok/:error.
- If the caller can't do anything about the error, raise.
- If the function can't fail, return a raw value.- Map keys (called with '.') are checked at compile time.
- Using comparison operators with different types causes a warning.
I may be forgetting something.
def initialize(name => ::String, age => ::Numeric)
@name = name
@age = age
end
or better yet? def initialize(name => String, age => Numeric)
@name = name
@age = age
end
I've been out of Ruby for a while so I don't understand by why the top level qualifiers are necessary.I worked for a very small online retail company recently (I know it's not exactly the same but in the same vein) and raising the price for $18—$40 items by $5 had zero affect on the number of people placing (sales weren't amazing but not bad).
But ya, in the first line you say you made $15k over....... FOUR YEARS? Obviously that's a bunch for some people, but certainly not MOST people in tech?? You could have made much more and had a lot more fun bartending or even being a barista.
Having read the whole post... keep it up! Just raise your prices by... like, a LOT! Like, a lot a lot!
And yes, see also people who print emails so they can scan them XD
I do see what you mean, of course, and am aware of the arguments but I've never found lack of non-whitespace expression terminator even remotely confusing. I can clearly see indentation in my periphery signalling that it's multi-line. I can also say that in ~13 of using exclusively using semicolon-less languages, I've never had or even heard of a problem caused by someone misunderstanding where an expression ends.
Anyway, this is getting pretty bikesheddy, lol but ya, to each their own, obviously.