Creating a new variable versus assigning an existing one
Posted
by
rwallace
on Programmers
See other posts from Programmers
or by rwallace
Published on 2012-04-14T18:12:56Z
Indexed on
2012/04/14
23:46 UTC
Read the original article
Hit count: 240
programming-languages
|language-design
Which is more common, creating a new variable versus assigning an existing variable (field, array element etc - anything that syntactically uses the assignment operator)?
The reason I ask is that I'm designing a new language, and wondering which of these two operations should get the shorter syntax. It's not intended to be a pure functional language, or the question wouldn't arise, so I'd ideally like to count usage across large existing code bases in procedural and object-oriented languages like C, C++ and Java, though as far as I can see there isn't an easy way to do this automatically, and going by memory and eyeball, neither is obviously more common than the other.
© Programmers or respective owner