10
u/davydog187 Dec 05 '14
These are obviously students who are learning to program, I think classifying this as shitty programming is a little harsh. Lets wait for them to have more experience before we judge their code as shit.
6
u/justabaguette Dec 05 '14
Normally I would agree, but in order to take this class you either have to take an even more basic programming course (which also covers recursion) or pass a placement test. The assumtion is students already know a thing or two about programming. The fact that this student can't understand why they are getting a stack overflow with such idiotic code at the end of the semester is just sad IMO.
3
u/davydog187 Dec 06 '14
Recursion is a fundamental computing concept that can be very hard to grasp for beginners. I don't think it's unreasonable for a beginner to have to have multiple semesters of exposure to recursion before they truly understand it. Especially those who have not studied higher level Mathis previously
2
u/justabaguette Dec 06 '14
Oh come on, if they knew even the slightest thing about recursion (which the student should) they should understand that this code is fundamentaly stupid.
24
u/whatIsThisBullCrap Dec 05 '14
The real /r/shittyprogramming is Piazza itself. I had to use that garbage for a CS class this term. It sent 100 emails a day. When I changed my settings to not receive emails it sent 100 emails a day for the next week and then sent only 15 emails a day
12
u/justabaguette Dec 05 '14
I fucking hate this shit. I get at least 10 emails a day. I would disable it, but 10% of my grade in the class comes from asking/answering questions on Piazza. The only problem is the instructor watches the site religiously and answers every student's questions before any one else has a chance to.
19
u/myusernameisokay Dec 05 '14
Just ask questions. Or get your friends to ask questions while the prof is busy and you answer them. Game the system.
6
u/Ununoctium118 Dec 05 '14
We use Piazza for a couple of classes, and other than the email spam it isn't too bad (but we aren't required to ask/answer questions).
0
4
u/pitibow Dec 05 '14
Hmm, I've always thought Piazza is pretty awesome. i had a setting to only get a 1 email summary of activity a day. It's much better than all the other ancient forums for classes.
2
u/realfuzzhead Dec 05 '14
Use gmail and they will redirect them to the updates or social folder and you won't get notifications. Works for me at least.
4
u/LlamaChair Dec 05 '14
I don't suppose you go to school in Missouri? My school uses Piazza and this looks like something I got assigned in an earlier class.
2
u/justabaguette Dec 05 '14
Nope
2
1
u/hipster_kangaroo Dec 09 '14
Colorado School of Mines?
Edit: nvm. Went stalking. Looks like you go to NYU
3
u/shvelo Dec 05 '14
Double facepalm ensued.
BTW I'm guilty of doing something like that and wondering why it didn't work.
2
u/justabaguette Dec 05 '14 edited Dec 05 '14
Just out of curiousity, what was your thought process at the time? I'm still trying to understand how anyone with even just a semester's worth of programming expirience could think this makes sense.
3
u/shvelo Dec 05 '14
Not paying attention to names and keywords.
I was trying to set window in Javascript.2
u/justabaguette Dec 05 '14
Ok at least thats a kind of a valid excuse. I'm fairly certain the student in question here knew he was calling the fuction he was writing and just expected it to work.
89
u/realfuzzhead Dec 05 '14
Ha I thought Piazza was off limits! Shit there's a goldmine of shitty programming on there
67
Dec 05 '14
Best piazza post I've ever seen (non programming related, sorry....):
Hey, I'm a member of a fraternity, and we have all our social events on Thursdays. I don't feel like it's fair that quizzes should be on Friday since they happen at 9 AM. Is it possible for us to take quizzes later on Friday or online? Frankly I don't want to be hung over during quizzes.
What. the. fuck.
63
u/whatIsThisBullCrap Dec 05 '14
I don't want to be hung over during quizzes
I feel as if the solution to that problem is painfully obvious
35
u/myusernameisokay Dec 05 '14 edited Dec 05 '14
I'll let you in on some secret brogrammer knowledge. I'm a member of a fraternity who also drinks on Thursdays. The solution is to keep on drinking and write the quiz drunk. Best of both worlds.
5
u/gqgk Dec 05 '14
My brogrammer advice is to not schedule a technical class before noon. And try to get classes that are Monday/Wednesday or Tuesday/Thursday, but some schools don't offer that.
4
Dec 05 '14
Honestly, it can be really tough to not drink on a thursday.
11
u/PublicSealedClass Dec 05 '14
If you're a SharePoint developer there's more truth to this than you realise.
0
64
Dec 05 '14
28
u/hitlerdidnothingbad1 Dec 05 '14
Not sure what I was expecting.
14
Dec 05 '14
Not sure what I was expecting.
9
-6
3
0
Dec 05 '14
[deleted]
24
Dec 05 '14 edited Dec 05 '14
+/u/CompileBot python --include-errors
def main(): mjcov_is_probably_wrong() print "if this prints then mjcov was right and reddit actually does have infinte stack space." def mjcov_is_probably_wrong(): mjcov_is_probably_wrong() if __name__=="__main__": main()25
u/CompileBot Dec 05 '14 edited Dec 05 '14
Output:
Traceback (most recent call last): File "prog.py", line 13, in <module> File "prog.py", line 3, in main File "prog.py", line 9, in mjcov_is_probably_wrong File "prog.py", line 9, in mjcov_is_probably_wrong File "prog.py", line 9, in mjcov_is_probably_wrong File "prog.py", line 9, in mjcov_is_probably_wrong File "prog.py", line 9, in mjcov_is_probably_wrong File "prog.py", line 9, in mjcov_is_probably_wrong File "prog.py", line 9, in mjcov_is_probably_wrong File "prog.py", line 9, in mjcov_is_probably_wrong File "prog.py", line 9, in mjcov_is_probably_wrong File "prog.py", line 9, in mjcov_is_probably_wrong File "prog.py", line 9, in mjcov_is_probably_wrong File "prog.py", line 9, in mjcov_is_probably_wrong File "prog.py", line 9, in mjcov_is_probably_wrong File "prog.py", line 9, in mjcov_is_probably_wrong File "prog.py", line 9, in mjcov_is_probably_wrong File "prog.py", line 9, in mjcov_is_probably_wrong File "prog.py", line 9, in mjcov_is_probably_wrong File "prog.py", line 9, in mjcov_is_probably_wrong File "prog.py", line 9, in mjcov_is_probably_wrong File "prog.py", line 9, in mjcov_is_probably_wrong File "prog.py", line 9, in mjcov_is_probably_wrong File "prog.py", line 9, in mjcov_is_probably_wrong File "prog.py", line 9, in mjcov_is_probably_wrong File "prog.py", line 9, in mjcov_is_probably_wrong File "prog.py", line 9, in mjcov_is_probably_wrong File "prog.py", line 9, in mjcov_is_probably_wrong File "prog.py", line 9, in mjcov_is_probably_wrong File "prog.py", line 9, in mjcov_is_probably_wrong File "prog.py", line 9, in mjcov_is_probably_wrong File "prog.py", line 9, in mjcov_is_probably_wrong File "prog.py", line 9, in mjcov_is_probably_wrong File "prog.py", line 9, in mjcov_is_probably_wrong File "prog.py", line 9, in mjcov_is_probably_wrong File "prog.py", line 9, in mjcov_is_probably_wrong File "prog.py", line 9, in mjcov_is_probably_wrong File "prog.py", line 9, in mjcov_is_probably_wrong File "prog.py", line 9, in mjcov_is_probably_wrong File "prog.py", line 9, in mjcov_is_probably_wrong File "prog.py", line 9, in mjcov_is_probably_wrong File "prog.py", line 9, in mjcov_is_probably_wrong File "prog.py", line 9, in mjcov_is_probably_wrong File "prog.py", line 9, in mjcov_is_probably_wrong File "prog.py", line 9, in mjcov_is_probably_wrong File "prog.py", line 9, in mjcov_is_probably_wrong File "prog.py", line 9, in mjcov_is_probably_wrong File "prog.py", line 9, in mjcov_is_probably_wrong File "prog.py", line 9, in mjcov_is_probably_wrong File "prog.py", line 9, in mjcov_is_probably_wrong ...^source | ^info | ^github | ^report
EDIT: Recompile request by quantumcamel
9
u/PublicSealedClass Dec 05 '14
Is it just me or does this bot seem like both a very cool yet very dangerous idea?
10
Dec 05 '14
There are a few limits on what it can do. For example, it can't access networks or file systems.
For some more info on it see here.
24
u/RoboNickBot Dec 05 '14
"Do the thing," said the student.
"Okay, how do I do the thing?" asked the compiler.
"You do it by doing the thing."
2
5
u/nbF_Raven Dec 07 '14 edited Dec 07 '14
Lol for a second there I thought I was looking at my junior level data structures class's piazza.
http://i.imgur.com/mf5ecmY.png
That's a snippet from ours.
6
u/seiyria Dec 05 '14
What is recursion?
35
27
u/bloodsh0t5 Dec 05 '14
To understand recursion, you must first understand recursion.
18
u/brewspoon Dec 05 '14
Always include the base case: you understand recursion.
3
u/detroitmatt Dec 08 '14 edited Dec 08 '14
To learn recursion: If you understand recursion, stop. Otherwise, learn recursion.
9
u/psluredd Dec 05 '14
4
u/PotentPortentPorter Dec 05 '14
How did you link to your own post without an edit? O_o
8
1
0
u/OrionBlastar Dec 05 '14
When a function calls itself.
Which is good for calculating Fibonacci numbers or Ackerman numbers, but you have to have a variable or variables that decrease over time to prevent infinite recursion that results in a stack overflow.
Here recursion is used to computer Ackermann numbers in C++:
https://github.com/orionblastar/ackermann0/blob/master/ackermann0.cpp
7
u/seiyria Dec 05 '14
shittyprogramming
taking me seriously
this sub should be called badprogramming, no one can ever act "shitty" :(
-3
u/OrionBlastar Dec 05 '14
Shitty programming is like this:
int worddata; printf(worddata);
Stuff where you forget to initialize a variable and it pulls data from a random location in memory where the variable is stored. Yet the compiler does not notice it, compiles the shitty code, and it prints some random number each time it runs.
Shitty programming is just not paying attention to what you are doing, not taking the time to look it over and debug. Not following directions and getting things confused.
A function that just calls itself with no way to terminate the recursion is just another example of an infinite loop.
Shitty programmers always shoot themselves in the foot and then blame someone else for their mistakes.
I used to work with a lot, had masters and PHDs in computer science and still were shitty programmers that I always had to debug their code to fix problems like that.
5
u/seiyria Dec 05 '14
Have you ever been on a shitty network subreddit? /r/shittyaskscience maybe? pls
-6
u/OrionBlastar Dec 05 '14
Nope it looks like circlejerk.
For a really shitty network subreddit try /r/kuro5hit it is run by Trolls from Kuro5hin when /r/kuro5hin locked them out. Kuro5hin is a troll website based on Scoop that started out as a Slashdot clone and ended up a Troll Paradise.
7
u/seiyria Dec 05 '14
Ok, then you don't get how the shitty network operates. Sorry, but the jokes (and most of this subreddit) will probably go over your head. Carry on.
-1
0
Dec 05 '14
[deleted]
1
u/OrionBlastar Dec 05 '14
I didn't get that from the sidebar. Replies go directly to my inbox. So I don't see the sidebar, much less be able to read it.
This is one of my first times posting here, why be shitty on purpose when you can do better?
0
Dec 05 '14
[deleted]
0
u/OrionBlastar Dec 05 '14
I have schizoaffective disorder, I don't always get jokes. It is something we share with autism.
4
u/manghoti Dec 05 '14
I have to give that student credit. He's doing top down programming!
"Ok so how does this work. Well first we open the window"
public void doThing(){
openWindow();
}
public void openWindow(){
//TODO
}"Then we set its color..."
public void doThing(){
openWindow();
setColor(255,0,0);
}
public void openWindow(){
//TODO
}
public void setColor(int r, int g, int b){
//TODO
}now how do we actually set the color?... ummmm... well stack overflow says to do this:
public void setColor(int r, int g, int b){
setColor(r,g,b);
}... genius.
-16
u/katyne Dec 05 '14
Omg I can't believe some people aren't born knowing everything right away.
3
u/justabaguette Dec 05 '14
This was asked just a couple of hours after a lecture about recursion. And please take the seriousness down a notch.
8
13
u/NotSteve_ Dec 05 '14
What was he even trying to do