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.


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.

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.

zogger said...

Different devices web designers may utilize incorporate stamp up validators and other testing apparatuses for ease of usability and accessibility to guarantee their web sites meet web accessibility guidelines.

get rid of cellulite said...

Advantageously, the article is really the best on this notable topic. I harmonize with your conclusions and will thirstily look forward to your approaching updates
Mindfulness Courses Dublin

Sameer Sharma said...

Does Earth browser iPhone phone 5s?

Sameer, CouponDadi, India's No.1 Coupon Website

get rid of cellulite said...

I like your site and content. thanks for sharing the information keep updating, looking forward for more posts. Thanks
aanrechtblad kopen

get rid of cellulite said...

I just read through the entire article of yours and it was quite good. This is a great article thanks for sharing this informative information. Its really good article i fully read this content..
verhuizen gouda

get rid of cellulite said...

I just got to this amazing site not long ago. I was actually captured with the piece of resources you have got here. Big thumbs up for making such wonderful blog page!
campfire cooking equipment

Accredited GED Online said...

You completed certain reliable points there. I did a search on the subject and found nearly all persons will agree with your blog.

get rid of cellulite said...

This website is too great, make me happy. Website decoration is very elegant, content is very full, continuously outstanding theme, let a person gutty want to continue down at feeling, and I am enjoying it.
granieten tafelbladen

get rid of cellulite said...

Nice information, many thanks to the author. I believe that anyone who wants to know something about this topic will like the post.I really loved reading blog
hardsten keukenblad

get rid of cellulite said...

Attractive info. Thanks, I am really impressed with the quality of what you have provided in your article.
hardstenen keukenwerkblad

get rid of cellulite said...

The pursuit of truth and beauty is a sphere of activity in which we are permitted to remain children all our lives.
bra tape

idar hartono said...

Things are very open and intensely clear explanation of issues. was truly information. Your website is very beneficial.

fitria maharani said...

Thanks so much for writing all of the excellent information!

fitria maharani said...

I like the post and i a‭m surprised. the way of ex-planing is very good manner.

fitria maharani said...

Thanks a lot for sharing. Will check back later for more of your articles.

fitria maharani said...

This is very nice one and gives indepth information. thanks for this nice article.

fitria maharani said...

thanks for his articel can menembah my insight on the internet,

haidir said...

nice blog, I like to read and I It will not hesitate to visit this site again
tas branded murah
l Financialnewss.com
l www.lagingetren.com

KAK DECO said...

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

Candra Gunwanto said...

Things are very open and intensely clear explanation of issues. was truly information. Your website is very beneficial.

cantika said...

Thank you so much..

mila heibica said...

Thank you very much! My friends and family members will be happy after hearing about this

mila heibica said...

Thank you very much! My friends and family members will be happy after hearing about this

mehroz aftab said...

Actually This post is exactly what I am interested. we need some more good information. Please add more good information that would help others in such good way.

Online High School Diploma said...

Honestly everyone must appreciate your effort I like your blog you made to share the knowledge. The topic here I found was really useful to the topic which I was researching.

High School Diploma Program said...

Valueable post you have shared here keep it up.

cantika said...

I really enjoyed reading that content.
tas wanita branded

Early Childhood Music Tutor Sydney said...

The learning lab is providing the best Maths and English tutor in Sydney and if you are looking for maths tutor for your child contact us now!

Coach Hire UK said...

Well, very good post with informative information. I really appreciate the fact that you approach these topics from a stand point of knowledge and information.Coach Hire UK