[erlang-questions] Noob question: Need some help to limit process spawing
Sun Aug 16 18:06:31 CEST 2015
On Sun, Aug 16, 2015 at 8:37 AM, Edward Halls <ehalls@REDACTED> wrote:
> Perhaps some better syntax highlighting can help you spot this in the
> A good ide will also tell you when there are unused variables.
Better programming conventions - in particular making the code say
what's going on - is even better than a super intelligent IDE that
tells you what's wrong as you're typing. I turn those helper features
off. Or, I would if Emacs had them on by default.
> On 16 Aug 2015 2:22 pm, "Robert Raschke" <rtrlists@REDACTED> wrote:
>> Could be the typo? Value2 vs Val2.
>> On Aug 16, 2015 12:44 PM, "avinash D'silva" <evnix.com@REDACTED> wrote:
>>> I have these lines code:
>>> "myfunction" looks like this:
This should be a function:
You're making a decision to add this suffix here? Why? A well named
function will make that obvious.
Any time you find yourself adding 2, 3, 4s to the end of a variable,
stop. What's the actual name of the variable there? I mean, what is
it? Use that.
Oh, and "value" should be "term" here. Kidding of course - it's no
doubt a value, but take advantage of the variable name. Just spend a
moment and think about what that thing actually is in the context of
I'd flatten this all out:
>>> case pg2:get_members(Value2) of
>>>  ->
>>> Otherwise ->
to be something like:
I don't know what XXX is here (that's a bad name too) but it should make sense.
>>> the problem is instead of creating a single process of mymodule.
>>> there are 5 processes, as time taken to register the process is more,
I didn't answer your question as I fixate on code clarity and it's an
emotional blocker for me :)
More information about the erlang-questions