Short Erlang function to demonstrate hd and tl
First, your code sample does not produce warnings under the Erlang compiler (I'm almost certain that specific version does not matter).

$ cat bar.erl
-module(bar).

-export([headAndTail/1]).

headAndTail(List) -&gt;
  Head = hd(List),
  Tail = tl(List),
  {Head, Tail}.

$ erlc bar.erl 
$ 




Now, regarding bad practises, the only comment is that what you are trying to do with hd and tl is usually done with pattern matching in functional programming languages:

headAndTail([Head|Tail]) -&gt;
    {Head, Tail}.


Another minor bad practise is that Erlang's common naming convention does not use CamelCase for function names, preferring names_with_underscores instead. CamelCase is ok for variables.