I would have ignored your comment were it not for you mentioning that you write javascript. I started learning it on and off a few weeks ago, and yesterday I installed spidermonkey as a standalone shell. What I have noticed is that a lot of the syntax that controls flow is very similar to C, which is notorious for being gibberish. I'm guessing the same will apply to js. I do not have a CS degree, but would you say that this is readable? This is a function for extraction of nodes in a double linked list that I am currently kicking into shape.
/*
* extract *p__ from p__.
* but original *p__ is shifted left or right \
* if there is still space.
* extracted ndi* is returned, but the remainder of the list \
* is sewn back up.
*/
ndi *extract_ndi(ndi **p__, const int dec) {
ndi *q_=*p__;
if(dec>=_PREV_) {
*p__=*(q_->lnk+dec); /* the shift */
if(*((*p__)->lnk+!dec)=*(q_->lnk+!dec)) { /* sew up */
*((*(q_->lnk+!dec))->lnk+dec)=*p__;
*(q_->lnk+!dec)=NULL; /* burn ends of extraction */
}
*(q_->lnk+dec)=NULL;
} else if(dec==_LONE_) /* final possibility is that *p__==NULL */
*p__=NULL; /* ie. dec==_DEAD_, no which ain't it not worth man */
return q_;
}
What the hell was I smoking when I wrote this? I can't even read it myself.Writing convoluted code is more to do with a certain state of mind. You should ask your coworkers where they obtain LSD, not where they got their degree. I haven't come across any acid for about a dozen years, I think it has gone out of fashion.
Of course if this was Perl it would be even worse.