Question

Easy question.

Does the code between comment tags get compiled?

// I'm a comment
/* I'm another comment */
Was it helpful?

Solution

Here's the proof.

enter image description here

I created an empty project and compiled it twice. One was the bare minimum (I compiled immediately after creation) and the other had ~2000 comments. The comments were a mix of the following:

/**
 * This is a comment
 */

// this is a comment

/*
    This is a comment
*/

Repeated a few hundred times each, the Main.as file jumped from 134 bytes to 32KB. This most definitely should have raised the final size of the SWF if the comments had been included. Instead, they were both exactly the same size, at 608 bytes (a fraction of the total size of the code in the file with the comments).

So, as logic would tell you, no, the compiler does not include comments.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top