You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • I think the DS18B20 module is used a lot, so I'd be against changing something that broke it. Having said that, I doubt many people are using 'verify' so function(callback,verify) would probably be fine.

    I'm not convinced about returning undefined for the first call - if existing code does anything with that value (like an average) you could end up with NaN propagated through the code. I think maybe just keep the behaviour without a callback as-is, but change the documentation to advise people to use the callback.

    To help with that, kicking off a conversion in the constructor sounds like a good plan though.

    although the .js and .min.js would have different hash

    The comment in them would have to show the git hash of the repo at the commit they were made I think.

    The idea of the x.y notation like used in node is that if a function signature changes (like e above), the major number x would be incremented to indicate.

    Yeah, it makes sense - I think in Espruino's case there's not as much need for it as in something like NPM though. Generally modules are relatively simple and don't change that much once they're written.

    The current solution is definitely not perfect, but adding NPM style version control (and package.json) adds a lot of complexity. It's a lot to implement, but also a lot to ask users to get to grips with when a lot of Espruino's draw is the simplicity (many users aren't node.js users).

    A bit off topic, but my personal gripe with NPM/Node.js is that because there is a good versioning system, it seems to give people an excuse to make changes to the API all the time. As a result, if you don't have a package.json with versions in then your software probably won't work any more in a year's time, and if you do, you're using out of date modules in most cases. I'm not sure there's a way around it, but it is particularly frustrating having to debug your code every 6 months just to find that someone's renamed a function :(

About

Avatar for Gordon @Gordon started