jgreco
Resident Grinch
- Joined
- May 29, 2011
- Messages
- 18,680
Yes, he did.
Good for you. Give yourself a pat on the back.
Probably not wise to get like that about it.
Design? What design? The middleware in freenas 9 is an abomination.
Sure. It started out in FreeNAS 8 when the devs had only some vague ideas as to how to go about things, and as with any significant software engineering project that's not well-defined up front, grew in scale and scope and complexity as it hit the real world. It's gotten to the point where they started over for FreeBSD 10, having a lot more experience, a more coherent vision, and more modern options available to them for developing this.
That doesn't change the fact that using a scripting language for complex tasks like middleware is designing for programmer convenience; it is a lot more convenient to write in some high level, less-efficient language for tasks where performance isn't a consideration.
As an example, which of these do you think was easier to write?
Basic Node.js web server:
Code:
var http = require('http'); function handleRequest(request, response) { response.end('requested: ' + request.url); } var server = http.createServer(handleRequest); server.listen(80, function() {console.log("Server running\n");});
which is a whopping six lines, or writing it in C such as this example
https://github.com/labcoder/simple-webserver/blob/master/server.c
which is over 200 lines, or this one
http://www.cs.cmu.edu/afs/cs/academic/class/15213-f99/www/class28/tiny.c
which is over 250 lines, or any of the other similar examples, including the one I'm not willing to write just to make the point. C is great from a performance perspective and will kick the living crap out of an interpreted language, but actually getting your business done in C tends to require more work for the same result, so if you have something that doesn't actually require ultimate performance, a scripting language can be a better design choice.