Open Sourcing a watch face - Almost nobody does it

Hi, first time poster, so sorry if I break some rules I don’t know about.

I wrote my own watch face. The reason was that all watch faces had a little something that annoyed me, so I figured I’d write my own and make it perfect! The greatest example I found was the Crystal watch face that was open sourced. Without that, I would have given up. So after a while, I have MY perfect watch face, and put it on the store for one of my friends to download (and also because I was proud of what I had done), and I quickly realized that perfect for me did not mean perfect for others. i started adding features as requests, but then I became a bit tired of writing features that were useless to me since I don’t wish to make money off of this.

So I thought of making my watch face Open Source, and people can write their own features! And some of those features might be awesome and then I could use them too! But that got me thinking of what if people use my code, and make it better or develop awesome features, but don’t give them to me? Or make their own version and take the credit? Or charge for it?

So I looked at these forums for Open Source watch faces, and there are very few. The best thread was started 6 years ago and has a handful of projects. That makes me think that my idea of having people participating in making awesome watch faces for everyone to use for free might not be shared by many, and I’d end up being the idiot that just gave my code away and didn’t get anything in return (like other awesome watch faces for free).

That was a lot of rambling, but I’d like to get some of you guys’ take on open sourcing your code. 

BTW, in case someone is interested, the WF I am thinking of open sourcing is this one: https://apps.garmin.com/en-US/apps/930e1652-f94a-4d2a-a658-30c81c4a4362#0

  • Personally I don't open source my apps because:

    - some of them are fairly unique/niche and I'd prefer not to have clones in the app store (although they're niche enough that perhaps nobody would bother)

    - perhaps more importantly, the code is terrible because of several corners I cut in order to save memory

    It's not the same thing, but I did contribute to an open-source UI library for CIQ, and of course I forked the repo and pushed my changes.

  • That was the thread I was talking about. I have to admit that now that you have posted it and I have looked at it again, there are more projects that were shared than what I remembered. 

    But I still find there are very little, like a couple a year (after the initial boom when the thread started 6 years ago), and also not much interaction that look like "Oh, I'd be interested in contributing to your project" or the like after someone posts a link to his/her code. Maybe those interactions are elewhere, but I have not found them.

    Thanks for answering and pointing out the thread to me.

  • You talk about cutting corners, lol, I'm terribly guilty of that, and my code is horrible as I have tried to limit API calls to a maximum and storing everything in variables in memory, so I do feel like I'd be judged a lot for the code I wrote.

    I see a lot of people actively helping others on the forums, and that is ultra useful also.

  • thanks for sharing your comment FlowState, I feel the same way, and I have also shared another app open source.. I'm still kinda hoping that eventually my app will become used enough to be economically profitable.. haha... 

    I would say my code is not "terrible" though, more like "highly streamlined and efficient and memory-saving" haha.. it's been very education as a developer to have to refactor my code in order to save memory or save processing time when I went too many cycles. Also, having to make it work for the older earlier generation devices, is very educational as far as learning to program using simple tools goes. I am very proud I was able to re-use the same variables multiple times in the same program for different purposes, and saved a lot of memory! 

  • I would also be a bit embarrassed to show my code.

    Although it is suggested here in this forum multiple times that you can't avoid global variables in certain situations. And you should avoid declaring too many classes because of the overhead that causes. All conflicting with the principles of OOP.

    (Having started with Fortran 40 years ago I have in my monkey c program a list of global variables which I have commented as "COMMON BLOCK" as a tribute to old Fortran-times.)

    I have read some comments lately about OOP versus conventional functional programming, and I was surprised that OOP is not considered by everyone as the holy grail.

  • As a programmer for over 40 years, doing a bunch of things like low level OS code, device drivers and embedded systems, it's a matter of using what's best for the task,  I worked on the vm for a OOP language for a number of years (on embedded systems) and used c and assembler.  The vm for monkey C is mainly c from what I understand.

    My CIQ code is fairly clean (been doing it for 8 years), but I don't open source my apps for a different reason.  I've seen cases when someone grabs an open source app, tweaks a few things and then publishes it as their own.  I don't want to compete against what's mainly my code for users!

  • I have read some comments lately about OOP versus conventional functional programming, and I was surprised that OOP is not considered by everyone as the holy grail.

    I mean, functional programming is definitely much trendier these days. (Of course functional programming and OOP are not mutually exclusive, but there's a lot more interest in the former). Even when Monkey C first came out, I saw a few comments lamenting the lack of modern features like functional programming and string interpolation.

    I've worked with C, C++, Java, C#, Python, Javascript, and Typescript (among others, including bespoke domain-specific functional programming languages), and I have to say that I really enjoy functional programming and other modern features (especially string interpolation), when they're available. For example, it sucks working with Typescript for long stretches, then switching back to Java where:

    - string interpolation is not available

    - functional programming is available but there's a ton of "ceremony" associated with it

    One anti-OOP argument I've seen is that it doesn't actually model the real world. Others will retort that it's not supposed to.

    It could also be argued that OOP in unnecessary in many cases: if you look at modern web app development with React, for example, code reuse is accomplished via composition, not inheritance. It's definitely simpler, which is part of the current trend. (And that's a good thing, imo.)

    Although it is suggested here in this forum multiple times that you can't avoid global variables in certain situations. And you should avoid declaring too many classes because of the overhead that causes. All conflicting with the principles of OOP.

    Yeah, well the problem from my POV is that Monkey C gives you a bunch of features like classes and dictionaries which can't even be used without incurring a huge memory cost relative to the available memory on devices. Similarly, application settings consume of a lot memory at run time. On top of that, every string you define for application settings wastes memory at run-time (assuming you load at least one resource), even if those strings are never used in the app itself.

    So Monkey C is designed around OOP, but if you actually write proper OOP code, you waste a lot of memory. Similarly, if you use dictionaries for everything, you waste a lot of memory. CIQ provides app settings, but again, if you actually use them, they could take up 25-50% of the memory available for a data field.

    So one example is that I have an app which largely revolves around "features" - it's an app which provides the user with a data field whose value is calculated based on a formula they enter. Kinda like Excel for your watch. An example of a "feature" would a metric that's exposed to the user (e.g. Speed) or a function which manipulates data in the formula (e.g. Average() or LapAverage()).

    Some of these "features" require data structures which lend themselves very naturally to OOP, like queues. But if I implement a queue using OOP constructs, it consumes a huge amount of memory since objects are expensive in Monkey C. This means that the user gets fewer features, or the maximum complexity of their formula is lower than it could be. When I developed that app, I started out writing "nice" OOP code for everything. Eventually I got rid of almost all the OOP code (except where absolutely necessary, of course) and saved a ton of memory in the process. For example, instead of writing an OOP queue, I just had global functions which passed around simple data structures like arrays. The end result was the same, but the code wasn't nice to look at, use or maintain -- it wouldn't be suitable to be published as a shared library, for example. Def something I wouldn't be interested in sharing, except as an example of how to write memory-efficient code in Monkey C.

    So when I say my code is "terrible" or I "cut corners", I don't mean it's because I don't know how to write better code. I mean that it's largely due to the constraints of the CIQ ecosystem and Monkey C. I could write better code but then I'd have to cut features. My apps are niche but one of the reasons some of them are unique is that they have more features on older / low-memory devices then similar apps. (Vivoactive 4 is still being sold and it has the same amount of memory for data fields as the 7 year old Vivoactive HR, so we can't just say "no problem, just drop support for old devices").

    In contrast, modern development on the majority of platforms is very wasteful in many ways, but we also have the luxury of writing code that's simpler and easier to maintain.

    Also, to be clear, I don't want to invest additional time and effort to make my code suitable for sharing, especially for stuff that I am not actively maintaining.

    I don't open source my apps for a different reason.  I've seen cases when someone grabs an open source app, tweaks a few things and then publishes it as their own.  I don't want to compete against what's mainly my code for users!

    The OP and the majority of replies said the same thing in different words. In my case, it's especially true for some of my niche apps which really don't have any competitors in the store.

  • Although it is suggested here in this forum multiple times that you can't avoid global variables in certain situations.

    You can always avoid globals, one way to resolve is to create an instance variable in your application class.

  • So one example is that I have an app which largely revolves around "features" - it's an app which provides the user with a data field whose value is calculated based on a formula they enter. Kinda like Excel for your watch.

    I still remember when we were both responding to this user request at about the same time. I enjoyed triggering you to make your data field better. In the end your version became a lot more advanced than my version and when I received an enhancement request about my field, mostly I just recommended to use your AppBuilder field Slight smile

    I did open source my version of CalculatedField as a code sample for anyone who wants it https://github.com/Peterdedecker/connectiq/tree/master/samples/CalculatedField :)