Hidden Functions

Are there advantages/disadvantages to using hidden functions in a watchface vs functions?  Currently all my data retrieval functions are hidden functions however I have discovered I can't use callbacks with hidden functions, so I am thinking about changing them all to functions.  

  • I'm not sure if it still is the case with the current SDK version, but a while back hidden functions, variables generated less code, which was important to me in my datafield. You can try this:

    1. in VSC > Extensions tab > Monkey C > Extension Settings > Monkey C: Compiler Options
    add: "--build-stats=0" (without the double quotes)

    2. build or run your project and note the printed code, data size

    3. switch hidden to public (or the other way around)

    4. build or run and compare the printed numbers

  • Thanks for the help.  I will give this a try.  I usually review the memory usage, profiler stats, keep on eye on the build file size for my watch...but have not used the build-stats...

  • You'll see the same in the memory viewer, but with more clicks. If you're optimizing for size then this is an easy way to compare. Since you're working on a WF you might not want to optimize for size though.