Hacker News new | ask | show | jobs
by joezydeco 4147 days ago
Embedded guy here as well. I have to chuckle when I see a mountain of Java code to do a simple sensor operation but, hey, at least they're trying to understand how to make it all work.

What's distressing is that these folks will win in the end, and IoT wind up being quad-core devices @ 800Mhz because everyone is writing their system nodes in node.js or running a JVM. Small and tight just isn't worth the effort anymore.

2 comments

Hell, Java is too much of a pain to build and deploy (especially for something like this that requires custom hardware). I built a similar project 2 years ago in Python and it's good enough.

Embedded hardware still has its place though. General purpose kernels like this can't handle timing-sensitive operations well, so there will always be a need for small and tight real-time programming. Other solutions exist such as binding a separate microcontroller to the host OS, but they're clunky and require additional drivers/libraries.

But you're right, IoT will end up being quad-core devices running some version of Linux because it's an easily accessible development platform that provides TCP/IP and a bazillion actively maintained drivers. And why not? The silicon is getting cheaper every day.

This code looks to me to be fairly well constructed. There's a nicely written Sensor class and it looks like reasonable MVC. Yes, today it might be overkill for such a simple application, but I contend that this will be easier to extend into something less trivial down the line. If you are a Java guy, this is an excellent example to learn some basics of dealing with sensors.