- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
tried that: it's like looking into 2 mirrors standing opposite of each other: endless repitition. (and a lot of network traffic) :-D
Admin
"in memory database"? wait.. I must've missed out on something... I thought that ASPs are files which are stored in a filesystem...
come on. this is really the single most stupid thing you can do, 'cause this is not "in memory" but just "flat-file" storage, which is not really notorious for optimal performance when retrieving information...
captcha: craaazy - oh yes...
Admin
sorry, but it is worse. much worse.
need some examples?
arrays are language constructs, not a file format or whatever. constructing array code "on the fly" - thus hard-coding the dimensions - and all this inside of a special technology dependent file format like ASP, that is the real WTF here.
nothing to be said in principle against file storage vs. DB storage if it is used in the right context (considering cost, data volume, performance, format, future-proofness (!) etc).
captcha: kungfu -- huh-hah!
Admin
no. this is bad. apart from issues like scalability, multithreading etc. when using flat-file storage, he should've used at least XML, CVS or the like. coding data as a language-specific source code construct is just plain dumb, no matter under which circumstances.
Admin
quick&dirty: flat files (XML, CVS, ...)
dumb&dirty: using a language-spedific source code construct (i.e. array) to store data
captcha: ewww (how extremely well-fitting ;o)
Admin
Ekhm, the approach is OK, it just wasn't the right language to use. In LISP, there would be nothing wrong with it. He wouldn't even need to generate any source -- simply keep the data structures around and print them out to a file. Heck, the file could be compiled at runtime to speed up loading, if modifications were less frequent than loads (likely). LISP provides a standardized way of printing out any "reasonable" contents, such that it's valid LISP source and can be read back.
Easy does it.
pirates: arrr!
Admin
Not in LISP. In fact, for quick-and-dirty projects, I wouldn't mind storing slowly changing data as a simple LISP source. Common Lisp provides a way to dump any reasonable data out as the source, and a way to read it back. There's also a standard way to compile said source so that it loads quickly.
Some LISPs provide workspace save/restore, which would speed it up. It's like object prevalence to the max, in a platform that's soon to be half a century old. Progress, my ***.
Admin
Stuff like this is done daily in production LISP code and it usually works pretty well. For me, it works great in embedded real-time systems where for realtime-qualified data you'd have to write a realtime-qualified database. We're not talking about big iron like banking: the datasets are small (about 18MB), but a lot of query functionality equivalent to a page+ of SQL has a 0.5ms hard time window.
I have quite a bit of low-consing embedded code where quite a bit of data is being compiled into the final binary straight from "sources" which are S-expressions.
Said sources are all generated, and represent static configuration data and such.
Data that's variable, but needs to be initialized, is handled similarly, just that the resulting binary objects end up being copied to RAM at system initialization, and are sent out to flash memory as needed (at transaction points etc). It's binary, but for debugging the flash can be printed out as S-expressions and used to troubleshoot on the desktop. Very handy, and all provided for by the LISP platform.
LISP ninjas ;)
Admin
I really hope that the programmer in question doesn't discover "System.Reflection.Emit", or even worse "System.CodeDom" and "System.CodeDom.Compiler" and friends.