Main Site Documentation

Why not while(true)?


#1

Kerry over at the MS Gadgeteer site recently posted this great explanation of the event dispatcher, execution model, and best practices for using them. If you’re new to Gadgeteer hardware and/or coming from smaller FEZ boards or Arduinos, this article will hopefully help prevent some headaches.

http://blogs.msdn.com/b/net_gadgeteer/archive/2011/12/19/why-not-while-true.aspx


#2

Yep, this is a good one.


#3

@ Gus This would be great info to add to your new Gadgeteer eBook.


#4

Curious why Gadgeteer uses ProgramStarted() vs. Main(). Just wondering why one wouldn’t just use main().


#5

@ rocketbob

Just a thought…I have no idea if this is the real reason, but perhaps it’s because if they just used Main() folks would expect it to behave like any other NETMF project, when clearly it does not…


#6

Look at the ProgramStarted as an event that tells you that all background work is done and main loop is running do any custom post start initialization thread creation etc. Main function usually ends the program on exit. When ProgramStarts exits the application is still running.


#7

I understand why, but I don’t understand why this is hardware specific (Gadgeteer) and not applied to the framework.