# Declaring variables using "," ? opinions? facts?

**URL:** https://forum.kirupa.com/t/declaring-variables-using-opinions-facts/302341
**Category:** Uncategorized
**Created:** [December 28, 2009, 1:46am UTC](https://forum.kirupa.com/t/declaring-variables-using-opinions-facts/302341 "2009-12-28T01:46:47Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Shaedo](https://avatars.discourse-cdn.com/v4/letter/s/e19b73/32.png) [@Shaedo](https://forum.kirupa.com/u/Shaedo)
#### Post date: [December 28, 2009, 1:46am UTC](https://forum.kirupa.com/t/declaring-variables-using-opinions-facts/302341/1 "2009-12-28T01:46:47Z")

</div>

Was after some more information on declaring variables using “,” ? any opinions? any known facts?

[QUOTE=wvxvw;2526675]Yet another thing - don’t declare variables using “,” - apart from being a bad style, it doesn’t work good with normal editors, and… well, the compiler does a very hard job parsing AS3 code - don’t make it’s life even harder 😉  
That’s for whatever reason is an accepted practice in languages like C++, but in AS3 it simply doesn’t make sense.[/QUOTE] (I hope I have not quoted this out of context and will edit it asap if I have)

but

> Var declarations on multiple lines vs. Var declarations on a single line

If you need to declare a few variables it’s slightly more efficient to do so on a single line i.e.  
var a:int=0, b:int=0, c:int=0;  
vs.  
var a:int=0;  
var b:int=0;  
var c:int=0;

> **[Tips on how to write efficient AS3 - Lost In Actionscript](https://lostinactionscript.com/tips-on-how-to-write-efficient-as3/)**
>
> Just recently I have needed an in depth understanding of AS3 efficiency practises, so I figured this is easiest done by getting involved in a series of relevant tests. Though there are similar blog posts regarding this most have been focused on...

Personally I am something of an efficiency fanatic, to the extent that my expertise will allow, but using commas to declare multiple vars gives me the 5#175 due to legibility, so I don’t, also I don’t trust any flash optimisation claims that don’t have code examples I can test on the current build.
