[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
More of these
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 50
Thread images: 12
File: myfirstcprog.png (70 KB, 720x720) Image search: [Google]
myfirstcprog.png
70 KB, 720x720
>>
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 (311 KB, 652x669) Image search: [Google]
1460310366444.png
311 KB, 652x669
>>
>>55227164
Lmao
>>
>>55227065
I don't get it..?
>>
File: 1464060963966.png (152 KB, 1948x858) Image search: [Google]
1464060963966.png
152 KB, 1948x858
>>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 (66 KB, 1032x699) Image search: [Google]
muh-apple.png
66 KB, 1032x699
>>
>>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 (355 KB, 700x575) Image search: [Google]
reading-other-peoples-code.png
355 KB, 700x575
>>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 (483 KB, 1376x1223) Image search: [Google]
IMG_20160417_234137~01.jpg
483 KB, 1376x1223
>>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 (70 KB, 700x567) Image search: [Google]
gangsterCat.jpg
70 KB, 700x567
>>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 (110 KB, 1024x768) Image search: [Google]
45348548.png
110 KB, 1024x768
>>
>>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 (638 KB, 4760x4986) Image search: [Google]
1465419797994.png
638 KB, 4760x4986
>>55230477
this is horrible and you should feel bad
>>
File: asdf.png (95 KB, 730x1202) Image search: [Google]
asdf.png
95 KB, 730x1202
>>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 (78 KB, 622x626) Image search: [Google]
1f3.png
78 KB, 622x626
>>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 (3 MB, 1280x720) Image search: [Google]
tight.webm
3 MB, 1280x720
>>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 replies: 50
Thread images: 12

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

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.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.