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
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)
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:
Anonymous2013-09-14 2:23
>>6 It branches from the previous brace, what is so hard to distinguish about that?
I hate Lisp. I hate Lispfags. I hate functional programming
Name:
Anonymous2013-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:
Anonymous2013-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.
>>29 So he can feel like an ENTERPRISE PROGRAMMER.
Name:
Anonymous2013-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.
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.
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.
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:
Anonymous2013-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.
The use of the term ``code smell'' is usually an anus smell. A sweet sweet anus smell.
Name:
Anonymous2013-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:
Anonymous2013-11-17 8:10
I hate putting comments. Read the fucking source, faggot. I've already made my identifiers as clear as day!
Name:
Anonymous2013-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:
Anonymous2013-11-17 11:06
>>84 Really now? Isn't LinkedList or HashTable object names not obvious to you?
Name:
Anonymous2013-11-17 21:02
>>85 Because all solutions to all problems always use obvious implementations of obvious data structures, right?
>>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.
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.
>>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:
Anonymous2013-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:
Anonymous2013-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:
Anonymous2013-11-18 3:03
What stirs your rage?
not getting dubs.
Name:
Anonymous2013-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.
>>101 I'm a non-``normie'' marijuana user and I resent that.
Name:
Anonymous2013-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.
>>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.
>>35 I am pretty sure that you can use a beautifier for that as well.
Name:
Anonymous2016-10-25 17:14
>>113 ONE WORD THE FORCED INDENTATION OF THREAD CODE OVER
Name:
Anonymous2016-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.
>>121 so what? that's how those languages work so why not use it? not everything has to be haskall
Name:
Cudder !cXCudderUE2016-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");