[erlang-questions] Trouble with Erlang's lenient comparisons
Wed Apr 13 11:17:09 CEST 2011
Using Typer and Dialyzer is usually what you u need
On Wed, Apr 13, 2011 at 11:08 AM, JohnyTex <ekeroth.christoffer@REDACTED>wrote:
> Hello! :)
> I'm a newbie Erlang programmer, and I've really liked my experience so
> far. However, I've made mistakes related to Erlang's type system a
> couple of times now, more specifically the fact that you can compare
> different types with each other without Erlang complaining.
> I've inherited someone else's code base; sometimes I forget that a
> function returns a tuple and I up comparing it with an integer or
> similar, and get weird behaviour and hard-to-find bugs as a result.
> What's the best way to prevent this? I will try writing some unit
> tests later today with EUnit, and I'm generating PLTs for Dialyzer as
> I write this, but I was wondering if there are any other tools or
> "best practices" that could help me to write more "type safe" code?
> Thanks in advance! :)
> erlang-questions mailing list
- Ahmed Omar
Follow me on twitter
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions