2 ms·
> Why would a pedagogical project choose JavaScript of all languages? I don't think the JS part is the issue. Node.js does I/O, files and co. The issue is that
by interesthrow2 8y ago
> Why would a pedagogical project choose JavaScript of all languages?
I don't think the JS part is the issue. Node.js does I/O, files and co. The issue is that the article doesn't teach how to build a database at all.
It doesn't explain how to efficiently persist and fetch data from a file, indexing strategies with trees, concurrent file access,locking, basic transaction... that's what I expect from a tutorial about how to build a basic DB system.
- dymk 8y agoPlenty of languages do I/O, files, and co. Why choose a language plagued with warts and a half-baked ecosystem for something pedagogical? A language with all sorts of peculiarities from the '95 browser era, and not at least leverage browser technology? A language which gives you very non-interesting coarse control over resource, and has no concept of parallelism?
- raxxorrax 8y agoEasy access and fast results. Learning isn't about creating the best possible implementation. Python wpuld have been another suggestion from me personally. What language would you have used? A lot of people without a formal educational background start with established scripting languages. I you handle data, chances are that you will get in contact with javascript at some point. Using coffeescript or typescript would be a worse choice for learning, even if they counter some disadvantages of the base language in question.
- rodw 8y agoMoreover, Node.js's non-blocking, single-threaded nature is great for the kinds of plumbing that things web services and related applications require (The stuff we used to call "database-to-web" applications -- i.e., fetch some content from a data-store and render it and/or accept some content from a client and store it) but seems like a pretty poor match for disk I/O and CPU-bound applications like a database. And I'm saying this as someone that's actually a big fan of JavaScript and that does a fair amount of enterprise-scale work with it. EDIT: I meant to add: But, I think this might be beside the point. If you are looking for a language than a large number of people can more-or-less read and write, JS is a pretty good choice. If your objective is teachablity/readability rather than production-quality performance or capabilities, I think JS is probably on the short-list of candidate languages. I can't find the quote offhand but I think Douglas Crockford or someone like that described JavaScript as "the only language people feel comfortable using without learning the syntax". (This was especially true prior to server-side applications like Node.js, when JS was largely considered a toy-like language for scripting basic input validations). If nothing else, this makes JS a reasonable "executable pseudo-code"--something practically any programming can read and probably most can execute.