[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]

More of these

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: 50
Thread images: 12

File: myfirstcprog.png (70KB, 720x720px) Image search: [Google]
myfirstcprog.png
70KB, 720x720px
>>
Are the people that make these bitter they didn't go to college and get a degree and get a job?
>>
>>55227086

No. We're bitter that we have to work with people who have college degrees but still can't code worth shit.
>>
>>55227126
This. I got an on campus job where code quality fucking mattered, I self document like a mofo (Clean Code by Robert C Martin is a fucking godsend)

I join groups for classes where they don't even know how to use git and use redefine variables, copy/paste code everywhere, horrible performance, 2 letter variable names. I fucking die it's horrible
>>
File: 1460310366444.png (311KB, 652x669px) Image search: [Google]
1460310366444.png
311KB, 652x669px
>>
>>55227164
Lmao
>>
>>55227065
I don't get it..?
>>
File: 1464060963966.png (152KB, 1948x858px) Image search: [Google]
1464060963966.png
152KB, 1948x858px
>>55227065
>OO""""""P""""""
>>
>>55227164
I have the feeling that these code snippets are being created for only these kind of threads.. No one in the entire world would ever write this code
>>
>>55227164
>knows how to properly throw the correct exception
kinda ruins it

I've seen
>returning null (because it wouldn't compile otherwise)
>creating a new exception and doing nothing with it
>RETURNING an exception
>>
>>55227383
it's funny because (widely-used) dependency injection removes 90% of the arrows on the right

you're pretty clueless aren't you
>>
>>55227359
OP is a faggot, and is trying to meme
>>
>>55227399
You'd be surprised. See http://thedailywtf.com/
>>
File: muh-apple.png (66KB, 1032x699px) Image search: [Google]
muh-apple.png
66KB, 1032x699px
>>
>>55227164
Well I mean he did what the comment wanted I guess
>>
>>55227399
no fucking shit that's the entire point of the meme
>>
>>55227163
>2 letter variable names

>tfw I name my variables after what they store so I end up with names like inputRadius_inputVertexCount_inputRotation
>>
File: reading-other-peoples-code.png (355KB, 700x575px) Image search: [Google]
reading-other-peoples-code.png
355KB, 700x575px
>>55227399
oh you poor naive child...
>http://thedailywtf.com/series/code-sod
>https://devhumor.com/category/code
>>
>>55227590
You lil cheeky cunt mate, I see that NSA code.
>>
>void main
>>
File: IMG_20160417_234137~01.jpg (483KB, 1376x1223px) Image search: [Google]
IMG_20160417_234137~01.jpg
483KB, 1376x1223px
>>55229222
>TripsofTruth
>>
>>55229381
Where?
>>
>>55227164
person learning how to program here, how would you actually do this best?
int product = 0;
for(int i = 0; i <a; i++){
product+=b;
}



?
>>
File: gangsterCat.jpg (70KB, 700x567px) Image search: [Google]
gangsterCat.jpg
70KB, 700x567px
>>55230078
forgot to return the product, but I doubt that's the only thing I fucked up here.
>>
>>55230078
bit shifting and addition, like how it's done at the hardware level
>>
File: 45348548.png (110KB, 1024x768px) Image search: [Google]
45348548.png
110KB, 1024x768px
>>
>>55230078
Loops are an indication of code smell. It's 2016 we don't need to program everything in C anymore.
class Multiplier {
private List<Integer> multiplier;
public Multiplier (int multiplicationFactor) {
this.multiplier = new ArrayList<Integer>(Collections.nCopies(multiplicationFactor, 0));
}
int multiplyBy(int baseNumber) {
multiplier.replaceAll((i) -> i = baseNumber);
return multiplier.stream().mapToInt(Integer::intValue).sum();
}
}
>>
>Tfw some of my code has been used for these
>Tfw not even mad
>tfw terrible programmer and I know it
>Tfw just graduated, b.s. In comp sci w/ a minor in math
>Tfw I never have to write a single line of code ever again
>Tfw get to he a pilot

My teachers know I sucked, but I was really good at sucking up. I can post some more of my code if yall want. Give everyone a few laughs.
>>
>>55230477
but that just feels 100% more complicated and unreadable and you're screwing with me.
>>
>>55230565
>I can post some more of my code if yall want
do it
>>
>>55230765
If that's all you're taking off my post, then maybe coding isn't for you.
>>
File: 1465419797994.png (638KB, 4760x4986px) Image search: [Google]
1465419797994.png
638KB, 4760x4986px
>>55230477
this is horrible and you should feel bad
>>
File: asdf.png (95KB, 730x1202px) Image search: [Google]
asdf.png
95KB, 730x1202px
>>55230926
it also took him three posts
>>
>>55230565
please do, I want to cringe.
>>
>>55230958
kek
>>
>>55227163
>tfw I'm a coding pleb with a CS degree

I want to get more into networking anyway, but I have been coding more recently, it's fun to learn what college didn't teach/I didn't bother to learn.

Sometimes I suspect that the degree for CS is just a money hurdle, not an actual proof of ability, and that you'd be better off just teaching yourself. Shame that those of us here in the US have to pay the money wall to get anywhere. Thank god I was born rich so I could fuck off in college.
>>
>>55230958
I just freehanded it the first time, which apparently I can't do because I don't program garbage Java much.

>>55230926
:^)
>>
>>55231070
>trying this hard to save face

You don't belong here, friend.

>>55231040
You're absolutely right, but there are some concepts that are much easier to grasp with the help of someone experienced.

I have no doubt a committed person that's at least mildly intelligent could self-study all they need to know and succeed. That said, most people are lazy and stupid, so the degree helps to weed some people out.
>>
>>55230926
>>55227590
>>55227164

> XDDDDDD they tested all the cases instead of writing a more general statement
>>
>>55227065
test
>>
>>55231486
Shit he's onto us
>>
>>55230078
If your language supports TCO recursive addition works as well but that's essentially just a recursive version of what you wrote
>>
>>55227163
Ah, variable names. Length is not a virtue in a name; clarity of expression is. A global variable rarely used may deserve a long name, maxphysaddr say. An array index used on every line of a loop needn't be named any more elaborately than i. Saying index or elementnumber is more to type (or calls upon your text editor) and obscures the details of the computation. When the variable names are huge, it's harder to see what's going on. This is partly a typographic issue; consider
        for(i=0 to 100)
array[i]=0
vs.
for(elementnumber=0 to 100)
array[elementnumber]=0;

The problem gets worse fast with real examples. Indices are just notation, so treat them as such.
Pointers also require sensible notation. np is just as mnemonic as nodepointer if you consistently use a naming convention from which np means ``node pointer'' is easily derived. More on this in the next essay.

As in all other aspects of readable programming, consistency is important in naming. If you call one variable maxphysaddr, don't call its cousin lowestaddress.

Finally, I prefer minimum-length but maximum-information names, and then let the context fill in the rest. Globals, for instance, typically have little context when they are used, so their names need to be relatively evocative. Thus I say maxphysaddr (not MaximumPhysicalAddress) for a global variable, but np not NodePointer for a pointer locally defined and used. This is largely a matter of taste, but taste is relevant to clarity.

I eschew embedded capital letters in names; to my prose-oriented eyes, they are too awkward to read comfortably. They jangle like bad typography.
>>
>>55228417
As it fucking should do you're not lost when you look at it a month later.

The people that just go like

> int a,b,c,d,e;

And then on to a complicated block makes my blood boil
>>
>>55230078
(0 == b) ? 0 : ((int)((double)a / (1.0 / (double)b)));
>>
File: 1f3.png (78KB, 622x626px) Image search: [Google]
1f3.png
78KB, 622x626px
>>55230477
>>
>>55227126
>We're
You're, fixed

If you're bitter and you DO know how to code, it is your (our) moral obligation to teach them how to code properly
>>
File: tight.webm (3MB, 1280x720px) Image search: [Google]
tight.webm
3MB, 1280x720px
>>55227126
Isn't that kind of the point of a higher education? You know all the complicated shit and can efficiently plan out projects, whereas the uneducated code monkeys do the manual labor. There's no need to actually code yourself.
>>
>>55233748
Manager detected. Take your magic wand and fuck yourself.
>>
>>55227086

I made one of these after realizing how needlessly complicated one of my "solutions" was while another guy literally did it in one, 10 character line.
Thread posts: 50
Thread images: 12


[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.