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

Programming... what peeves you off?

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 36
Thread images: 4

File: tordy.jpg (24KB, 400x400px) Image search: [Google]
tordy.jpg
24KB, 400x400px
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 like
if(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 like
 if(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.
>>
File: 1440964308437.jpg (205KB, 600x450px) Image search: [Google]
1440964308437.jpg
205KB, 600x450px
>>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
>>
File: 1490095380554.jpg (57KB, 606x592px) Image search: [Google]
1490095380554.jpg
57KB, 606x592px
>>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
>>
File: when-your-mom-says-yaass--full.jpg (106KB, 400x341px) Image search: [Google]
when-your-mom-says-yaass--full.jpg
106KB, 400x341px
>>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 stuff
i++;
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.
Thread posts: 36
Thread images: 4


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

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
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.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.