It was definitely an interesting the read, I never really noticed the subtle difference. Since then I have also read a few other thoughts on it.
For me, function declarations can get convoluted very fast if not use correctly.
Surely, you should never define functions inside of an if statement, and quite confusing to do it after a return statement.
But they do have their uses when used correctly.
I think it ultimately depends on what you are trying to do and whether it make sense to use declarations vs expressions.
As long as people understand the difference, and take it case-by-case, its not really something I'm going to mull over too much.

-----Matthew Farina <[email protected]> wrote: -----
To: "OpenStack Development Mailing List (not for usage questions)" <[email protected]>
From: Matthew Farina <[email protected]>
Date: 01/14/2015 07:04AM
Subject: [openstack-dev] [horizon] function expressions vs function declarations in _javascript_

_javascript_ has multiple ways to deal with functions. There are function declarations and function expressions (and named function expressions).

In looking at some reviews and the current code I found some inconsistencies which leads me to ask, is there any guidance for handling this in Horizon? I noticed no documentation in https://wiki.openstack.org/wiki/Horizon/_javascript_.

Thanks,
Matt


__________________________________________________________________________
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: [email protected]?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
__________________________________________________________________________
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: [email protected]?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

Reply via email to