[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
So /g/, what distinguishes a good programmer from a bad one?
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: 29
Thread images: 5
File: 1466728699777.png (638 KB, 4760x4986) Image search: [Google]
1466728699777.png
638 KB, 4760x4986
So /g/, what distinguishes a good programmer from a bad one?
>>
comments
>>
>>55313260
The amount of hair on his neck.
>>
File: 1466711521893.png (311 KB, 652x669) Image search: [Google]
1466711521893.png
311 KB, 652x669
>>
>>55313303
What's wrong with the * operator?
>>
gotta unroll your loops
>>
>>55313346
It's a programming challenge to write something without using X
>>
>>55313346
I assume the 'right' way to do this exercise would be like this.

def mul(a, b):
ret = 0
while b != 0:
ret += a
b -= 1
return ret


I guess the idea is to show an understanding of how to implement a multiplication algorithm? (The answer there shows a serious lack of understanding of the basic principle of abstraction, so it's indicative of *something*.)
>>
>>55313388
Also, inb4 not handling non-integers or negative numbers.
>>
>>55313260
holy fukken jesus. This can't be real
>>
>>55313303
Everyone who I've seen try to do this one never does it without a loop and it makes me cringe. Here's the my one line version in c#

public static int Product(int a, int b) {
return (b == 0) ? 0 : a + Product(a,b-1);
}
>>
>>55313741
that's 3 lines; where did you learn to count?
>>
>>55313781
You know you can put the header and closing bracket in the same line with the code, right? It's a return statement, not lambda calculus. I put it in 3 separate lines for readability because I'm on my phone like a lot of people and scrolling horizontally is shitty.
>>
>>55313741
>recursion is better than iteration
what the fuck?
are you retarded?
>>
>>55313303
Oh, now I get it, the asterisk is multiple sign, not the pointer
>>
>>55313260
The """"correct"""" way to do that would be loading a list of those numbers from a CSV file and checking against each one using a loop
>>
>>55313741
stupid idiot
>>
>>55313825
>m-muh clock speed
What kind of shitty CPU are you running that the speed of an extra nanosecond to compute recursively is noticeable compared to a loop? There's no point in wasting lines on looping when you can do it in a return line using the null check operators.
>>
>>55313876
>:^)
>>
>>55313886
>fuck speed
>fuck readability
>fuck languages with no tail recursion optimization
hello pajeet
>>
>>55313864
>>55313260
Just use sieve of eratosthenes or, at least brute force the damn thing
>>
>>55313906
you must be a cs course student
>>
>>55313886
Why the fuck should I care about having more or less lines and not about performance? Are you retarded?
>>
>>55313864
The ""correct"" way would be using a modified sieve of eratosthenes to generate the first n primes along with their co-primes.
>>
>>55313950
O(sqrt(n)), but better than THAT.
>>
>>55313937
>wat is golfing
>>
File: 20140712_gdc954.png (128 KB, 1190x682) Image search: [Google]
20140712_gdc954.png
128 KB, 1190x682
>>55313925
Pajeet thinks not having a CS degree is like a badge of honour. Paheet have no time for you.

>>55313886
Your shitty Pajeet attitude is why some much software is pure shit these days. Poo in the loo... more like poo in the software.

>>55313906
This guy gets it.
>>
File: 6dc588b7.jpg (38 KB, 361x354) Image search: [Google]
6dc588b7.jpg
38 KB, 361x354
(You)'s
>>
File: 3-92.jpg (115 KB, 605x807) Image search: [Google]
3-92.jpg
115 KB, 605x807
>>55313886
>what is stack
Thread replies: 29
Thread images: 5

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.