twincityhacker: hands in an overcoat's pockets (Grace Hopper)
[personal profile] twincityhacker
Oh god, I loath my programing class.

Case in point? "I shall explain what I want you to do with an If-then statement, but you can't actually use an if-then statement in the program. But you can use a list!"

...What the hell? Seriously.

At least my AI that leads the laboratory section knows how to program python.

Date: 2007-09-24 12:11 am (UTC)
From: [identity profile] ludditerobot.livejournal.com
What are they trying to show you with that crap?

Date: 2007-09-24 12:27 am (UTC)
ext_52603: (Default)
From: [identity profile] msp-hacker.livejournal.com
In theory, the class is going to be a project about pulling something from PubMed.

Except, the entire class is shoddy programmers, and the professor has never taught before and he's going though python at warp speed because, obviously, C is so much like python that we should have no problem picking this stuff up, right?

And, of course, all the examples that he gives us of code aren't in Idle? So the syntax is completely different.

The problem, in this case, is: Write three functions called X, Y and Z. Each one should take a single number. For function X, it should add 1 to its argument and return the value. For function Y, it should add 2 to the argument and return the value. And for function Z, it should add 3 and return the value. Then write a program that will call X or Y or Z with the number 4 and prints the result. Exactly which function is called is determined by a variable F. If F is 1, call X. If F is 2 call Y and if F is 3 call Z. However, your program must not use an if statement! Thus if we run the program with F = 1, the output should be 5 and so on. Your program should first set F = 1 and call the appropriate function, then set F = 2 call the appropriate function and then set F = 3 and call the appropriate function. Hint - use a list.

The website is here (http://cheminfo.informatics.indiana.edu/~rguha/class/2007/i211/).

It's all very rage inducing.

Though I did manage to amuse the lab last Friday when I started a war with Python, bitching at the computer and talking myself until I won the code war - and then I realized that I didn't win at all and did a faceplant into the keyboard. But I did get the AI's attention, got a laugh out of the lab, and got my code fixed, so whats a few SAN points?

Considers a Perl icon again

Date: 2007-09-24 12:36 am (UTC)
From: [identity profile] ludditerobot.livejournal.com
Remember that SAN points do not regenerate.

But I'm all for a war against Python. Did I ever tell you why I hate Python?

Re: Considers a Perl icon again

Date: 2007-09-24 01:01 am (UTC)
ext_52603: (Default)
From: [identity profile] msp-hacker.livejournal.com
SAN point regenerate - otherwise I'd be at zero. = )

No, why do you hate Python? Oddly enough, the language they taught in this class before was Perl. The instructor thought that python was an easier language to deal with.

Re: Considers a Perl icon again

Date: 2007-09-24 01:23 am (UTC)
From: [identity profile] ludditerobot.livejournal.com
In Call of Cthulhu, they don't, but then, how can any language approach the byzantine, Lovecraftian, non-Euclidian depths of complexity that drive the Master's protagonists to madness they never recover from? I mean, besides LISP?

The second one first. I looked up the happy, preferred way to break up web page. Web scraping is what I do, so when I learn a new language, "how do I download something from the web?" and "how do I break up the HTML?" are my first questions. And, as it turned out, the preferred way was HTML as a stream. I found that to be mind-numbingly stupid way of handling the issue, coming from the world of Perl REGEX.

And second, white space matters to the compiler. White space is important. White space is good. It separates things that should be separated. Notice the paragraph separation here. But, when white space is important, white space can burn you.
TABpython code here
TABpython code here
SPACETABpython code here
TABpython code here

Can you see where the bug in this code would be? And, if, instead of words, there were real spaces and tabs, how long would it take for you to identify the problem? For me? I think it was the better part of an hour.

Re: Considers a Perl icon again

Date: 2007-09-24 10:16 pm (UTC)
ext_52603: (Default)
From: [identity profile] msp-hacker.livejournal.com
I haven't had any problem with whitespace, but the program we're using to program makes any whitespace errors look very obvious.

Date: 2007-09-25 03:50 am (UTC)
From: [identity profile] the-crazy-lady.livejournal.com
I like to think of myself as a fairly decent programmer, but I cannot see any way to do that with out using if-then (well, one, but it's basically an if-else-if. . .). Unless Python has some structure that Java/C++ doesn't have or I just didn't learn. . .

Profile

twincityhacker: hands in an overcoat's pockets (Default)
twincityhacker

July 2017

S M T W T F S
      1
2345678
9101112131415
16171819202122
23242526272829
3031     

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Mar. 10th, 2026 01:00 pm
Powered by Dreamwidth Studios