40 karma · joined April 2, 2012
The same with everything nil and another novice caring stuff. This book is good (I know since I learnt from it), if authors cared about so-novice-people this book would suck so much. Imagine you want use lua for your C program, whant to learn it first and you read what associative array is. I'd be mad.
And I disagree with your point about "practical" examples. Practical stuff you learn at work. Examples are good to learn syntax and general stuff, rest you can find quickly in documentation.
On the other hand, programming tutorials needs rethinking, but I think it need far deeper change.
1. It can be called from any place in code.
2. Its call can be written in function. You don't write so much ifs whenever you call it.
jmp_buf errbuf;
int result;
if( !( result = set_jmp ) )
{
/* Code to do on fail. Result may be some error code */
}
else
{
someaction( par1, par2, ..., errbuf);
anotheraction( par1, par2, ..., errbuf);
/* Etc. */
}
errbuf might be global if you prefer, but I'd rather avoid them. When something is wrong called function calls longjmp(errbuf, errorcode).Except that I think unsigned int will cause segmentation fault when signed int would cause program run farther and work inproperly. For example, if you use some int as an index. It should be non negative, but you've made mistake and you calculated -1. If you use signed int it would access some data and work if it and probably you will have big problem with debugging. If you used usigned int -1 is incredibly high number which in 99% cases will cause segmentation fault at the source of problem, so process of debugging would be far faster.
When you use that value for some calculations it's the same. Problably such value would make values "unbelivable" and you start debugging at place where such value occured.
Seems to be true. Since I'm not boring I hardly remember how does it feel to be bored. :) There's so much stuff to do. Only thing you have to do it to see it's awesomeness and then "good bye, boredom". :D
I'm learning Ukrainian and Russian for 3,5 months. I understand Ukrainian just like that and understand Russian quite well; written and spoken. I speak ukrainian quite good and start to speak russian (because I started with ukrainian and didn't write russian first). It was 3,5months of nearly no effort maybe couple hours a week.
OK, I'm polish so slavic languages are nothing new to me, but many people learnt russian here with nearly no result. I think it's way of learning. I just started write and read ukrainian and russian bit later.
If I learnt familar language so fast with no effort why not to learn european language in 5 months of some effort? It's possible since european languages are not completely different and I know english and understand german now. Well, maybe it won't be C1, but I can believe there are people with better language skills than me.
If I see I have so big job to do I have problem to start, procrasinate. What does it mean? Obviously I'm lazy, isn't it?
At the same time if I see nice way to make easier some complex stuff I do frequently I do it, find it exciting, enjoyable and I don't procrastinate. So? I'm unlazy at the same time. That's the effect of being inteligent and lazy at the same time.
Maybe he could have used better words to describe that, but It wouldn't tell the people that lazyness may be advantage as well, because such lazy code is so nice. Time saving is not only thing. Such lazy code tends to be so DRY, as he wrote and as code is DRYer it is more readable as well.
About dumb, it's very similar. Guy you ask so elementar questions. It's all so obvious. So many people would say he's dumb, even take it personaly.
If he doesn't use word dumb, that fact wouldn't be emphasized so nice.
define( fact, ( n ), function(
cond( ( n = 0 || n = 1, 1 )
( n > 1, n * fact(n-1) )
)
)
print( fact( 5 ) )
I think I'd try to program in language like that. Lisp way of thinking, but parenthesis are bit more helpful and there are "normaly" used operators which makes language bit more readable.
Your project looks like another purely academic example. I think purely academic examples sucks because don't teach people to do what is actualy needed.I didn't read your code carefully, but "endles" elsif chains looks terrible and I think there shouldn't be stuff like that in tutorial project. Moreover I believe java isn't good tool for that purpouse( another nobody seems to teach ). I'd use flex and bison or perl if you realy want to implement lexical analisis yourself..