I am primarily interested in peoples reasoning here, but when writing code, what are the top things that annoy you about other peoples code and what is the reason behind it? This is for any language. I am just curious.
imho, I think it is lack of decent documentation, screwed up indentation (including anything that is NOT a makefile that uses tab indentation), and crappy identifiers that make you have to spend ages trying to work out what the hell something is doing.
Community
Not everyone is a good programmer
U google ur error
All results lead to pajeeth websites
Or stack exchange answer which are answered by pajeeths
>>60658022
People who use anything other than tabs for indentation.
People who do shit likeif(condition) do_thing();
People who use OOP at all.
People who write C89 in 2017.
People who typedef too much.
Anything that is CamelCase.
>minimal code is good code
>writes something that runs once every frame that takes 30+ ms
>serializes everything in a xml wrapper
>including packets
>doesnt know what delete [] means
>uses C functions that can null without saving pointer to delete pointer if it fails
>checking for null before delete
>not nulling after deleting
>commits a translation update that makes what i just had working perfectly now need changes
>have to now compile in debug to figure out where this translation update made a crash
>less than 1% of userbase is german
>uses python to do what cmake does
>with a working cmake project in directory
>>60658022
>Programming... what peeves you off?
Pajeets and San Francisco, sjw, young liberal "developers" with their offices fully of dyed hair women and the scrawny, flannelette wearing nerds that orbit them.
It's hard to say which group is worse but I'd say pajeets are worse.
Without these two groups of people the hobby and career of software development would 1000x more enjoyable.
>>60658196
> People who do shit likeif(condition) do_thing();
Are you referring to the use of conditionals, the use of conditionals without braces, the use of conditionals and their only statement on a single line, or the fact that there is an underscore in the function name?
>>60658497
Putting the if statement body on the same line.if (condition)
do_thing();
is fine.
I just find putting it on the same line is very inconsistent and just hides information.
i hate people. that's what annoys me the most
Fucking non-indexed lookups. Every time I find a function that collapses under load, there's a fucking for loop iterating an array to search for shit. Sometimes nested.
foreach (var item in items)
{
if (item.key == string)
return item;
}
>>60658617
not that thing per se, but people
>>60658617
>o
Never have I agreed with someone more than you.
>>60658196
you and I are total opposites. Those are things I love about programming
other than OOP, fuck that shit
>>60658530
I find 1 line short if statements that is less than 80 chars long a lot better than a mountain of if, else if, else if ... else
>>60658022
Wrong Linus. The person you have pictured is Linus Sebastian who runs a YouTube channel called Linus Tech Tips which often talks about computer hardware, does build guides, reviews, etc. The creator of the Linux kernel is Linus Torvalds. A Finnish man who wrote Linux while attending the University of Helsinki before later moving to
the United States.
https://en.wikipedia.org/wiki/Linus_Sebastian
https://en.wikipedia.org/wiki/Linus_Torvalds
>>60658022
>can I get the api documentation?
>no
>just ask me
and then you spend a week implementing the web api in the mobile app
>>60659265
not sure if trolling or small screen.
>>60658624
Who does this?
>>60658624
Conversely,
people using indexes to iterate/search over a nonindexed collection like a list, or somewhere where a enumeration implementation makes a non-load working piece of code 100 times cleaner to understand.
Usually not as bad but still really activates my Allmans.
>>60658022
just the small stuffi++;
while (1){}
int a = 0, b, c; //also single-letter variables that arent iterators
also includes placing private before public in class def
>>60658152
>C N U A O
>N
>U
>A
>O
>>60658624
Do I get the feeling you don't like functional programming?import java.util.HashMap;
...
HashMap<String, Long> someMap = new HashMap<>( );
// Fill the hash map with some crap here
... as in Java, it would result in cleaner code imho, when we iterate over it.someMap.forEach((k, v) -> {
// do some stuff with key "k"
// and value "v" here
});
// as opposed to
for(Entry<String, Integer> kvpair : someMap.entrySet( )) {
final String key = kvpair.getKey( );
final int value = kvpair.getValue( );
// Do stuff here
}
I am not sure there is any way to avoid using iterators here either... the only way I can think of doing an indexed lookup would be
Set<String> keySet = someMap.keySet( );
String[ ] keys = keySet.toArray(new String[keySet.size( )]);
for(int i = 0; i < keys.length; ++i) {
int value = someMap.get(keys[i]);
}
</cringe>
I'm a beginner and I can't understand other peoples code
>>60659492
> Has been coding since he was 13
> Is now 20
> Reads a standard library header file for C++
> nope.jpg
>>60659473
></cringe>
cringed
>>60658022
People using GNU extensions
People writing code with implementation defined or undefined behaviour
People who think compiler warnings can be ignored
People who submit code where valgrind reports 1394 memleaks and conditionals on uninitialized memory
People using 27 integer variables as booleans, flags, etc instead or enums with bitmasks
>>60658196
>Anything that is CamelCase.
My peeve is people who don't know what camelCase is.
>>60659616
>e.
>My peeve is people who d
We all know what CC is.
#define CAMEL 42
...
switch(someInt) {
case CAMEL:
// camelCase here
...
}
>>60659736
Made my day/10
>>60659438
Doesn't i++ compile down to a single asm instruction requiring less registers vs i = i+1;?
I agree with the rest though.
>not writing your code all on one line
>>60659818
literally kill yourself
>>60658022
>have coding assignment for sorting algorithm
>run literally a million tests with randomly generated arrays, all work properly
>turn it in
>doesn't work
>have to talk to supervising professor
>turns out the documentation on the task is wrong and i have to hardcode everything from scratch
t. CSfag
>>60659795
>Doesn't i++ compile down to a single asm instruction requiring less registers vs i = i+1;?
depends on the context. if the value of i before increasing i by 1 isn't needed anywhere every compiler optimizes it to ++i . but if the value is needed the compiler actually copys the value of i to a temporary variable (or in some special case maybe a register ?) before increasing it
>>60660090
>turns out the documentation on the task is wrong and i have to hardcode everything from scratch
wth did you do ? hardcode every border case and heuristiks that only work for one specific task ?
>>60659795
++i; is what i prefer
>>60660095
Ah, that's good to know. Now I won't feel bad for avoiding those garbage short snippets.
>>60660185
Then you are an idiot.