Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-4041-8081-120121-

What stirs your rage, /prog/?

Name: Anonymous 2013-09-14 1:07

Mine are people who do this on C-like languages:
if(numbers==NULL)
{
numbers=temp;
numbers->next=NULL;
}
else
{
temp2=numbers;
while(temp2!=NULL)
{
var=temp2;
temp2=temp2->next;
}
temp2=temp;
var->next=temp2;
temp2->next=NULL;
}


No spaces between operators.
Opening brace on lines by themselve.
Else statement not a continuation of the if-statement it belongs to
Terse variable.
camelCase

Name: Anonymous 2013-09-14 1:11

People who refer to dromedaryCase as CamelCase.

Name: Anonymous 2013-09-14 1:15

Else statement not a continuation of the if-statement it belongs to
Do you mean:
if (predicate){
// something
} else {
// alternate
}


I fucking hate when people do this. It's one of my programming pet-peeves. I scan the block level by line, if you put else after a brace it's harder to see and it just looks retarded. The only time you can put anything after a brace is in:
do {
// something
} while (condition)

Name: Anonymous 2013-09-14 1:19

>>3
I always do the } else { thing, stop being a sissy faggot.

Name: Anonymous 2013-09-14 1:33

One-letter variables, and faggots like >>3.

Name: Anonymous 2013-09-14 1:57

>>3

But you are wrong though. In long programs.

}

else


makes the else harder to distinguish which if-clause it branches from.
On the other hand,
} else { makes a clear distinction and it's not harder to see at all.

Name: Anonymous 2013-09-14 2:23

>>6
It branches from the previous brace, what is so hard to distinguish about that?

Name: Anonymous 2013-09-14 2:24

int
foo
(
char bar,
long baz
)
{
// ...
}

Name: is.gd/MWkdLJ 2013-09-14 2:27

>>1
K&R lover.

Allman Master race!

[spoiler]Although I appreciate GNU style[/code]

Name: Anonymous 2013-09-14 2:29

I tuck mine in.

if (foo) {
bar();
baz();}
else {
hello();
world();}

Name: Anonymous 2013-09-14 2:33

>>10
Terrible!

Name: Anonymous 2013-09-14 3:16

>>10

Might as well write an FOIC compiler for C

Name: Anonymous 2013-09-14 3:30

>>12
cython

Name: Anonymous 2013-09-14 4:17

I hate Lisp. I hate Lispfags. I hate functional programming

Name: Anonymous 2013-09-14 8:03

I hate pretty much any code I don't write.
I also end up hating a lot of the code I write.

Name: Anonymous 2013-09-14 13:51

I don't like FIOC, but I don't like
if ( 1 )

{

penis ( ) ;

}

either. What does /frog/ think of something like
if (1)
penis1();
penis2();.

There's no need for then, and the if scope ends once the period is reached. Also, no indentation is being forced here, you could just write the whole thing in the same line.

Name: Anonymous 2013-09-14 20:50

>>16
looks gay

Name: Anonymous 2013-09-14 21:21

>>14
Kill yourself scum.

Name: Anonymous 2013-09-14 21:46

>>14
yeah, they think they're so 1337 because they know Lisp
I feel sorry for them

Name: Anonymous 2013-09-14 21:50

>>19
Go away.

Name: Anonymous 2013-09-15 0:32

>>17
Suggest something else then.

Name: esp. his link 2013-09-15 0:54

Name: Anonymous 2013-09-15 14:08

>>22
I was trying to avoid curly braces, ``faggot''.

Name: Anonymous 2013-09-15 15:44

Preprocessot shit.

Name: Anonymous 2013-09-15 19:44

People who add redundant comments like this:
#ifdef SOMETHING
...
#endif // #ifdef SOMETHING

Name: Anonymous 2013-09-15 19:50

>>25
If there's nested ifdef's that's useful for knowing which ifdef that endif belongs to.

Name: Anonymous 2013-09-15 20:17

In python I always include an else for every if:
if dicks >= 50:
enoughdicks = 'yup'
else:
pass

Name: Anonymous 2013-09-15 21:06

>>26
If you can't keep track of your #ifdefs, then you're doing it wrong.

Name: Anonymous 2013-09-15 22:11

>>27
why?

Name: Anonymous 2013-09-16 9:10

>>29
So he can feel like an ENTERPRISE PROGRAMMER.

Name: Anonymous 2013-09-16 10:20

People arguing about brace styles stirs my rage. If you can't be bothered to run a beautifier before you begin to read/modify source, fuck you. If you can't be bothered to run a beautifier with a different set of options before you send patches back, fuck you. If you care at all about style but can't be bothered with informing people how to make their code conform to your style (i.e. put ``please run `indent -kr' on all source files before sending patches'' in the doc somewhere), fuck you.

Name: Anonymous 2013-09-16 11:03

>>31
Amen.

Name: sage 2013-09-16 11:07

>>31

Fuck you.

Name: ‮‭ 2013-09-16 11:47

>>33
What, you hate properly indenting your code when submitting a commit? What a Jerk. No wonder I never see your commits, sage.

Name: Anonymous 2013-09-16 12:45

I hate it when people //comment like this.

Comments should be placeable anywhere and capsulable

Name: Anonymous 2013-09-16 15:04

>>31-35
Fuck you.

Name: Anonymous 2013-09-17 13:32

>>36
Fuck you.

Name: Anonymous 2013-09-17 19:35

>>37
Fuck you.

Name: Anonymous 2013-09-17 21:04

No space between code and comment.
int foo;//comment

Name: Anonymous 2013-09-18 12:19

Lazy evaluation. It just doesn't scale...

Name: Anonymous 2013-09-18 13:53

>>41
scale this
*grabs dick*

Name: Anonymous 2013-09-18 21:27

>>41
Stop grabbing my dick.

Name: Anonymous 2013-09-18 22:52

>>42
But it's so tiny and cute!

Name: Anonymous 2013-09-18 23:11

>>43
...said no girl ever.

Name: Anonymous 2013-09-18 23:28

>>44
My ex-girlfriend had a small penis fetish.

Name: Anonymous 2013-09-18 23:29

>>45
Lucky for you. She's a keeper.

Name: Anonymous 2013-09-18 23:37

We honestly like thick and weird shaped ones. I like them limp.

Name: Anonymous 2013-09-18 23:44

>>44
Yeah, no girl would ever want to touch you.

I just had sex with this cute girl who happens to have black wings and won't take off this huge red necklace of her. This is what you're missing out for programming in Javascript.

Name: Anonymous 2013-09-18 23:46

>>47
COCKLOVING FAGGOT

Name: Anonymous 2013-09-18 23:50

>>49
fuck you het boy, enjoy your disease ridden whores while I 69 with my partner who is, just like myself, an expert on penises

Name: Anonymous 2013-09-19 0:12

>>50
Enjoy your AIDS while I enjoy my abstinence, lusty faggot

Name: Anonymous 2013-09-19 0:22

>>51
I have a stable partner. Enjoy your sexual frustration, non-faggot.

Name: Anonymous 2013-09-19 0:37

Gentlemen,
Would you be so kind as to restrict your discussion to /lounge/?

Name: 2013-09-19 1:38

^^^^^^^^^^^

>>48
Plus, who says every /prog/rider is male. Worse yet, likes nasty vagina.

Name: Anonymous 2013-09-19 1:38

Name: Anonymous 2013-09-19 1:40

>>54
Plus, who says every /prog/rider is male
Come on, this doesn't even need confirmation. There are absolutely no hopes of having real women discussing your autistic hobbies in the site you frequent daily, please never forget this.

Name: Anonymous 2013-09-19 1:50

Name: le pedophile sage 2013-09-19 1:51

>>56
autistic
le knowyourmeme.com face
implying autistic women dont exist
implying you cis scum normalfag /g/ros know anything
le afraid of girls face
le girlie cooties

Name: Anonymous 2013-09-19 7:20

Faggots.

Name: Anonymous 2013-09-19 9:55

>>58
You might be right but you made your point in a retarded manner. Fuck you.

>>59
Fuck you faggot.

Name: Anonymous 2013-09-19 10:03

>>60
Fuck you, ``faggot''.

Name: Anonymous 2013-10-22 0:14

When someone does something like
[code]if(condition) { short-statement-here; }
SHHHHEEEET.

Name: Anonymous 2013-11-01 15:16

>>1
Why? Do you have any reason to hate that brace style?

Name: Anonymous 2013-11-01 18:05

int thing(int x){int t=x;while(t<10){t++;if(t==2){return -1;}else{return 1;}}return t;}

Name: Anonymous 2013-11-01 19:26

People who use singletons for EVERYTHING.
Including shit that's seriously constraining.

Name: Anonymous 2013-11-03 17:35

people who argue about coding styles, language preferences and OS preference (i.e. /g/ros)

Name: Anonymous 2013-11-03 18:00

>>66
egin dubs

Name: Anonymous 2013-11-05 4:17

>>66
Programmer not coder you python using twit.

Name: Anonymous 2013-11-06 22:35

>>1
camelCase is nice, check your privilege

Name: Anonymous 2013-11-07 18:12

>>69
That's shitCase, not CamelCase. Check your mental retardation.

Name: Anonymous 2013-11-07 20:07

>>3
do .. whiles are fucking fugly, though. Shows how much of a nigger you are.

Name: Anonymous 2013-11-09 1:27

Extraneous whitespace.

Name: for >>72 2013-11-09 1:36


































































































































Name: Anonymous 2013-11-10 11:23

I HATE LINKED LISTSSSSSS SO MUCH. ESPECIALLY DOUBLY LINKED LISTS. I DONT KNOW WHY THE FUCK WOULD ANYONE WANT TO USE LINKED LISTS EVER. ALSO I HATE PEOPLE USING K&R STYLE.

Name: Anonymous 2013-11-12 5:35

>>74
People want to dynamically allocate space for data without having to pre-allocate space for the data after the program is compiled.

Name: Anonymous 2013-11-12 6:06

>>75
Dynamically allocating data is always a code smell. Doing it for one element at a time is just absurd.

Linked lists are always the wrong data structure.

Name: Anonymous 2013-11-12 18:36

>>76
Are you seriously suggesting to store everything in the stack?

Name: Anonymous 2013-11-12 19:04

>>74-76
Watch your SICP video lectures, C programmers!

Name: Anonymous 2013-11-13 5:54

>>78
I am not a C programmer, I'm an information sciencetist!

Name: Anonymous 2013-11-13 6:18

Dynamically allocating data is always a code smell
The use of the word ``always'' is usually a logic smell. Your post is not an exception to that.

Name: Anonymous 2013-11-13 6:41

The use of the term ``code smell'' is usually an anus smell. A sweet sweet anus smell.

Name: Anonymous 2013-11-13 8:12

oh wow ur guyses maymays and jokes are so unqiue and clever and orginial and always fresh and relvaent right at the right time i mean wow how do i do those special qutation marks u guys do so i can be a part of u all ;)?

Name: Anonymous 2013-11-17 8:10

I hate putting comments. Read the fucking source, faggot. I've already made my identifiers as clear as day!

Name: Anonymous 2013-11-17 9:41

>>83
It's not always obvious why you've gone your particular way. You're supposed to write comments that deal with background or design decisions that aren't obvious.

Name: Anonymous 2013-11-17 11:06

>>84
Really now? Isn't LinkedList or HashTable object names not obvious to you?

Name: Anonymous 2013-11-17 21:02

>>85
Because all solutions to all problems always use obvious implementations of obvious data structures, right?

Name: Anonymous 2013-11-17 21:06

>>86
Yes.

Name: Anonymous 2013-11-17 22:39

>>87
Implement a double ended priority queue using linked lists. Removal of both ends must be O(1).

Tsk.

Name: Anonymous 2013-11-17 23:00

>>88
Nigger.

Name: Anonymous 2013-11-17 23:08

>>88
HIBT?

Name: Anonymous 2013-11-17 23:35

>>90
Not really, you implied you could make anything with just the simplest data structures at hand.

Name: Anonymous 2013-11-17 23:39

>>91
No, I stated it rather explicitly, because it's true. Implications belong on the image-gag-subreddit-combinators.

Name: Anonymous 2013-11-17 23:43

>>92
It's an implication, not an explicit statement. You didn't say ``i could make a file system using linked lists and still make it O(1)'', but it can be inferred from your statement.

I'm not using the imagereddits maymay, why do you work under such assumption? I thought we trusted each other.

Now that you said you really meant that, go ahead and implement that priority deque using just cars and cudders. It would better be fast, nigger.

Name: Anonymous 2013-11-17 23:51

>>93
You didn't say ``i could make a file system using linked lists and still make it O(1)'', but it can be inferred from your statement.

obvious implementations of obvious data structures makes no mention of linked lists.
If your only constraints are that it be made of linked lists and removal of either end be in constant time, I suggest you read up on doubly-linked lists.

Name: Anonymous 2013-11-17 23:56

>>94
It's a priority queue. O(n) insertions are not acceptable. Maybe O(log n) insertions are.

Try again.

Name: Anonymous 2013-11-18 0:17

>>95
the heap version of the priority queue has a tree implementation which can done with cars and cdrs.

Name: Anonymous 2013-11-18 0:24

>>95
Yes but a priority queue already falls under the purview of obvious implementations of obvious data structures So I'm not sure what you're trying to prove.

Name: Anonymous 2013-11-18 0:50

>>96-97
I'm sorry, I meant a priority deque as I said in >>88,93.

The only implementations I know are using a min heap and a max heap with some additional housekeeping, the other one is a min-max heap which could be considered non-trivial.

Both implementation have O(1) delete_min and delete_max and O(log n) insertions. If you can do better with linked lists and your code is absolutely obvious (with no ``useless'' comments), then I'll shut up.

Name: Anonymous 2013-11-18 1:08

>>98
oh ok, so it's a priority queue that can fetch both the min and the max efficiently. The approach you described would work well. There's a similar approach for the purely functional double sided-queue, which can be implemented with two singly linked list, where one is the reverse of the other. Or am I thinking of zippers, which work kind of well. Nevermind. In some cases sorted lists work ok as priority queues. If the new priorities of inserted elements are close to one extreme in priority, and if changed priorities are known to not cross across too many other elements they can work. Or if the size of the queue just stays really small.

But back to the original discussion (which is less interesting imo) data structures have a natural hierarchal structure for documentation, where it is often sufficient to document it's interface and the invariants that are to be maintained by its methods. I don't agree that comments are never necessary, but they can be used more or less effectively and commented code doesn't always give you the information you need to understand it, or what invariants you need to maintain to keep correctness if you were to add onto it.

Name: Anonymous 2013-11-18 3:03

What stirs your rage?
not getting dubs.

Name: Anonymous 2013-11-18 5:20

>>99
You're describing a priority deque with lots of particularities. ``It's fine as long as it's not big'', ``maybe sorting it would be okay'' (O(n log n)[i]![/i]), ``zippers kind of work''.

My point is, it's not always possible to use the simplest data structure and still get good performance. When you simply can't use linked lists, then you explain your choice of data structures in the code using comments. Why is that so bad? It's not like I'm telling you to make /* Increments i by one */ comments.

It also helps when you're drunk/high/any other ``state'' considered lolsocoolXD by normies.

I don't agree that comments are never necessary
I agree.

commented code doesn't always give you the information you need to understand it, or what invariants you need to maintain to keep correctness if you were to add onto it.
Then you're reading some shitty comments, because IMO that's the whole point of comments. Make some good comments, Anon-kun.

Name: Anonymous 2013-11-18 5:47

>>101
I'm a non-``normie'' marijuana user and I resent that.

Name: Anonymous 2013-11-18 16:23

I hate languages where square brackets are overloaded to mean "linked list." There's a reason they have that notation. It's not to hide unnecessary pointer indirections.

Name: Anonymous 2013-11-18 22:09

>>103
Fuck you. I love languages where square brackets mean ``list''.

Name: Anonymous 2013-11-19 22:33

>>104
Can't we just agree to disagree and get along despite our syntax preferences?

Name: Anonymous 2013-11-19 23:18

>>105
No.

Name: Anonymous 2013-12-09 19:48

This, stunts like these stir my rage:
https://www.youtube.com/watch?v=6XvmhE1J9PY
The comments are worse.

Name: Anonymous 2016-10-24 16:38

TRIPS INCOMING!

Name: Anonymous 2016-10-25 6:20

>>107
I wish everybody would learn computer science. However, it's too bad that their definition of computer science is "computer programming" and not the theory that underpins the subject of computation.

Name: Anonymous 2016-10-25 6:30

How do you do your elses?

A:
}
else
{


B:
}
else {


C (faggot):
} else {

Name: Anonymous 2016-10-25 6:40

CHECK MY FUCKING TRIPS!!

Name: Anonymous 2016-10-25 8:31

>>111 Diagnosis:Autism

Name: Anonymous 2016-10-25 15:24

>>110

else:
# INDENT

Name: Anonymous 2016-10-25 16:10

>>35
I am pretty sure that you can use a beautifier for that as well.

Name: Anonymous 2016-10-25 17:14

>>113
ONE WORD
THE FORCED INDENTATION OF THREAD
CODE OVER

Name: Anonymous 2016-10-26 2:05

People who use if/else blocks instead of early returns.

i.e. instead of writing all your fucking code in the else block like this:

if (foo) {
x += 1;
} else if (bar) {
x += 3;
} else {
/* huge pile of shit */
}


Write it like this

if (foo) {
x += 1;
return;
} else if (bar) {
x += 3;
return;
}

/* huge pile of shit */


Now the trivial cases are dealt with early, the main body of the function isn't indented at all, and your coworkers are less pissed off at you. Everybody wins.

Name: Anonymous 2016-10-26 2:29

>>1
Way to bloat up your codebase by 50%!

Name: Anonymous 2016-10-26 5:13

>>116 I write it like this
if (foo) {x += 1;return;}
if (bar) {x += 3;return;}
Much easier to read and conserves screen space

Name: Anonymous 2016-10-26 6:30

if(predicate)
{ something()
;
} else
{ something_else()
;
}

Name: Anonymous 2016-10-26 7:04

if(x==0) and if(x!=0) triggers me

Name: Anonymous 2016-10-26 8:46

>>120 Actually that is correct, since the convention of 0/!0 being boolean-convertible is due weak type safety of C/C++

Name: Anonymous 2016-10-26 8:58

>>121
so what? that's how those languages work so why not use it? not everything has to be haskall

Name: Cudder !cXCudderUE 2016-10-26 10:46

>>121
It's correct in the same way that if(x==true==true==true) is 'correct' in lesser languages like Java. It doesn't make it any easier to understand and just causes confusion.

Everything has a natural booleanness. It makes code simpler.

Try doing this in a lesser language, for example:
int numopts = !!(opts&OPT_A) + !!(opts&OPT_B) + !!(opts&OPT_C) + !!(opts&OPT_C);
if(numopts > 2)
printf("More than two options selected\n");

Name: Anonymous 2016-10-26 11:10

>>123
Measuring options that can be mutually exclusive by number, instead of using a state machine

Name: Anonymous 2016-10-26 13:16

>>123
is 'correct' in lesser languages like Java
Doesn't that work in C as well (assuming true is defined)?

Name: Anonymous 2016-10-26 18:28

>>123
Everything has a natural booleanness. It makes code simpler.
C stole that from LISP.

Name: Anonymous 2016-10-27 1:25

Everything has a natural booleanness. It makes code simpler.

This is what weak typers actually believe

Name: Anonymous 2016-10-28 19:32

>>126
except it works differently in those two languages. in C, true is non-zero. in Lisp, true is non-empty.

Don't change these.
Name: Email:
Entire Thread Thread List