Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

PHP

Leandro Severino
Leandro Severino
12,674 Points

How does loosely typed Languages allocate memory for variables?

How does loosely typed Languages allocate memory for variables?

From some article online:

// start quote

You may be asking yourself, “But how will the computer know how much memory to allocate for that variable?”. The answer is that it just allocates “a lot” of memory.

“But doesn’t that have the potential to be wasteful? For example, we wouldn’t need more than one byte to store the age of a human.”

Yes, it does have the potential to be wasteful. This is the disadvantage to weakly typed languages.

But the thing is that computers these days have so much memory and are so fast that the wastefulness often ends up not mattering. This is a key point.

// end quote

HTH

SRC >> https://www.google.com/search?q=How%20does%20loosely%20typed%20Languages%20allocate%20memory%20for%20variables%3F