[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
Behold a program that gets an F in college.
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 255
Thread images: 31
File: fuck_pajeets.jpg (874 KB, 2560x1382) Image search: [Google]
fuck_pajeets.jpg
874 KB, 2560x1382
Behold a program that gets an F in college.
>>
>>53931973
nothing worse than people who insist on commenting *absolutely* everything regardless of how self-explanatory the code is
>>
>>53931973
Why did it fail? Taking C++ myself this semester
>>
/* This is linking to OP's post, so he gets a (You) and everyone knows that I'm replying to him. */
>>53931973
/* This line uses meme arrows, so that the text is coloured green, and everyone will interpret it as a meme */
>Not commenting your code
/* I end my post here. */
/* See you all next time :^) */
>>
>>53931973
You should have failed for this alone
using namespace std;
>>
>>53932005
-4 points for each and every function that doesn't say what it does, what it takes, what it outputs and how it does it
>>
>>53932047
I got docked points on an earlier project for not doing so and using std::cin and std::cout because "we aren't teaching high level stuff yet." For over half the semester using a function besides main or using arrays would make you lose up to 70% of your grade.
>>
>>53932048
I've had that bs happen to me as well. One time my professor took off because instead of having a title "Project1" I had "Project 1" Almost always though, I get fussed at for not having enough comments or setting decimal precision. I get the desire of having good code, but when everyone just looks the same, it just lacks originality
>>
>>53932069
You should consider complaining to the unit coordinator, if this is your unit coordinator then complain to the head of department.
>>
>>53931997
In this case the functions may be very short and you can do without comments. But it's an important habit to learn to properly comment your function and describe the input ranges, expected output, side effects, etc..
For example think of automated documentation, it's really annoying if it lacks comments even for a one-line function, since you need to search in the code just to see that line.
So it makes sense that it's required for an educational exercise. And I bet the prof told him that it was required, but OP, like a retard, chose to ignore his instructions and deserves his F.
>>
>>53931973
If you're taking a class, just follow the fucking instructions and you'll pass.
>>
Alright students, it's time for a lesson, pay attention this time will you?

Most professors have spent some time in the industry. Most projects are not very simple, they're actually massive projects with several databases with several interfaces for the different functions of a company.

If you can't learn to write comments on simple programs, you probably won't write comments on larger projects.

There was this one company that was in business for a little less than 20 years still using original code. Each time the code broke, they patched it up using miles ribbon code. None of it was commented very well.

When they paid for vendors to upgrade their systems, they had to pay out about $80k usd because of poor documentation and they themselves not knowing what the code does.

College is just a prep environment. No one comments everything, but at least prove that you can write comments. Fucking dumb students thinking they're hot shit when chances are they'll go on to make the same mistakes and cost thousands down the line.
>>
>>53932093

Code for assignments shouldn't look original. There are a selection of best implementations for those assignments and if yours doesn't look like one of them, it's bad.
>>
>>53931973
You didn't pay attention and shouldn't have gotten away with not documenting functions, >>53932164 is right.
>>
>>53931997
All functions should have a single comment explaining their return value and arguments. Other comments can be placed within the function body to explain difficult code as necessary.
>>
>>53932172
sometimes the code to mock is shit, for example, using cout+cin statements to get a variable, and not allowing students to add a loop to check if the data is valid (ie reject a -1 or value over x)
>>
>>53931973
write some fucking comments you nigger
>>
>>53931973
read the fucking criteria you fucking nigger
>>
I wish I was a university professor, I'd get to spawn so many crying threads on /g/ by deducting marks for going over 80 columns and for functions with side effects.
>>
What program is this?
>>
File: well.png (22 KB, 634x159) Image search: [Google]
well.png
22 KB, 634x159
>>53932267
>80 columns
This isn't 1990 anymore gramps.
>functions with side effects
Pic related.
>>
>>53932267
>C++
>avoiding side effects
that's a bit like mowing a lawn with scissors
>>
https://a.uguu.se/qdjkvv_201-Project3-S16.doc

Feel free to read the assignment (which was given to us as a doc and not a pdf).
>>
>>53932340
Clearly I would not be teaching with a terrible language like C++. My classes would be Lisp or Haskell only.
>>
>>53932021

I like this post.
>>
>>53932320
>This isn't 1990 anymore gramps.
Some of us like to have multiple windows next to each other. Enforcing 80-100 column limits is still very useful.
>>
>>53932365
>not written in Haskell - F
But Prof Anon this is a C++ course...
>>
>>53932356
>Please remember to follow the assignment guidelines for the course
Which will probably tell you to comment your shit.
>>
>>53932340
If you can't avoid side effects with C++ I'd like to see what you could do with JavaScript.
>>
>>53931973
>Your header comments are impressive.
sikk burn tho
>>
File: waifu.jpg (226 KB, 869x1776) Image search: [Google]
waifu.jpg
226 KB, 869x1776
>>
>>53932047
idk why ever book and class encourages it, too lazy to teach people how namespaces actually work zzzzz
>>
>>53932365

Pascal = best intro to programming language
>>
>assignemtn is to coment his code
>doesnt comment hisd code
>surprised when he failed
>>
>>53932377
not only that but sticking to a fixed line width helps to prevent you from making indent after indent after indent... which normally ends up with horrible code. if you indent more than 5 times you are doing something wrong no doubt.
>>
>not removing points because he didn't comment what every single cout and cin were doing
>NOT COMMENTING WITH A WRITTEN ESSAY THE PHILOSOPHY BEHIND THE CHOICE OF THE VOID RETURN TYPE AND THE SOCIOECONOMICAL IMPLICATIONS
>not having a podcast for supplementary commenting
>not having commercials
>not having credits that end with a special scene with a cameo from nolan
nice third world college senpai
>>
>>53932736
>implying those do anywhere near the same thing
>implying finding a square root, which is hard for computers, is "making things more complicated for no reason"
>implying finding a maximum takes effort
TRIGGERED
>>
>>53932776
he's a l33t special snowflake coder who needs no instructions

I mean he's using emacs AND vimperator, he obviously can do everything and should pass automatically
>>
>>53931973
Nice org-table
>>
>>53931997

Disagree.

Wait until you actually work for a living and inherit someone's uncommented code.

Comment liberally or fuck off and die, please.
>>
>>53931997
It's retard cargo cultists
>>
>>53932812
>every line needs a comment
stackoverflow is that way, pajeet
>>
>>53932736
>1 empty line, 99% code

>99% comments, 1% code

Apparently calculating a square root in O(1) is bad code while the maxindhz7cickdusakxla
>>
>>53931973
HEY GUYS, LOOK, I THINK I'M SMART BUT I'M TOO STUPID TO COLOR WITHIN THE LINES AND GET EASY 4.0S AND DO CREATIVE SHIT ON MY OWN TIME
>>
>>53932847
It's not even the original code, which had comments. Although they all boiled down to "wtf"
>>
>>53932736
>>53932803
>>53932847
Protip; this tweet is fake. Her 'coding' nonsense is awful, but not as bad as that.
>>
>>53932164
80k is like 2 programmers for 2 months. That's not a lot of money.
>>
Why is there such animosity between programmers on this site? There's no real incentive to be a dickhead is there? Like minds and all that...
>>
Shouldn't main() be in the end of the code after all those functions?
>>
>>53932913
Go whine on reddit if you don't like getting called out on your bullshit
>>
>>53932913
its nerds

nerds just act like that
>>
>>53932913
heil
>>
>>53932913
It's only because OP posted this thread expecting us to echo his notions about his professors, when in fact, his program deserves the mark it received.
>>
>>53932932
Did you not see the function prototypes?
>>
>>53931973
Maybe put a comment in then
>>
File: wew.png (744 KB, 3360x2100) Image search: [Google]
wew.png
744 KB, 3360x2100
>>53931973
haha get rekt fag, you're code looks like crap.

Behold code perfection (pic related)
>>
>>53931973
Totally deserved. The teacher is aware people can do this, but he's trying to teach you fucks to detail your shit. I found your code pretty straightforward, but the point still remains.
Commenting is not only necessary, it's also an art that tests your language expressiveness skills.
>>
>>53932834

Thanks NEET.

Wake us up when you do something of value.
>>
>>53932978
>variable names and comments not in English
F
>>
>>53932979
What is there to comment on?
>>
who wants to talk about inserting things that cannot fail due to hardcoding (i.e. a db driver) into a try catch statemente? is it the best way to remove the soul of a person?
>>
>>53931973
Your own fault for not figuring out what is acceptable by Project 3. This is something that you should have been weary about, and that you could have asked your TA about. Even in the professional world, it is your responsibility to figure out and conform to the standards of your team (or convince them to change, not whine about it on 4chan).

And then you blame Pajeet the boogieman. Top kek.
>>
>>53931973
This is general feedback advice: school (college included) isn't real life. Throw your real life standards to the side, and do whatever it takes to please your instructor if you want a good grade even if it's arbitrary standards. This attitude might come in handy with your boss one day, too.
>>
>>53932990
good fucking thing you've deduced that I'm a NEET that has done nothing of value based on the fact that I simply disagree with your view, you daft cunt. go add more comments to your hello world written in Node or whatever other hippie retard language kids these days use
>>
Commens aren't needed because the names of the functions and variables are self-descriptive.
Teacher failed.
>>
>>53932913
its not animosity its you had an assigment and you failed to complete it
>>
>>53932736
>removing "// what the fuck?"
>>
>>53933028
teacher evaluates your comments, not your code. Bazinga
>>
>>53933028
It's an exercise, retard.
Learning to comment your functions is simply part of it.
>>
>>53931973
Next time do exactly what the teacher want you to do, not what is right. This is not real life where you can improvise or use something efficient, this is an exercise.
>>
>>53931973
>
void verify_pockets(int& pocket_amt, string pocket_type)

you went full retard there, m80
>>
>>53933001
Pretty much nothing, but adding some description above each function's signature could've been a big difference, I don't know. Like I said, the code's easy to read and follow, but seems like it's not what's being evaluated.
>>
>>53933063
>exercise
/*we exercise here begin*/
int exercise( float) {
exercise in copy pasta }
/*we exercise here end*/
>>
>>53933055
>>53933063
// vol_sphere
//
// Return the volume of a sphere of radius sph_radius.
double vol_sphere(double sph_radius) {
return 4.0 / 3.0 * PI * sph_radius * sph_radius * sph_radius;
}


Very helpful comments. Absolutely essential to understanding this program.
>>
>>53932994
> I'm a stupid american that only knows english
> therefore everyone must program in english
>>
>>53932320
Chances are the person who commented that was born after 1990 anyway.
>>
>>53932812
I have to completely fucking disagree with you. There is LITERALLY no point in commenting certain lines. If you comment EVERY FUCKING LINE, I'd want to fucking strangle you for decreasing readability with useless fucking comments, you dumb idiot.
>>
Code should be self documenting

Comments will become outdated
>>
File: batpatman.jpg (15 KB, 320x272) Image search: [Google]
batpatman.jpg
15 KB, 320x272
>>53932021
nice
>>
>>53933103
you forgot the >bugs: you tell me :^)
>>
>>53931973
this kind of shit is why I dropped out, every single fucking method needed

>blurb
>pseudocode
>documented input and output objects
>name and date

and you'd get graded down for missing anything

now I have an actual fucking programming jerb and nobody does this shit ever. it's absolutely completely fucking useless no matter how you slice it.
>>
>>53933103
How fucking dense are you?
It's for beginners, the prof can't give you some very complex task that would actually make comments necessary yet.
But he still has got to teach you to use them early.

>>53933139
I'm German, retard.
English is an absolute must here.
>>
>>53933172
// bollocks.c -- assignment 01 for Professor Shekelberg
// YES PROFESSOR I USE COMMENTS

Job done, mate.
>>
damn that's harsh
>>
>profs asks us to implement bubble sort
>pfft that's pleb shit for girls
>implement superior quick sort instead
>stupid prof fails me
>drop out
>enjoying the neet life
>>
>>53933214
>prof asks us to implement bubble sort
>you call qsort instead
>top marks
>>
>>53932093
Tb h you deserve to lose points if you have spaces in your filename
>>
>>53933214
> Professor wants you to solve problem on your own
> Use some one else's solution
> Get shitty grade as deserved
>>
>>53933172
pissing your pupils off is never a good way to teach

and in absolutely no circumstances is it okay okay to teach something useless to people who are PAYING for it. this super thorough bullshit is completely indefensible

if you want to teach good habits then grade down magic numbers, bad names, lengthy nondescript method calls, etc
>>
>>53933155
>>53932021
>using the smiley with a carat nose
>>
>>53932202
Agreed. This makes a world of difference. Even reading your own code months later that tiny little comment explaining arguments and return on a function will save a hundred times the time and effort it took to write it.
>>
>>53933282
99% of the time you should be using somebody else's solution, don't waste time trying to be a special snowflake and let the researchers tackle the complex problems for you

they do their job and you do yours
>>
>>53933321
That's fine by me, what I disagree with is the practice of overcommenting.
>>
>>53933295
>paying for education

>>53933268
I had a prof that gave you less points if you had ".DS_STORE" files in your submission.
I loved it.
>>
>>53933329
Using someone else's solution means NOTHING if you can't solve the most simple of problems on your own.
>>
>>53931973
What font is that?
>>
>>53933329
The point of it is to learn good coding practices and how to properly solve problems in code. Its to build problem solving and a specific way of thinking.

If you're better at this out of the box just quickly get the assignment done and then do what you want to on the side for fun to learn.

Thats literally all education is.
>>
File: 1330132566374.jpg (37 KB, 526x473) Image search: [Google]
1330132566374.jpg
37 KB, 526x473
>>53933346
>I had a prof that gave you less points if you had ".DS_STORE" files in your submission.
>>
I understand code better than comments.
>>
>>53933329
>average stackoverflow user
>>
>>53933346
somebody's fucking paying it for it. you think teachers work for free? I'm all for subsidized or plain free education but you're a piece of shit if you don't appreciate the value behind it.

>>53933356
>>53933373
in that case, don't hand out a "bubble sort" assignment, devise new unique problems because that's what programmers actually face in the field

>>53933391
>I've literally never worked against a deadline in my life
>>
>>53933386
Then the author of those comments lacks the ability to succinctly express their ideas in natural language. This is a real skill that OP's professor was probably trying to impart.
>>
>>53933414
>but you're a piece of shit if you don't appreciate the value behind it.
I'm not the one trying to be a special snowflake and ignore instructions from my prof
>>
>>53932021
femal coder detected
>>
>>53932069
>>
>>53933415
Let me see your code and comments then.
>>
Hey OP, how about you stop being a retard and follow the guidelines? You deserved what you got.
>>
>>53933434
>everything glorious teacher does is perfect
>do not question the almighty curriculum
whether it's your state or your daddy paying for your education, somebody's getting fucked by your teacher's incompetence
>>
>>53933414
I've had professors try to come up with new and unique problems that end up becoming a mundane task that feels as though it has no actual purpose at all. In the end its no better than the bubble sort.

The only classes that have actually been interesting are embedded systems ones where at the end we're given the freedom to do whatever project we want as long as it is approved by the prof.
>>
>>53933469
He's incompetent for following standard teaching methods that pretty much all colleges do?

Sorry but that F was your failing and not your prof's.
Unfortunately you seem too dense to understand even that very clear lesson he gave you.
>>
>>53933341
What do you consider over commenting? I was recently reading the JSF C++ coding standards and in them the DoD requires one line of commenting for every line of logical code.
>>
>>53933528
Also here's a link to a .pdf of them if anyone is intrested.

http://www stroustrup com/JSF-AV-rules pdf
>>
>>53933528
My personal preference is:
Before the function prototype: Multi-line comment explaining the function's utility, parameters, output and potential undefined behavior.
Within the function body: Minimum and concise, reserved for portions of the code where the logic is unclear.
Although "over commenting" in the DoD's case does make more sense for mission-critical applications, where there's not much room for misunderstandings.
>>
>>53931973
College is half about actually learning a subject, half about learning how to guess how to please people who will grade you. The later is very useful in the employment world.
>>
>>53933528
Not him, but:
>Any comment which describes how something is done, not what is done
>Any comment which states anything that is obvious from the code
>Code banners
Really, there should be a brief comment at the top of functions, stuff like "TODO", "FIXME" etc., and maybe a brief comment at some particularly complicated piece of code (although rewriting it to be less complicated is better).
>>
>>53933622
>guess
It seems OP had detailed guidelines on what to do and he could have always talked about his prof/TA when he had problems with his assignment before submitting something.
He really has no excuse.
>>
>>53933650
*with
>>
>>53933149

>"comment liberally"

>Interprets this as "comment every line" for some reason, probably birth defects or autismo


You're not much of a reader, are you?
>>
>>53933650
>It seems OP had detailed guidelines
Fuck, he's lucky. As retarded as they may be, there's no excuse then. Or maybe he wanted to see how far the absurdity of assignment grading in college could go. I hope he learned it has no limit whatsoever, which a great life lesson if you get to work for a company that has stupid rules/managers in place.
>>
>>53931973
I 100% GUARANTEE that the professor made it known that you needed comments, regardless of what you think.

Your own fault.
>>
>>53933690
Why don't you specify what you mean by "liberally" then?
>>
>>53931997
In my university's beginner programming classes (Taken by CS, math, physics majors mostly but also random people who want to think programming may be useful) required students to comment nearly everything. It's cancer to see stuff like "count += 1 # Increment the count by one each time"
>>
>>53933746
I know nothing about C and I can understand the code just fine, it's really clear and to the point. Extraneous comments would make it painful to read.
>>
File: Capture.png (26 KB, 492x588) Image search: [Google]
Capture.png
26 KB, 492x588
>>53932812
You don't need to comment everything. UNLESS YOU DON'T FUCKING RENAME ANYTHING REEEEEEEEEEEEEeeeeeeeee
This program would be fucking fine if they renamed the fucking buttons and shit.
>>
>>53933830
Is that fucking VB?
Not sure without the "Dim"s
>>
>>53932978
>you're
Pajeet, is that you?
>>
>>53933858
>Not sure without the "Dim"s
That's because the fucking poo that wrote it didn't know what a fucking string was and used invisible fucking textboxes .text fields to store fucking strings.
>>
>>53932978
>not coding in english
Do you program for a mexican drug cartel?
>>
>>53933084
not a C programmer, can you explain?
>>
>>53932736
>if(a > b && b < a)
>>
>>53933884
It's not spanish. It's brazilian pt. And yes, programmers are that retarded around here.
>>
>>53933084
muh pass by alias speed
>>
File: oMJ28xM_700wa_0.gif (1 MB, 400x206) Image search: [Google]
oMJ28xM_700wa_0.gif
1 MB, 400x206
/* Quotes previous poster */
>>53932021
>>
>>53933172
German here as well. I have to comment english in Uni (as it should be) and my boss told me to in a small job I did as well.
>>
File: it's alive.png (37 KB, 775x297) Image search: [Google]
it's alive.png
37 KB, 775x297
>>53933906
You can never be sure of what happens.
>>
>>53933883
Oh wow.

That's what you get for not throwing away job offers that have anything with VB in it I guess
>>
File: 1452990630455.jpg (60 KB, 991x902) Image search: [Google]
1452990630455.jpg
60 KB, 991x902
>>53933391
>>
>>53933908
Thank god they'll be staying out of America when the wall is built
>>
>>53933934
>That's what you get for not throwing away job offers that have anything with VB in it I guess
It didn't. I'm just IT support and I had to get this program running, so I dug through the code to find out where the video path was stored. It was stored in a fucking Access database. An Access database. For the video and video duration. They used a fucking timer and video duration to find out when to stop playing the video. THERE'S A FUCKING VIDEO ENDING EVENT IN THE MEDIA PLAYER CONTROL THEY USED.
>>
>>53933981
>just IT support
I'd ask for a raise, no way they're paying you enough for this shit.
>>
>>53934016
I'm an intern so I can't get raises.
11.50 USD/hour, I'm raking in the dosh.
>>
Just read the fucking instructions next time.
>>
>>53933756
Not that guy but it means if you ask yourself "is this line/block extremely self evident?" And the answer is not a overwhelming YES(i.e. you have absolutlet no doubt a competent programer will know what you attempted to do just by briefly looking at it), then you comment it anyway.
>>
>>53933414
Dude. Bubble sort is like assignment #2, after "hello world".

Chill.
>>
>>53932069
Consider changing school. Alternatively, sticking barbed wire down the corrector's throat.
>>
Meh just do whatever the prof tells you and collect your grade. A lot of early classes are aimed directly at the lowest hanging fruit, and people who are competent just have more time to watch animu.

>>53932164
I've worked in the industry, and I've encountered too much ancient code that was handed down from 5-20 years ago with comments that originally were probably helpful, but told me nothing about how the program currently operated. Self-documenting code, more or less, updates the explanation of its logic itself. Comments are so volatile and too many shit devs forget to update them that one of their theoretical benefits (letting people who inherit code work with it meaningfully) is lost in practise.

Comments are a waste of time unless you're setting up contracts or explaining something that is written in an almost obfuscated way.
>>
>>53932879
Where the fuck do you live? That's 20k a month per programmer or 240k per year.
>>
>>53934217
Silicon Valley / San Francisco / Anywhere with a high cost of living in America
>>
ITT: people not getting it.
This is not about the comments. If the prof wants you to comment every fucking line, then you fucking comment every fucking line.

What is truly shit is how OP got subtracted point for every single function he didn't comment. You don't subtract points for repeating the same mistake if the rest is consistent. That's grading 101. Also, you don't start from x points and then subtract for every error: you decide how many points you award for every tiny achievement and add points for that. Otherwise, assuming OP had written 10 more function, you would have a situation where he was given negative point, while still getting most of the assignment right.
>>
>>53934241
>You don't subtract points for repeating the same mistake if the rest is consistent.
Err, you do.
This isn't high school anymore, you know.
Every prof I ever had grades home assignments just like that too.
>>
>>53931973
>>53931973
"Unfortunately you didn't comment your functions, however."

Nothing give me a rage like a professor unable to into simple English phrasing giving me a low grade on something.
>>
>>53934518
He's not grading your English homework.
>>
>>53934217
Any consultant will charge that much, which will always be easier than hiring the asshole that wrote that code in the first place
>>
>>53934274
Well, depends. Now that I think about it, you're right, if I were to grade OP's example I probably would award x points in total to students who wrote all comments, and subtract most of them from OP. He'd still get all points for the actual code, fairness achieved.

IMO the consistency thing still applies to minor mistakes, though. Assuming, I don't know, I'm grading an exam where students had to write code on paper, and one student doesn't remember the syntax of a for statement. I would subtract points once, not once for every wrong statement. Although the discussion is obviously moot, since it's the professor's decision how I have to grade exams, not mine.
>>
>>53934589
exams and home assignments are different things, and tend to be scored differently

for example getting a zero on a single assignment is usually no big deal
>>
>>53934641
Where I study, a zero on an assignment is a pretty big deal. In all classes you need 50% of the assignment points to be admitted to the exam, so if you royally fuck up once in a class with few assignments, you might immediately be failed.
In the class where I'm a TA, students need to pass every single assignment to be admitted (that's why we grade them way more nicely than the exam).
In some classes the points of the assignments are added to the points in the exam to calculate the final grade. So yeah, at my uni assignments are still a big fucking deal, and unfair TAs are scum.
>>
>>53934764
>In all classes you need 50% of the assignment points to be admitted to the exam
Yes, but they don't make into the final grade.
It's pretty easy to cancel that out.
How's that a big deal?
Usually I'd end up not doing the last 2-3 assignments since I already got a pass.

>students need to pass every single assignment to be admitted
Never encountered that
>In some classes the points of the assignments are added to the points in the exam to calculate the final grade
I had one course that did something like that but even there it was optional.
>>
>>53932978
>var contadorDeParenteseExperssasoSerResolveraEbauweawjawd

Jesus fucking christ.
>>
in the future OP just add halfass 1line comments everywhere

its annoying but you have to appease the people who grade you

i'm sure they gave you a rubric that told you this before, thats harsh of your teacher to dock so many points though theys hould have done a -10 and warned you
>>
>>53933981
we still have old applications that run off access databases, thankfully we are about to phase them all out but they lasted 20 years
>>
/*
* =====================================================================================
*
* Filename: reply.cpp
*
* Description: Reply to an incorrect poster on an anonymous anime board.
*
* Version: 1.0
* Created: 08/24/2016 10:52:28 AM
* Revision: none
* Compiler: gcc
*
* Author: steve
* Organization: [email protected]
*
* =====================================================================================
*/

//Pointer to first character of a string comprising the comment of a poster on an anime board
>>53932021
//This shitty box makes it so everyone knows how much I like stroking dick
/* ---------------------------
| BEGIN REPLY |
---------------------------
*/
> Using /* */ for one-line comments
/* ---------------------------
| END REPLY |
---------------------------
*/
>>
How strange. In my undergrad years, if style was graded at all, it would have been at much 10 percent of the grade.

In any case, your assignment deserves an A-. The functions are fairly self descriptive, but you shouldn't be passing std::string by value. Use a const reference instead to avoid unnecessary copying.

t. A computer science grad student.
>>
>>53935152
Programs from the FUTURE
>>
>>53932202
>struct vec3 cross_product(struct vec3 a, struct vec3 b)

I could never have figured that out without a comment.
>>
>>53935152
>Using /* */ for one-line comments
That's usually for C89 compatibility, isn't it?
>>
>>53933931
You need to be more verbose than that anon, I want my terminal buffer to get raped at each exception in your program.
>>
>>53932021
>tfw you always comment the conclusion of a file with some cutesy stuff and a <3
some poor neckbeards gonna think i'm a girl D:
>>
>>53931973
One of the reasons I left my college's CS program was because they failed you if you didn't spend more time documenting than actually programming. The most basic functions needed at least a paragraph of documentation with them or your grade would get fucked.

Meanwhile they discouraged long variable names in preference of "a, b, c" because it's "easier to read". Fucking bullshit.
>>
File: CarolinaMcCluskey_rdax_90.jpg (20 KB, 233x300) Image search: [Google]
CarolinaMcCluskey_rdax_90.jpg
20 KB, 233x300
>>53931973
>http://www2.lv.psu.edu/ojj/courses/cmpsc-201/cmpsc201syllabus.html
>Instructor: Dr. Carolina McCluskey
>>http://www.lehighvalley.psu.edu/FacultyStaff/29322.htm

anon, go speak to someone that knows what they are doing and report her ass to the board, do this asap or she mimght get some excuses going on (you know, muh feminism in 'merica)
god speed anon, god speed
>>
>>53935905
They're right though.
Long parameter names are disgusting.
>>
>>53935905
Sounds like you got the troll course.

there are literal code obfuscator programs to turn variables into a,b,c and so forth. They don't do the user any good.
>>
>>53933491
batshit insane professors can always come up with original stuff:
"Yo, so we saw vliw and simd this morning, there is this thing called mmx, here is a link to the spec, here is an mjpeg decoder with a soft ycrcb_2_argb impl, get to fucking work you got 3 hours"
>>
>>53932047
Not really an issue though with a simple program as it makes things more readable and quicker to write. That functionality was put there for a reason.
>>
Looks like it wasn't able to comprehend the code, felt dumb and blamed you for it then gave you a bad mark OP
>>
>>53935963
Parameter names are documentation in and of themselves.

I'm not talking 32 character names here, but something simple like "cuckshedx" or whatever was discouraged in favour of "cx" or just "a" or some ridiculous shit.
>>
>>53931973
>using namespace
Stopped reading there. F-
>>
>>53936070
So you would do some nonsense like multiply(mulx, muly) instead of multiply(a,b)?
>>
File: 14601379442592034408612.jpg (3 MB, 3120x4160) Image search: [Google]
14601379442592034408612.jpg
3 MB, 3120x4160
>>53936003
and speaking of commenting and that assignment from hell, you HAD to comment every line or else you would be already lost 15mins in

(on mobile too lazy)
>>
>>53936108
It depends, sometimes descriptive names are helpful. Obviously if they're trivial parameters like a counter or something "a" will suffice but when you're trying to write a complex program using only single-character names it gets confusing fast.
>>
>>53936158
seems reasonable in that case
>>
File: 101.jpg (18 KB, 150x182) Image search: [Google]
101.jpg
18 KB, 150x182
>>53932736
>>
File: hikari.jpg (840 KB, 1300x1779) Image search: [Google]
hikari.jpg
840 KB, 1300x1779
>>53934872
wew lad, at least it's really readable, also you only write big names once, the auto-completion kicks in afterwards.
>>
>>53936163
>counter
>anything but i,j,k,..

disgusting
>>
>>53936260
>not using kanji for all parameter names
馬鹿
>>
>>53932048
man. fuck that.
I went through the same shit with my second programming class (was C++ at De Anza community college).
The teacher was super anal about formatting and comments. I talked to the teacher after receiving back my 1st graded assignment and was able to fix the discrepancies and get a proper grade.
Then for the rest of my programming classes at De Anza I was super careful to follow teachers' style preferences, and didn't have a problem again.

My code is probably more legible now thanks to that experience
>>
>>53931973
Nah, you fucked up, mate. If your professor told you to add comments for each function, you fucking add comments to each function. There's always a reason for coding standards, no matter how trivial they may seem.

Remember, university is supposed to prepare you for success in the workplace. Smart alecks don't succeed in the workplace.
>>
>>53936362
>Smart alecks don't succeed in the workplace.
That's a very Pajeet thing to say
>>
>>53932069
i was tossing in loops and arrays weeks before the class even started to learn it.

my professor gave me EXTRA credit points for going above the scope of the course.

she loved the fact i was actually studying after class and learning on my own and trying to be creative with my work.

she encouraged us to be creative with our projects and have fun. as long as the basic criteria of the project was met we were open to do as we please with it. sadly i was only but a few that actually did it. it was painful to see most of the other students just do the basic to pass the assignments. they had no creativity and viewed it simply as a tool for a future paycheck.
>>
>>53936444
>the encouraged us to be creative with our projects and have fun
That sounds extremely girly.
>>
File: 1459456699585.gif (2 MB, 480x270) Image search: [Google]
1459456699585.gif
2 MB, 480x270
>durr I did a progrum
>comments? nah fuck that it's "self-explunutory!"
>F GRADE
>aww guys wtf?

FOLLOW. DIRECTIONS.
>>
>>53936459
well my first semester professor did contain a vagina so...
>>
>>53936497
I mean it sounds more like something you'd hear in a coding boot camp for girls than an actual university course.
>>
>>53936570
well when you actually have professors that actually want to teach and are not there just to give out lectures for a pay check you actually hear this kind of comments.

she actually graded all of our work and gave thorough feedback. she didn't pass it down to a TA. shocking for some.
>>
>>53936181
yeah, I don't get what he's wanting to say either.
>>
>>53933149

The exception is pure assembly. You can never have too much comments there.
>>
>>53931973
Its a school and you pay them to teach you. It may not be important with shitty code with no input validation but it's an important practice
>>
>>53931973
>-6 points for missing comments on user input
>not commenting shit that shouldn't even need commenting due to how ridiculously obvious it is brings your grade down to a B
Is your teacher retarded? Not saying that you shouldn't be commenting your code more, but that's completely ridiculous.
>>
>>53936444
>sadly i was only but a few that actually did it. it was painful to see most of the other students just do the basic to pass the assignments. they had no creativity and viewed it simply as a tool for a future paycheck
Almost everyone I got paired with for assignments had this attitude in one of the programming courses I took.
>"alright we got the basic functionality working, how about we write some tests, refactor and try to apply the things we've learnt..."
>"nah let's just send it in since it just werks :^)"
>>
>losing 24/50 marks for no comments

Completely unreasonable, comments should be worth 20% max and that's pushing it.
>>
>>53931973
Maybe you should learn to follow directions.
>>
>>53935745
yes
>>
>>53936158
why the fuck are you using inline assembly for all that?
>>
>>53932847
You always calculate sqroot in O(1) if you're using base types, that way is just constants faster, you fucking cuck.
>>
>>53931973
man, this takes me back in some years you look at this and think how could you be so fucking retard
>>
>know what the requirements for a good grade are but ignore them
>complain that you got a bad grade on a turkish sand sculpting bulletin board
>>
>>53932164
it's the math class problem, and really a problem with schooling in general-- if it doesn't feel useful it's hard to be motivated to do it
I would suggest the teachers have fewer discrete programs that are larger, preferably built up in steps in early lessons, so the need to comment things and also keep track of all your functions and make sure they play nice together is made apparent organically
>>
>>53932876
where's the real one?
>>53932913
technical types tend to not be people persons so much
>>
>>53931973
>missing comment x100
Wow your professor is autistic, i'd seriously refute him
>>
>>53932047
Cargo cult programmer
>>
>>53931997
This. Good code is self-commenting. You know that the professor has never done worked outside of the academic environment before when he insists everything has to be commented.
>>
>>53931973
taking off *over half the points* for not commenting properly is a dick move, but you shouldn't be surprised or mad at the teacher for taking off a lot of points or even failing you
>>
>functions are as short and numerous as possible
>function names concisely describe exactly what they do
>argument names concisely describe what the function needs

Tell me why a comment would be necessary if the above three conditions are met
>>
>>53937652
to practice good documentation and learn how to do it so you can get a job and not be like /g/
>>
>>53937666
But if the name says what the function does and the arguments say what they take, what could a comment possibly say without being redundant?
>>
>>53937666
FUCK off retard comments are not necessary if the code speaks for itself
>>
>>53937692
if you go down that road of "this works for me I refuse to posses empathy everyones a dumb fuckhead but me" I cant help you anon.
>>
>>53937741
I don't think you answered my question.
>>
>>53937741
It doesn't work for just you it work for everyone that knows how to read code
>>
>>53937752
He absolutely did. I write shit that makes perfect sense at the time, and can forget what the fuck I was doing within days. Document your shit you autist cucklord.
>>
>>53933690
>>"comment liberally"
/* in this line we check the user's privilege 1 equals true and zero equals false */
/* however, if the progrim feels that the user might be a white male, it will return positive infinity */
>>
>>53937891
No you didn't you just spouted inane ad hominems,
>>
>>53934181
Kill yourself
>>
I bet OP is one of those guys that does blank or useless commit messages because he's too lazy and thinks it will be self explainatory 10 years later
>>
>>53934034
Debugging software isn't IT support's job. That's the devs' job.
>>
>>53936977
Had this too, until I got paired up with a guy who cared. He actually is my best friend now
>>
>>53934241
>What is truly shit is how OP got subtracted point for every single function he didn't comment.
That's how automated grading works. You might have fully functional code, but if the tests are missing or are incorrectly named, you're getting zero points.
>>
>>53937100
there's the kind of professor who organizes his ratings and gives different percentages on different parts of his ratings like Comments, Format etc. and then there's the one who just has a max set of points and subtracts whenever he finds something wrong.
>>
Fuck comments, if something was hard to write, it should be hard to understand.
>>
>>53937311
try having a look at some encoders/decoders in ffmpeg, it's worth the stroke
>>
>>53939156
>current year
>thinking that
>>
>>53939013
Hint: one of those is shit and should not be allowed to grade anything.
>>
>>53932365
Our introduction to programming concepts was done with scheme and Java (for functional and object oriented programming concepts) which I think is a lot better than to focus on one language only
>>
>>53932736
Now I get why you guys hate her so fucking much
>>
>>53939156
As someone who works with undocumented proprietary software I will print out your waifu and tape it to a sock and have my way with her
>>
>>53932978
Please go fuck yourself with your huge variable names
Thanks
>>
>>53935862
no, just that you're a faggot
>>
>>53936390
Ey mate, there's being a productive, efficient, and independent employee and there's being a snarky asshole that gets stuff done pretty well, but makes work harder for everyone around them by not being a team player.

The difference between pajeet and the professional is that the professional upholds the tenets of professionalism. Be someone that people want to work with and you'll go very, very far in life.
>>
>>53932093
>you're the only one who got this basic math question wrong on your exam. Care to explain?
>w-well if everyone looks the same, it'll lack originality!
>>
>>53936361
Who did you take? I go there now, just curious.
>>
File: tumblr_ntj9q85yLS1uxjl21o1_500.jpg (121 KB, 500x750) Image search: [Google]
tumblr_ntj9q85yLS1uxjl21o1_500.jpg
121 KB, 500x750
>>53931973
Hello fellow Penn stater. ;^}
>>
File: 1396074542761.jpg (16 KB, 256x353) Image search: [Google]
1396074542761.jpg
16 KB, 256x353
>>53932978
> using tab in Xcode
KEK
>>
>>53931973
>emacs
emacs confirmed for making shit programs
>>
>>53931997
>I like my sheit to be uncommend brah! I'm so, like pr0z'n'shit!
>i never had a job btw and I only use free OS!
over commenting>>>>>Not commenting at all. Fucking subhumans, might as well do demonic spawns in non-hard typing languages and mix swift and objective-c cats and dogs living together fuck everything.
>>
>>53931973
just go complain to the professor, you dumb nigger.

if a TA fucks you over don't even bother arguing with them, just go directly to the professor. this is coming from someone that was a TA for 2.5 years. the professor has the final say and no matter how badly the TA wants to fuck you over they won't be able to if the professor doesn't allow them.
>>
>>53936444
This is how every person working in the education system should be.
Luckily so was my it (don't really know the english name, dutch is Toegepaste Informatica) teacher in high school, she would let me go on in the books by myself while she helped the rest with the current chapter.
>>
>>53932164
>Most professors have spent some time in the industry.
wrong
>>
File: 1259011608250.jpg (32 KB, 202x174) Image search: [Google]
1259011608250.jpg
32 KB, 202x174
> tfw you copy-paste 60% of your code straight from stackoverflow and still ace programming classes
I must be in some real shitty school tbqhwu famallamas
>>
It sounds like you knew you had to comment the living shit out of it, but you didn't to prove a point.
You need to follow the standard set out by the person that is judging it. Whether you agree with it or not.
Your prof is well in his right to fail you. You didn't follow instructions.
>>
>>53939156
kek
>>
I was doing my gf's son's c++ homework the other day and I missed a question that asked me what the following program would output
Int i = 20
for( i; i > 0; i++)
If(i % 5 == 0)
cout << i << endl;

Let's see if you guys would have answered right
>>
>>53942207]
here you go senpai
cuckhw.cpp:1:1: error: ‘Int’ does not name a type
Int i = 20
^
cuckhw.cpp:2:9: error: ‘i’ does not name a type
for( i; i > 0; i++)
^
cuckhw.cpp:2:16: error: ‘i’ does not name a type
for( i; i > 0; i++)
>>
File: 1458684606500.gif (2 MB, 740x600) Image search: [Google]
1458684606500.gif
2 MB, 740x600
>>53931973

This is actually why I'm quitting Comp. Sci and returning to Economics.

Profs are just far too picky and will reject anything you give them that isn't what they want.

it sucks because I am enjoying the hell out of C++.
>>
>>53942228
Fuck off.. I didn't think something so simple wouldn't warrant running through a compiler. I mean the test was about basic loops not, "can you spot the missing semicolon"
>>
>>53942259
>letting professors bully you out of a possible passion
Cmon man, our constant bants and pedantry should have prepared you for this
>>
>op fails for not commenting his shitty code in an intro to sepples course
>I get full marks for python one-liners and uncommented Java spaghetti
>probably had a total of 50 comments in a project using ARM ASM (probably just over 2000 LOC), but get 97% just because I could explain in person what everything did to my TA

Sucks to be you
>>
File: 1455611867229.jpg (7 KB, 480x360) Image search: [Google]
1455611867229.jpg
7 KB, 480x360
>>53932021
A+, anon
Thread replies: 255
Thread images: 31

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.