I went swimming in the Atlantic for a couple hours. With my Samsung phone in my pocket.

So when I got an updated Android phone, I got an iPhone too. Time for some mobile app development.

(continued…)

Boost 1.77 is working well with it, and I’ve fully migrated to boost::json, which is working out great. The straw that broke the camel’s back was map.contains(), lolz. I was ready! I feel like I’ve had a hot bath. Nice.

The thread_local scope tells the compiler to create one unique version of a variable per thread. Then you can access it without worrying at all about in what thread you are. (Grammar Nazis, help me out here. I think I got that right…) It is absolutely genius for making multi threaded programming that much easier. W00t.

UPDATE: of course, every razor blade comes with its share of nicks. In this case, the expectation that different objects in the same thread would still have different thread_local members. Nope! Vet your ideas before you change to this scope too fast! Me, I’m all better now, and still love it. Good luck girls and boys.

I spent this morning exploring available tech to address this goal:

Add a bigdata database to my application, to archive older data out of the realtime local model

This is for my stock app, which deals with realtime in-memory data during market hours, with a delayed-write to local storage.  At the end of the day, it can then archive most of the data collected during market hours.

Because I have not achieved “success” in life yet, at least enough to allow me to pursue my larger goals uninhibited, I have to be very careful about how I apply my limited resources.  To be more precise:

  • Follow patterns that are as simple as possible (but no less), and sustainable into the next decade.
  • For my projects, limit languages, libraries and tools to those that are
    • well maintained
    • solve difficult problems more elegantly than I could solve with a medium level of effort

The result of today’s philosophically-informed research:

  • The primary languages of my software projects should be Javascript and C++
  • All data should be defined by JSON schema that is used to generate code, via quicktype
  • Long-term libraries and tools include boost, jquery, bootstrap, accounting.js, moment.js, nlohmann::json, sqlite, postgres

Note that using quicktype with nlohmann::json is an elegant way to effectively get C++ reflection.  Once you serialize an object to JSON you can walk all its fields.  Then you can do things like automatically build SQL queries for your classes based on the JSON schema.  Beautiful.

PS. I avoided spotify-json, StaticJson/autojsoncxx, Google Prototype Buffers, Code Synthesis’s ODB, the sqlite JSON1 Extension, C++ reflection libraries like RTTR, lots of code from Stiffstream and Chilkat, etc. because while they are all brilliant and compelling, they bring extra weight.  The world keeps churning though, so keep searching.  Also, there are cases where my choices do not fit, most obviously being cross-platform mobile apps, which will have to be saved for another post… 🙂

After seeing this little gem on the xunitpatterns site:

(We are running all the tests before every check-in, aren’t we?)

I was glad that I baked my tests into the startup of A better Trader. As I build and run while coding, I’m constantly running my regression tests. Steady on.