This topic is 1660 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Yeah, you need longer variable names. I suggest:

pi_thing instead of p (since pi may cause confusion).

##### Share on other sites

int l,dijk=di+nx*(dj+oy*dk),dijkl,dijkr,ima=step_div(dk-ez,nz);
int qj=dj+step_int(-ima*byz*ysp),qjdiv=step_div(qj-ey,ny);
int qi=di+step_int((-ima*bxz-qjdiv*bxy)*xsp),qidiv=step_div(qi,nx);
int fi=qi-qidiv*nx,fj=qj-qjdiv*ny,fijk=fi+nx*(fj+oy*(dk-ima*nz)),fijk2;
double disy=ima*byz+qjdiv*by,switchy=(dj-ey)*boxy-ima*byz-qjdiv*by;
double disx=ima*bxz+qjdiv*bxy+qidiv*bx,switchx=di*boxx-ima*bxz-qjdiv*bxy-qidiv*bx;
double switchx2,disxl,disxr,disx2,disxr2;

/*
so you have created qj, qi, and more badly named
crap at the top of your function... again.
*/


O man, that's just....I don't even know. is their actually comma separated code in that? and a random variable doing...nothing on the 4th line?
that student needs to get a talking to.

I think with things like visual assist x, and code-completion tabbing. i've pretty much stopped doing this practice(although i never did it very much anyway). I like to use full names for things most of the time, just because of the fact that it looks nicer at the end of the day.

edit: that's actually making me a bit sick looking at it, i'm ganna go lie down for a bit now. Edited by slicer4ever

##### Share on other sites
int l;


is especially nice, especially if you use a font which makes l and 1 look very similar.

EDIT: Obviously it should be called lambda

##### Share on other sites

a random variable doing...nothing on the 4th line?

Well to be fair I have hand-picked the worst from this code, and this is just a beginning of the method.

##### Share on other sites

Oh sure it is more compact. And that is NOT a good thing. Of COURSE I can figure out what it all means eventually, I am not THAT stupid. But it is not the point.

I can't and I'm not that stupid (OK, I am, but still). That thing is just plain unreadable, I have an easier time reading blobs from hex editors... I'd kick immediately anybody who came up with code like that. The only place where I'd tolerate something like that is for stuff like 4k demoscene compos or something similar (and where the 4k limit applies on the source code, e.g. javascript demos and such).

Also oh god that last link... WHY (?°?°)?? ???

##### Share on other sites
remap(ai,aj,ak,ci,cj,ck,x,y,z,ijk);
vc.find_voronoi_cell(x,y,z,ci,cj,ck,ijk,w,mrs);
This code has to be generated by a machine. Or he did a search & replace at the very end. No sane human can make sense of this.

##### Share on other sites

int l,dijk=di+nx*(dj+oy*dk),dijkl,dijkr,ima=step_div(dk-ez,nz);
int qj=dj+step_int(-ima*byz*ysp),qjdiv=step_div(qj-ey,ny);
int qi=di+step_int((-ima*bxz-qjdiv*bxy)*xsp),qidiv=step_div(qi,nx);
int fi=qi-qidiv*nx,fj=qj-qjdiv*ny,fijk=fi+nx*(fj+oy*(dk-ima*nz)),fijk2;
double disy=ima*byz+qjdiv*by,switchy=(dj-ey)*boxy-ima*byz-qjdiv*by;
double disx=ima*bxz+qjdiv*bxy+qidiv*bx,switchx=di*boxx-ima*bxz-qjdiv*bxy-qidiv*bx;
double switchx2,disxl,disxr,disx2,disxr2;

/*
so you have created qj, qi, and more badly named
crap at the top of your function... again.
*/


What the?  What human could just look at that and know exactly what is going on?  If I had to read crap like that every day I'd just quit programming.  I don't think it'd be worth the pain every day.

##### Share on other sites

Makes me remember my best friend in highschool.

I don't think I ever say him use a variable name with more then 4 characters. mostly 3.

I guess it looked good together with the embedded asm he was writing.

He also didn't like to use circuit boards when building his electronics, because they were a waste of time and space.

Instead he build his circuits with all air-connections, in 3D... (yes, they did work, perfectly)

He's now pretty far into his academic career :P

• 16
• 9
• 13
• 41
• 15