node.js - hesitation between two technologies for a little program -
i want make program (more precisely, service) periodically scans directories find video files (.avi, .mkv, etc) , automatically download associated files (mostly subtitles) 1 or several websites.
program run on linux or windows well.
on 1 hand, know qt long time , know benefits, on other hand, i'm attracted node.js , extreme flexibility , liveliness.
i need offer interactivity end user of program (for instance, chose scans directories, etc).
what best choice in opinion in 2013?
i advise against node.js "small tools , programs". iterative tasks.
the long story
the reason quite way node.js works. asynchronous model makes simple tasks unnecessarily convoluted. additionally, because many callbacks called node.js event loop, can't use try/catch structures every tiny error crash whole application.
of course there ways catch errors or work them, docs advise against of them , advise restart application gracefully in case prevent memory leaks. means have implement yet piece of code.
the real solution in node.js writing application cluster, great concept of course require use kind of ipc data process can handle it.
also, since wrote "periodically scan"ning directory, want point out should...
use file system watchers services
almost every language kit has , suggest using , use fallback full-scan.
- in qt there system-independent class qfilesystemwatcher provides handy callback whenever specified files changed
- in java there java.nio.file.filesystem.getwatchservice()
- node.js has fs.watch function, if really want go it
Comments
Post a Comment