12 Replies - 1325 Views - Last Post: 07 February 2010 - 08:33 PM

#1 LeisureProgrammer  Icon User is offline

  • N00by VB.NET Developer
  • member icon

Reputation: 110
  • View blog
  • Posts: 588
  • Joined: 06-September 09

Quick question about poor form and university assignments

Posted 22 January 2010 - 06:33 PM

I never comment my code and use non-descriptive variable names, and I don't use tabs while writing Java progs... Is that bad? :pirate:
I have looked at like 2 year old projects, and I can still understand them perfectly well, even with variable names like "aaa, bbb, ccc, blah, meh, lol, etc..." So I myself am not bugged by it.

Do you people know of any Uni. profs who might take off marks for that? I've never even had any sort of comp. sci. course in highschool yet, so I have no idea. :ph34r:
Any links to websites which give tips for getting full marks in "programming courses" are welcome too.

This post has been edited by LeisureProgrammer: 22 January 2010 - 06:34 PM


Is This A Good Question/Topic? 0
  • +

Replies To: Quick question about poor form and university assignments

#2 KYA  Icon User is offline

  • g++ jameson.cpp -o beverage
  • member icon

Reputation: 3101
  • View blog
  • Posts: 19,141
  • Joined: 14-September 07

Re: Quick question about poor form and university assignments

Posted 22 January 2010 - 07:46 PM

Depends on the professor. I've had a little of both camps(will take points off vs. who cares).

You should change your ways though, at some point, you won't be the only one looking at your code.

Personally I think anyone who uses single letter variables names for anything but a loop counter or shit like 'aaa' should be shot.
Was This Post Helpful? 1
  • +
  • -

#3 macosxnerd101  Icon User is online

  • Self-Trained Economist
  • member icon




Reputation: 10572
  • View blog
  • Posts: 39,143
  • Joined: 27-December 08

Re: Quick question about poor form and university assignments

Posted 22 January 2010 - 08:20 PM

View PostKYA, on 22 Jan, 2010 - 10:46 PM, said:

Personally I think anyone who uses single letter variables names for anything but a loop counter or shit like 'aaa' should be shot.


There's actually a senior in my AP CS class who likes to use odd variable names like theCowSaysMoo. My teacher will take off points for his code just b/c he feels that it will piss off the AP graders, possibly causing him to lose points on the AP Exam.

Class aside, I find it helpful personally to use meaningful variable names, plus it helps others who are looking at your code (like DICs debugging your code :)) follow your program a little easier. It is a very good practice to get into for the long term.
Was This Post Helpful? 1
  • +
  • -

#4 erik.price  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 485
  • View blog
  • Posts: 2,690
  • Joined: 18-December 08

Re: Quick question about poor form and university assignments

Posted 23 January 2010 - 01:13 PM

When I was first doing Python awhile back, I'd use names like 'x', 'xx', 'y', 'yy' for loops.

Here's a Python script I dug up (probably written around May 2008)
a1 = random.choice('qwertyuioplkjhgfdsazxcvbnm')
a2 = random.choice('qwertyuioplkjhgfdsazxcvbnm')
a3 = random.choice('qwertyuioplkjhgfdsazxcvbnm')
a4 = random.choice('qwertyuioplkjhgfdsazxcvbnm')
a5 = random.choice('qwertyuioplkjhgfdsazxcvbnm')
a6 = random.choice('qwertyuioplkjhgfdsazxcvbnm')
a7 = random.choice('qwertyuioplkjhgfdsazxcvbnm')
a8 = random.choice('qwertyuioplkjhgfdsazxcvbnm')
a9 = random.choice('qwertyuioplkjhgfdsazxcvbnm')
a0 = random.choice('qwertyuioplkjhgfdsazxcvbnm')
x = 0
print "Running..."
while a1+a2+a3+a4+" "+a5+a6+" "+a7+a8+a9+a0 != "erik is here":
	a1 = random.choice('qwertyuioplkjhgfdsazxcvbnm')
	a2 = random.choice('qwertyuioplkjhgfdsazxcvbnm')
	a3 = random.choice('qwertyuioplkjhgfdsazxcvbnm')
	a4 = random.choice('qwertyuioplkjhgfdsazxcvbnm')
	a5 = random.choice('qwertyuioplkjhgfdsazxcvbnm')
	a6 = random.choice('qwertyuioplkjhgfdsazxcvbnm')
	a7 = random.choice('qwertyuioplkjhgfdsazxcvbnm')
	a8 = random.choice('qwertyuioplkjhgfdsazxcvbnm')
	a9 = random.choice('qwertyuioplkjhgfdsazxcvbnm')
	a0 = random.choice('qwertyuioplkjhgfdsazxcvbnm')
	x = x+1

Yeah, it's that bad.


I agree with macosxnerd entirely.

This post has been edited by erik.price: 23 January 2010 - 01:13 PM

Was This Post Helpful? 0
  • +
  • -

#5 Auzzie  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 43
  • View blog
  • Posts: 573
  • Joined: 20-January 09

Re: Quick question about poor form and university assignments

Posted 23 January 2010 - 03:02 PM

Personally i have always tried to follow coding standards and naming conventions, got a bit of a shock at college, one lecturer use to fail us and make us resubmit our work if we didn't use useful naming conventions for anything except loop counters...
Was This Post Helpful? 1
  • +
  • -

#6 robob686  Icon User is offline

  • New D.I.C Head

Reputation: 7
  • View blog
  • Posts: 44
  • Joined: 24-April 09

Re: Quick question about poor form and university assignments

Posted 26 January 2010 - 10:13 AM

Just put it this way, no professor will take off points for having too good of form when coding or too readable of code. I have had professors that take off 10 points because I used the var name a1 instead of aOne b/c the 1 looks like a l. I consider readability a lot when I code, but I have been taught that since I started.
Was This Post Helpful? 1
  • +
  • -

#7 SpeedisaVirus  Icon User is offline

  • Baller
  • member icon

Reputation: 114
  • View blog
  • Posts: 855
  • Joined: 06-October 08

Re: Quick question about poor form and university assignments

Posted 01 February 2010 - 11:15 AM

I haven't had a teacher yet where style hasn't been a part of the grade. All have made it clear that they will refuse to grade unformatted code if they have to look at it.

Comments are more relaxed but if there is something that isn't self documenting and they look at it, if there isn't comments I have lost points until I explained the code to them. That helps them know I didn't copy paste it from someone.
Was This Post Helpful? 1
  • +
  • -

#8 Allizoid  Icon User is offline

  • D.I.C Head

Reputation: 4
  • View blog
  • Posts: 91
  • Joined: 09-November 09

Re: Quick question about poor form and university assignments

Posted 01 February 2010 - 07:33 PM

At high school it was get the program to work and nothing more.
At uni, style has been marked from the beginning, at first it was ~5% per assignment, but now if you don't follow recommended structures (ie intrinsic documentation, using other functions instead of putting everything in the main function, the use of classes etc) you could lose up to 50%. Which I think is fair. You try working in a group with someone that names all their variables "yarg", "yargitty" and "joop", with no comments :P
Was This Post Helpful? 1
  • +
  • -

#9 SpeedisaVirus  Icon User is offline

  • Baller
  • member icon

Reputation: 114
  • View blog
  • Posts: 855
  • Joined: 06-October 08

Re: Quick question about poor form and university assignments

Posted 02 February 2010 - 04:17 PM

All I know is that there is nothing that is a bigger pain in the ass than working with someone that doesn't format their code, use meaningful var names, and comment code. Want my help? Conform to style standards.Want to work with me? Conform to style standards. As I'm about to head into industry, my worst nightmare is ending up on a team that writes sloppy code.
Was This Post Helpful? 1
  • +
  • -

#10 SpeedisaVirus  Icon User is offline

  • Baller
  • member icon

Reputation: 114
  • View blog
  • Posts: 855
  • Joined: 06-October 08

Re: Quick question about poor form and university assignments

Posted 02 February 2010 - 04:27 PM

All I know is that there is nothing that is a bigger pain in the ass than working with someone that doesn't format their code, use meaningful var names, and comment code. Want my help? Conform to style standards.Want to work with me? Conform to style standards. As I'm about to head into industry, my worst nightmare is ending up on a team that writes sloppy code.
Was This Post Helpful? 1
  • +
  • -

#11 Travis1012  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 36
  • View blog
  • Posts: 222
  • Joined: 05-August 09

Re: Quick question about poor form and university assignments

Posted 05 February 2010 - 05:04 AM

I have had a lecturer who has insisted on commenting of code by making it worth 20% of the marks for assignments. As for memorable names for variables he did not seem to mind, as long as the commenting made it understandable.
Was This Post Helpful? 0
  • +
  • -

#12 Guest_Ashley*


Reputation:

Re: Quick question about poor form and university assignments

Posted 07 February 2010 - 05:09 PM

My professors will fail you if you never comment or format your code.
Was This Post Helpful? 0

#13 erik.price  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 485
  • View blog
  • Posts: 2,690
  • Joined: 18-December 08

Re: Quick question about poor form and university assignments

Posted 07 February 2010 - 08:33 PM

I think that's a good thing. It doesn't take very long to make your variables readable and descriptive, and it forces you into a good habit.

In my APCS course, we actually get the opposite: our materials frequently use names like dd, ii, jj and so on in example code.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1