I started teaching myself programming and I fucking love it.. So I decided well I might aswell take a course at university so that I have a really strong foundation to build on myself. It's such bullshit. They keep taking points off my assignment and giving me comments like "recursion hasn't been covered in class yet". SO fucking what? Now they want me to write an exam and write my code out by hand? Is that even possible? Are there ever any 'real world' scenarios where you would ever need to do that?
>>1
If you're a srs business senior software engineer guy or whatever then maybe you'll design shit by hand. But writing out a lot of code by hand before you type the same shit into the computer anyway? No, it's more bullshit from the wonderful educational system.
Maybe I'm being pissed off for nothing, but srsly I find it so unnatural.. I mean when I type my code it's not line by line.. I always insert things above existing lines and ofcourse all the lines below will move down, so I'm just don't know how I will be able to write the way I do by hand.
Another question:
I really like doing mathematical programming problems like the ones on project euler. Is programming in the industry anything like that? If I enjoy finding prime numbers would I probably enjoy the stuff that you guys do?
>>1 , I took a course and the exams where similar. If you already know it, just stick it out for the credit [or audit out? is that the correct term?]
The paper nonsense kind of makes sense, it simplifies testing, and there's a physical record. There's plenty of games to be played in .edu, I don't think this is the worse. bit of a mindfuck though.
Name:
Anonymous2009-11-01 4:38
i write psuedo-code out by hand when i'm having a difficult time solving a problem. well, actually it's real code. but it gives me an excuse to write things that don't compile
Name:
Anonymous2009-11-01 4:52
>>1
While I do all my coding on the computer, I do the system planning and design on paper.
>>7
Hand written psuedo-code is still real code. While it may not correctly follow the rules of a grammar, the point of doing it will always be to plan out the logic before committing the logic electronically.
You can test some ideas on paper, but you can also do that on a computer.
I think everyone prefers to write code on a computer, but it's not that hard to write imperative code on paper, but writing something like Lisp on paper could be a mess, especially for those used to structured editing.
Name:
Anonymous2009-11-01 5:41
I write code by hand when I don't have access to a computer - it's a massive mess, though.
>>1
Maybe because no one uses recursion in the real world. You're aren't just writing code for you to understand, other people have to waddle through your shit and if it was me the last thing I would want to see is recursion.
Name:
Anonymous2009-11-01 9:52
>>1 Now they want me to write an exam and write my code out by hand? Is that even possible?
I guess you're just stupid. I heard the retards in my programming class complaining about this. If you find writing code on paper slightly difficult, you should just quit.
>>18
A lot of problems are much easily explained and written recursively than having to transform it into an iterative version. If someone is too stupid to understand some simple recursion, maybe they shouldn't be programming at all?
Name:
Anonymous2009-11-01 11:23
>>18,20
If seen this guy before. He isn't use recursion to solve the problem, he is doing it to show he can. He probably turned in his first assignment like this:
static int repeat = 0;
int main(int argc, char *argv[])
{
if (argv != NULL)
main ('H', NULL);
return 0;
else
{
printf ("%c", (char)argc);
switch (argc)
{
case 'H: return main('e', NULL);
case 'e': return main('l', NULL);
case 'l':
if (repeat == 0)
{
repeat = 1;
return main('l', NULL);
}
else if (repeat == 1)
return main('o', NULL);
else
return main('d', NULL);
case 'o':
if (repeat == 1)
{
repeat = 2;
return main(' ', NULL);
}
else
return main('r', NULL);
case ' ': return main('W', NULL);
case 'W': return main('o', NULL);
case 'r': return main('l', NULL);
case 'd': return main('!', NULL);
case '!': return 0;
}
}
}
>>21
Well, that's kind of stupid. What I meant is that a lot of algorithms are easier to express recursively: traversing/searching/modifying trees/graphs, backtracking and other search algorithms. While I understand that some people like to use recursion for looping in languages supporting TCO(as shown in SICP), I'm not one to use it like that too often if the language has good iteration constructs. Bottom line is that recursion should be used when it's the most clear way to express an algorithm. Using (tail) recursion for iteration in languages with decent iteration constructs is usually mental masturbation. Using non-tail recursive versions for iteration is even worse since you're using stack space.
>>25
He should add TCO anyway to his language. There are enough cases where it happens that have nothing to do with using tail-recursion for iterative purposes
>>27
Didn't the python guys say it would require too much overhaul to support (supposing Guido gave his blessing), in much the same way as I hear it's impossible for Java to support TCO
Name:
Anonymous2009-11-01 13:10
>>5 I really like doing mathematical programming problems like the ones on project euler. Is programming in the industry anything like that? If I enjoy finding prime numbers would I probably enjoy the stuff that you guys do?
It's not common, but there are fields in the industry where you do lots of algorithm-heavy work. You can probably get a relatively high salary if you're good at these things, cause most programmers aren't.
Name:
Anonymous2009-11-01 15:38
They keep taking points off my assignment and giving me comments like "recursion hasn't been covered in class yet".
I had a similar thing happen. They gave back the points after I spent some time convincing the instructor that teaching students knowledge and limiting it to that needed to pass the course is useless in the real world, unscientific, and ultimately destructive (yes, I actually used that line. He didn't get the reference so I assume he doesn't read /prog/.)