Re: [openstack-dev] [horizon] function expressions vs function declarations in JavaScript

2015-01-15 Thread Aaron Sahlin
Just to expand a bit on Thai's response..   Make the changes to 
horizon/doc/source/contributing.rst and submit a patch, once that gets 
approval then

go update the wiki.

On 1/14/2015 3:49 PM, Thai Q Tran wrote:


Wow, that IS interesting. No process required, just modify 
/horizon/doc/source/contributing.rst and submit a patch.


-Matthew Farina m...@mattfarina.com wrote: -
To: OpenStack Development Mailing List (not for usage questions) 
openstack-dev@lists.openstack.org

From: Matthew Farina m...@mattfarina.com
Date: 01/14/2015 12:20PM
Subject: Re: [openstack-dev] [horizon] function expressions vs 
function declarations in JavaScript


Thai, I'm still poking around at JavaScript things and did a little 
testing on function declarations vs function expressions. Seems 
Firefox is faster with function expressions by quite a bit at parse 
time. For reference see http://jsperf.com/mfer-function-types.


I'm not suggesting what we do. I'm just sharing a data point I found 
surprising.


I'm curious about the process for proposing changes to 
https://wiki.openstack.org/wiki/Horizon/Javascript. Is there any process?



On Wed, Jan 14, 2015 at 1:15 PM, Thai Q Tran tqt...@us.ibm.com 
mailto:tqt...@us.ibm.com wrote:



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 m...@mattfarina.com
mailto:m...@mattfarina.com wrote: -
To: OpenStack Development Mailing List (not for usage questions)
openstack-dev@lists.openstack.org
mailto:openstack-dev@lists.openstack.org
From: Matthew Farina m...@mattfarina.com
mailto:m...@mattfarina.com
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:
openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe:
openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [horizon] function expressions vs function declarations in JavaScript

2015-01-14 Thread Matthew Farina
Thai, I'm still poking around at JavaScript things and did a little testing
on function declarations vs function expressions. Seems Firefox is faster
with function expressions by quite a bit at parse time. For reference see
http://jsperf.com/mfer-function-types.

I'm not suggesting what we do. I'm just sharing a data point I found
surprising.

I'm curious about the process for proposing changes to
https://wiki.openstack.org/wiki/Horizon/Javascript. Is there any process?


On Wed, Jan 14, 2015 at 1:15 PM, Thai Q Tran tqt...@us.ibm.com wrote:


 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 m...@mattfarina.com wrote: -
 To: OpenStack Development Mailing List (not for usage questions) 
 openstack-dev@lists.openstack.org
 From: Matthew Farina m...@mattfarina.com
 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: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
 http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

 __
 OpenStack Development Mailing List (not for usage questions)
 Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
 http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [horizon] function expressions vs function declarations in JavaScript

2015-01-14 Thread Thai Q Tran
Wow, that IS interesting. No process required, just modify /horizon/doc/source/contributing.rst and submit a patch.-Matthew Farina m...@mattfarina.com wrote: -To: "OpenStack Development Mailing List (not for usage questions)" openstack-dev@lists.openstack.orgFrom: Matthew Farina m...@mattfarina.comDate: 01/14/2015 12:20PMSubject: Re: [openstack-dev] [horizon] function expressions vs function declarations in _javascript_Thai, I'm still poking around at _javascript_ things and did a little testing on function declarations vs function expressions. Seems Firefox is faster with function expressions by quite a bit at parse time. For reference see http://jsperf.com/mfer-function-types.I'm not suggesting what we do. I'm just sharing a data point I found surprising.I'm curious about the process for proposing changes to https://wiki.openstack.org/wiki/Horizon/_javascript_. Is there any process?On Wed, Jan 14, 2015 at 1:15 PM, Thai Q Tran tqt...@us.ibm.com wrote: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 m...@mattfarina.com wrote: -To: "OpenStack Development Mailing List (not for usage questions)" openstack-dev@lists.openstack.orgFrom: Matthew Farina m...@mattfarina.comDate: 01/14/2015 07:04AMSubject: [openstack-dev] [horizon] function expressions vs functiondeclarations 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: openstack-dev-requ...@lists.openstack.org?subject:unsubscribehttp://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

__OpenStack Development Mailing List (not for usage questions)Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribehttp://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


[openstack-dev] [horizon] function expressions vs function declarations in JavaScript

2015-01-14 Thread Matthew Farina
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: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [horizon] function expressions vs function declarations in JavaScript

2015-01-14 Thread Thai Q Tran
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 m...@mattfarina.com wrote: -To: "OpenStack Development Mailing List (not for usage questions)" openstack-dev@lists.openstack.orgFrom: Matthew Farina m...@mattfarina.comDate: 01/14/2015 07:04AMSubject: [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: openstack-dev-requ...@lists.openstack.org?subject:unsubscribehttp://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev