String DU.getSentence throws LanguageError() {
...
}class DU extends MeFite {
private String getComment(MeFiPost post) throws GrammarException {
...
}
}
Kids, don't make programming jokes if you're going to screw it up.static A jtconstr(J jt,I n,C*s){A z;C b,c,p,*t,*x;I m=0;
p=0; t=s; DO(n-2, c=*++t; b=c==CQUOTE; if(!b||p)m++; p=b&&!p;);
if(0==m)R aqq; else if(1==m&&(z=chr[(UC)s[1]]))R z;
GA(z,LIT,m,1!=m,0); x=CAV(z);
p=0; t=s; DO(n-2, c=*++t; b=c==CQUOTE; if(!b||p)*x++=c; p=b&&!p;);
R z;
}
The whole codebase is like this.class DU extends MeFite {
private String getComment(MeFiPost post) throws GrammarException {
SnarkFactory sf = new SnarkFactory();
sf.setLines(1);
return sf.getSnark().snark();
}
}
L1:
for(int n= 0; n<4; n++){
L2:
for(int i= 0; i<5; i++){
// (do something)
if(bigwhoops(i))goto L1; //back
if(littlewhoops(i))goto L2; //back
if(alldone(i))goto L4; //forward
if(done(i))goto L3; //forward
}
L3:
}
L4:
(even better with comprehensible labels, and no goofy after-tests like with break or continue)The terminology of English grammar is used rather than that of programming languages. Functions are referred to as verbs whose arguments are often called nouns and pronouns instead of constants and variables. Verbs may be modified by adverbs and, for example, the verb +/ which gives the sum over a list is derived from the verb + plus by means of the adverb / insert. Also conjunctions allow the composition of verbs, and @ is the conjunction atop (or after) which, for example in the defined verb pos applies the verb on the left after the verb on the right so that the verb might be read "increment (after generating) the non-negative integers".posted by Jasper Friendly Bear at 7:07 PM on March 26, 2011
def descend(tc):
tree, cont = tc
def dcheck(lval):
if lval == d:
return cont(lambda rv, k2: (descend, (tree[1], lambda lv: lv(rv,k2))))
else:
return (descend, (tree[1], lambda rv: lval(rv, cont)))
if isinstance(tree, tuple): ### application of tree[0] to tree[1]
return (descend, (tree[0], dcheck))
else:
return (cont, tree)
It's a non-recursive "eval" loop (actually returning the next function to call, and its argument, to a trampoline) for an interpreter for an obfuscated functional programming language. "d" is a special form that delays evaluation of its argument. (I now recall that I linked it above, actually.)Yes, they are...among programmers who suckare inexperienced. I've seen it at work with a pretty large sample. The set of terriblebeginner programmers and the set of Java programmers overlap almost 100%. The ones who aren't terrible but still use Java wish they weren't, because they are invariably forced to make terrible programs against their will.Ugh, this is such B.S. I realize python is all trendy now, but honestly for writing very large programs the static type checking you can do with java is helpful. Java is what's taught to kids when they're in school, so obvious beginners are going to know it. But if you right real programs instead of toy stuff people do use java. I wouldn't call the author of Minecraft, for example, a noob. I don't think the people who developed Android picked java as their main programming language because they were noobs and so on.
As for ASCII-ed math derived symbols making it a mess and hard to follow, I'm aware that a few experimental languages have happily moved onto Unicode land, where you can pick from lots of math symbology to improve readability.What I would like to see is a language that lets you type something different then what you see. for example if you typed 'lambda' you'd get 'λ'. That would require some integration between the code and the editor, but with all the auto-complete editors out there it shouldn't be too hard.
that cognitive overhead I'm talking about often also applies when you're reading the program.I can see how it could be difficult for unintelligent people to understand.
More to the point, it can be difficult for intelligent people to maintain. Particularly so if the maintainer is not intimately familiar with all of the code, as is often the case.How is that any different then any other programming language? You can build complicated type hierarchies in any language worth using (including C, using function pointers) and because the type system isn't specified or defined by the language each program can work differently, which actually can make it more difficult to maintain. For example, with javascript you have functions which are also objects, and you can change the 'class' of an object at any time by swapping out functions and replacing them with different ones. The fact that Java is strongly typed makes it easy to see, for example, exactly what kind of object a function takes. In JavaScript everything is just a variable and you have to hope it has the right properties. The only way to see what a function expects is to see where it's been called and what the parameters were. (Or hope for good comments)
« Older Many people have described the popular freeform ga... | "I've been eating two family-s... Newer »
This thread has been archived and is closed to new comments
posted by DU at 10:18 AM on March 26, 2011