Book Image

haXe 2 Beginner's Guide

5 (1)
Book Image

haXe 2 Beginner's Guide

5 (1)

Overview of this book

Table of Contents (21 chapters)
haxe 2
Credits
Foreword
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Warning


In this chapter we've talked about the Dynamic type. We've been discussing this all through the chapter, but it is important to say it again: the Dynamic type is there to tell the compiler not to do any type checking.

Although the compiler won't complain, it doesn't mean that your code will run correctly. It will depend on the runtime. So, if you're targeting JavaScript which is a dynamic language it is likely that it will work without any problem, but if you're targeting a more static runtime there are chances that you will get into troubles for using Dynamic too much.

Most of the time, Dynamic is used when trying to use some native features of the runtime you're targeting or for interoperability purposes. It can also be used sometimes just to ease development.

It is highly advised to limit the usage of Dynamic as much as possible to avoid problems.