Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
QuarkJets
Sep 8, 2008

Thermopyle posted:

What kind of heathen doesn't have green comments?

What kind of poo poo class requires physical printouts of code for homework submission? Classes in the early 90s, perhaps

Adbot
ADBOT LOVES YOU

dc3k
Feb 18, 2003

what.

QuarkJets posted:

What kind of poo poo class requires physical printouts of code for homework submission? Classes in the early 90s, perhaps

My intro to OOP class was like this. I had to print out 30+ pages of code for each assignment. Prof's reasoning? "So the TA can make comments in the margins"

...

Right. That happened maybe five times total outside of them writing my grade on the paper, which was useless because our grades were online anyways. Why couldn't the TA just add comments to our code with a text editor and return it to us that way? Or give us a document back telling us which lines the mistakes were on? But no, we had to waste our loving money printing out code and not using the online submission system that every other loving course used.

This is the same prof who would dock marks on exams in second and third year courses for missing semicolons and handwritten code not being perfectly indented in the tiny space given to us on the exam sheet.

quiggy
Aug 7, 2010

[in Russian] Oof.


QuarkJets posted:

What kind of poo poo class requires physical printouts of code for homework submission? Classes in the early 90s, perhaps

Every pure computer science class in my undergrad did this. I wish I was kidding.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Volte posted:

I failed this assignment, other people got 100% even if their code didn't compile or make sense.

Did your code work? I'm having a hard time reading the blurry code. I do like these marker's comments though:

TA posted:

1) Not a good design
2)

TA posted:

* Programming style is not good.

TA posted:

You have made the question more complicated for yourself and also for me to mark!

kitten smoothie
Dec 29, 2001

I had to print out code listings in my intro courses (then again, it was the 90s).

In spite of that being a course requirement, the graders occasionally liked to make passive aggressive remarks about wasting paper. The best was when you'd end up with one closing curly brace on the last page and nothing else. They'd usually fill up the empty space with a drawing of a very angry tree.

Volte
Oct 4, 2004

woosh woosh

pokeyman posted:

Did your code work? I'm having a hard time reading the blurry code. I do like these marker's comments though:
Yes, it worked fine, and was far more robust than the official solution which was basically "chop off various parts of the string and put them into a big switch statement".

carry on then
Jul 10, 2010

by VideoGames

(and can't post for 10 years!)

QuarkJets posted:

What kind of poo poo class requires physical printouts of code for homework submission? Classes in the early 90s, perhaps

My intro computer graphics class, just last semester, for one. Handing in the source to a raytracer on paper is certainly something. I think originally it was so we could peer grade but that sort of fell apart after the first assignment.

PrBacterio
Jul 19, 2000

Thermopyle posted:

What kind of heathen doesn't have green comments?
I just checked, and I have comments set to a slight (darker on dark backgrounds, lighter on light backgrounds) shade of grey in all four of the syntax hightlighting/colour schemes I use.

Bruegels Fuckbooks
Sep 14, 2004

Now, listen - I know the two of you are very different from each other in a lot of ways, but you have to understand that as far as Grandpa's concerned, you're both pieces of shit! Yeah. I can prove it mathematically.

Volte posted:

Yes, it worked fine, and was far more robust than the official solution which was basically "chop off various parts of the string and put them into a big switch statement".

I totally agree with the grader about the style though. Good god, C style comments? Totally random indentation?

Blotto Skorzany
Nov 7, 2008

He's a PSoC, loose and runnin'
came the whisper from each lip
And he's here to do some business with
the bad ADC on his chip
bad ADC on his chiiiiip

hieronymus posted:

I totally agree with the grader about the style though. Good god, C style comments? Totally random indentation?

Don;t troll.

Blotto Skorzany
Nov 7, 2008

He's a PSoC, loose and runnin'
came the whisper from each lip
And he's here to do some business with
the bad ADC on his chip
bad ADC on his chiiiiip
The part Volte left out is that after he showed his professor, the whole class had that assignment regraded and the prof got him an internship :unsmith:

That Turkey Story
Mar 30, 2003

And that TA was how!!

Beamed
Nov 26, 2010

Then you have a responsibility that no man has ever faced. You have your fear which could become reality, and you have Godzilla, which is reality.


Otto Skorzeny posted:

The part Volte left out is that after he showed his professor, the whole class had that assignment regraded and the prof got him an internship :unsmith:

And the professor was Albert Einstein!

evensevenone
May 12, 2001
Glass is a solid.

fritz posted:

What if we might want to increment x by something else later, you guys have hard-coded in that value.

You just overload int::operator ++(int) to a different value obviously.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

PrBacterio posted:

I just checked, and I have comments set to a slight (darker on dark backgrounds, lighter on light backgrounds) shade of grey in all four of the syntax hightlighting/colour schemes I use.

Yes, I was sarcastically pointing out that requiring green was dumb (especially on a print out).

Simulated
Sep 28, 2001
Lowtax giveth, and Lowtax taketh away.
College Slice
When you don't know how to teach/manage or measure performance, just pick some random things you *can* measure and use that.

shrughes
Oct 11, 2008

(call/cc call/cc)
Volte, with that break/continue usage and exit(1) I have to conclude that you have no sense of control flow.

That Turkey Story
Mar 30, 2003

I think I still probably have some of the first code I've ever written on an old hard drive. I need to dig it up and post it at some point. I remember looking at it a couple of months after I'd written it and realizing how horrible and buggy and leaky it was. I can only imagine what I'd think of it now (over a decade later).

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

That Turkey Story posted:

I think I still probably have some of the first code I've ever written on an old hard drive. I need to dig it up and post it at some point. I remember looking at it a couple of months after I'd written it and realizing how horrible and buggy and leaky it was. I can only imagine what I'd think of it now (over a decade later).

I'd love to be able to find my first big(ish) project that didn't involve retyping code from magazines. I wrote an ASCII text windowing system in QBasic, and I thought I was hot poo poo for it.

Unfortunately, all that code is probably on some decaying floppies buried in a landfill somewhere.

That Turkey Story
Mar 30, 2003

Thermopyle posted:

I'd love to be able to find my first big(ish) project that didn't involve retyping code from magazines. I wrote an ASCII text windowing system in QBasic, and I thought I was hot poo poo for it.

Unfortunately, all that code is probably on some decaying floppies buried in a landfill somewhere.

My project was an ocarina simulator that recognized the Ocarina of Time songs and a bunch of stuff from other Zelda games before it (you could switch between an ocarina sound and instruments I pulled from the other zelda games, i.e. all of the ballad of the windfish instruments, if you know Zelda. It was a little midi keyboard interface done with the number and letter keys arranged like a piano. The project was all manual win32 gui poo poo, DirectSound and DirectMusic (back when DirectMusic was actually a thing). I didn't really "get" RAII nor COM so I was not releasing interfaces, etc. and the way I verified whether songs matched was really convoluted. I have all of my old hard drives and I used to copy them over entirely to new hard drives/back them up to CDs on occasion, so I definitely have the code somewhere.

Volte
Oct 4, 2004

woosh woosh

shrughes posted:

Volte, with that break/continue usage and exit(1) I have to conclude that you have no sense of control flow.
What, the exit(1) is only for when an impossible thing happens and it aborts the program.

Otto Skorzeny posted:

The part Volte left out is that after he showed his professor, the whole class had that assignment regraded and the prof got him an internship :unsmith:
This is almost literally true but it was during the regrading that the TA made the statement about green comments and I still got a poo poo mark. :smith:

Rottbott
Jul 27, 2006
DMC

Thermopyle posted:

I'd love to be able to find my first big(ish) project that didn't involve retyping code from magazines. I wrote an ASCII text windowing system in QBasic, and I thought I was hot poo poo for it.

Unfortunately, all that code is probably on some decaying floppies buried in a landfill somewhere.
Same, except mine was ASCII Pacman. It had never occurred to me that there might be a way to get ask the computer for the time, so my framerate limiter was a FOR loop doing 10,000 square roots. (This was my first ever use of FOR.)

Later I got a Pentium II and had to increase to 100k square roots or something. I realised that I needed to make it run at a consistent rate on any speed of computer, so I 'cleverly' wrote a test which ran on startup, did a whole MILLION square roots and measured how long it took - I'd figured that out by then. So close! It used that information to decide how many square roots to run during gameplay. :downs:

Amazingly the game worked well enough and was fun to play, so in a way I've never really done better on a personal project.

qntm
Jun 17, 2009
In the original Space Invaders, the game gets faster as you kill more enemies for exactly that reason - there's no timing involved, the game just runs as fast as possible, and as you kill enemies there is less to render on the screen so the frame rate goes up. On modern machines, of course, you have to mess about with the clock or something, otherwise the game ends with your death as the enemies reach the ground instantly.

feedmegin
Jul 30, 2008

That Turkey Story posted:

I think I still probably have some of the first code I've ever written on an old hard drive. I need to dig it up and post it at some point. I remember looking at it a couple of months after I'd written it and realizing how horrible and buggy and leaky it was. I can only imagine what I'd think of it now (over a decade later).

Hard drive? My first code was on a zx spectrum's tape drive somewhere. Kids these days :corsair:

Rothon
Jan 4, 2012

Volte posted:

What, the exit(1) is only for when an impossible thing happens and it aborts the program.
This is almost literally true but it was during the regrading that the TA made the statement about green comments and I still got a poo poo mark. :smith:

It would be more appropriate to assert(3) or abort(3) there.

Rothon fucked around with this message at 17:53 on Jul 27, 2013

Volte
Oct 4, 2004

woosh woosh

Rothon posted:

It would be more appropriate to assert(3) or abort(3) there.
assert() is a debug function which is totally inappropriate for an error message and abort() causes the program to die catastrophically with a core dump whereas exit() simply exits the program with an error code. In particular, destructors are not called on abort(). In my opinion the only time it is appropriate to use abort() is if there is no safe way to continue the program (e.g. a call to malloc failed).

ctz
Feb 6, 2003
'impossible thing happens' is the perfect time to fail an assert(3) or abort(3). You want a messy, loud exit and a core dump so you can see how the program got into an impossible state. You do not want to execute any further code: no destructors, atexit handlers, etc. It is unsafe to continue the program.

Sorry to add to your collection of red text.

Sinestro
Oct 31, 2010

The perfect day needs the perfect set of wheels.
Why the gently caress would anyone care enough to buy a title over something like this. Guess you're Angry About Programming™.

That Turkey Story
Mar 30, 2003

What a waste of $10 or w/e.

RoadCrewWorker
Nov 19, 2007

camels aren't so great
Nice homophobia too, whatever douche did that.

Volte
Oct 4, 2004

woosh woosh
That's a spicy meatball

That Turkey Story
Mar 30, 2003

RoadCrewWorker posted:

Nice homophobia too, whatever douche did that.

Hint:

ctz posted:

Sorry to add to your collection of red text.

Volte
Oct 4, 2004

woosh woosh
It wasn't that guy, it was someone from #cobol

That Turkey Story
Mar 30, 2003

Buttbot did it.

Blotto Skorzany
Nov 7, 2008

He's a PSoC, loose and runnin'
came the whisper from each lip
And he's here to do some business with
the bad ADC on his chip
bad ADC on his chiiiiip
tefbuttbot did 9/11 :tinfoil:

ctz
Feb 6, 2003

I was referring to the corrections in this thread being like additions to the red text from his tutor :tipshat:

shrughes
Oct 11, 2008

(call/cc call/cc)
I'm real confused what somebody did. Did somebody buy a title or avatar?

Wasn't me. The only avatars I've bought were tef's and floWenoL's and mine.

That Turkey Story
Mar 30, 2003

ctz posted:

I was referring to the corrections in this thread being like additions to the red text from his tutor :tipshat:

Yeah I realized that, I figured you were making a reference while also making a funny!!!

bucketmouse
Aug 16, 2004

we con-trol the ho-ri-zon-tal
we con-trol the verrr-ti-cal

Dicky B posted:

I do this when defining lookup tables in C and I know it's pointless and annoying to maintain for anybody who doesn't have some kind of editor plugin but I can't help myself :( I suppose there are worse habits.

I demand you tell me which ide/plugin can do this.

Adbot
ADBOT LOVES YOU

Dicky B
Mar 23, 2004

bucketmouse posted:

I demand you tell me which ide/plugin can do this.
https://github.com/vim-scripts/Align

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply