Tuesday, February 10, 2009

C++ vs AS3

I've been working on an iPhone app for the past week or so and I'm pretty happy to be coding in C++ again I must say. C++ is not perfect by any means, in fact strong binding is a constant thorn in my side after the free and easy ways of Actionscript. Here are a few pros and cons that immediately stood out in moving between the two.

    Pro C++:
  • Variable declaration ("int x" is much better than "var x:int")
  • Enums
  • Templates in general and template meta-programming specifically
  • #defines and conditional compilation
  • Speed of execution

    Pro Actionscript 3:
  • Dynamic typing
  • Static constants of any type
  • Built in associative arrays
  • Built in UTF8 string support
  • Size of compiled code
  • Platform neutrality


In general I prefer C++. Perhaps because it's closer to the hardware and more things are possible, but you really have to know what you are doing to not spin your wheels too much. I *really* miss built in associative arrays and the awesome set of standard objects available in Flash however.

14 comments:

jtg said...

Pointless comparison really.

AS3 pros???...

> # Dynamic typing
AS3 made lots of effort to get away from this.

> # Static constants of any type
Which are simple in c/c++

> # Built in associative arrays
STL has all this and lot more

> # Built in UTF8 string support
Or _only_ UTF8 support.

> # Size of compiled code
Well much bigger if you include the runtime size too.

> # Platform neutrality

The C/C++ language itself is very platform neutral. Its the libraries you make use of that arent always and also the compiler choice.

This is all not to say that there are no AS3 benefits! Quite the opposite. More to point out the bullets you listed are really not accurate.

I would say AS3 benefits...
- way easier to learn and compile
- only have one runtime to consider
- ease to create rich GUI
- web and desktop targetting

(amonst probably others).

Also, you were not using Objective C for iphoine dev then?!

John said...

ITemplatez.com offers professional Professional flash templates, Swish Templates and web design templates

mchl_angls said...

quality WEB DESIGN advertisin :}

Anonymous said...

flex sdk supports conditional compilation

redseadragon said...

Hi, i'm from GameDev.net where I am trying to figure out aproximatly how much faster C++ is then AS3 for the forum http://www.gamedev.net/community/forums/topic.asp?topic_id=552507&whichpage=1&#3552926 . If you could post a comment stating some of your experiances/findings that I could quote there, that would be great!

FreeThemes4all Staff said...

Thank you so much... You can get a Nice Website Templates From Free Website Templates Download and Free Web Templates That gona be helpful!!

Anonymous said...

As3 is the best and i will never think that c++ is better than as3

Alexis Bob said...

A common goal among experienced web developers is to develop and deploy applications that are flexible and easily maintainable. An important consideration in reaching this goal is the separation of business logic from presentation logic. Developers use web template systems (with varying degrees of success) to maintain this separation.

Thanks
Alexis Bob
web design company

Makayla said...

Great, thanks for sharing this! I've heard a lot about it, but haven't tried it yet. Your brief review really convinced me, so I might just try it this weekend.

Nate Ranford said...

Next to C++, what other app would you prefer? Thank you!

Web development Company said...

This is the good news.The information you provide is very useful for me.Thank you for sharing it.I will come to see if you have new post every day.

Twin Cities Web Design said...

How do we check to see if all of things can work out and if the work for the same cases of business.

Minneapolis Internet Marketing said...

Where to find all things like these suggestion and other ways of website.

Faribault Web Design said...

Good ones. I will test to see if that works out for my cases.