Quantcast
[ 3 / biz / cgl / ck / diy / fa / g / ic / jp / lit / sci / tg / vr / vt ] [ index / top / reports / report a bug ] [ 4plebs / archived.moe / rbt ]

Due to resource constraints, /g/ and /tg/ will no longer be archived or available. Other archivers continue to archive these boards.Become a Patron!

/g/ - Technology


View post   

[ Toggle deleted replies ]
File: 138 KB, 652x648, 1452303252661.jpg [View same] [iqdb] [saucenao] [google] [report]
54207311 No.54207311 [Reply] [Original] [archived.moe] [rbt]

>that one autist who chooses a ~3% gain in efficiency over making his code actually readable.

>> No.54207333

3% is a lot

>> No.54207343

3%? so writing it in assembly instead of like java

>> No.54207345

>Bro don't worry about efficiency at all who cares if it's O(n^5) time the compiler will like make it fast and shit

>> No.54207356

>>54207311
That guy is literally saving the earth.

>> No.54207407
File: 84 KB, 725x445, 1453254280496.jpg [View same] [iqdb] [saucenao] [google] [report]
54207407

and if you're a pajeet you get both unreadable code and woefully inefficient code

india is truly a superpower

>> No.54207505

readability is subjective. if it is idiomatic, it barely matters if it is unreadable to a layperson, because idioms matter

>> No.54207507

>>54207311
3% average case? if so, thats fine for large scale production stuff
if this is just for edge cases dont bother with it

>you have created mon more than one occasion several specific transpilers that take in your code and produce an optimized version of it for production (loop unroll, memoization, simd, etc) so you dont have to touch spaghetti code at all
>most of the time they expands code several exponential orders (20kb -> 6mb)
>tfw binary is marginally bigger (few kb) but performance improved a lot

>> No.54208852

>>54207407
How did they get that picture of Rome?

>> No.54208891

>>54208852
The Romans had cameras, duh.

>> No.54208957

>>54207345
>>using big O notation on a Mandarin doodle sharing site

>> No.54209045

I mean, if you have no intention of maintaining or extending the code, you may as well go for the efficiency.

>> No.54209145

>>54207343
>3%? so writing it in assembly instead of like java

The compiler is exponentially better at writing assembly than humans are.

>>54207407
True

>> No.54209255

>>54207311
maisie?

>> No.54209270

>>54209145
Oh really? Who do you suppose wrote the compiler?

>> No.54209345

>>54209270

g++ is written in C++.

As long as you have a decent interpreter, you can run your first compiler. From there, you compile each new release on your older compiler release.

>> No.54209409

>>54209345
g++ is written in C you idiot. Read the fucking source code

>> No.54209889

3% is a lot idiot

>> No.54209920

Depends on what you are writing. If its some shitty javascript webapp then it is slow anyway and 3% doesn't make a difference.

Writing kernel code means that 3% percent is critical.

Know what the fuck you are doing before you go around optimizing shit.

>> No.54209951

>>54209409

>The current stable version of GCC is 5.3, which was released on December 4, 2015.[47]

>As of version 4.8, GCC is implemented in C++.

https://en.wikipedia.org/wiki/GNU_Compiler_Collection#Languages

I'm not even mad

>> No.54209958

>>54207407
Pretty sure Rome 2000 years ago didn't have a space program like India does now either, nice cherrypicking pic

>> No.54209981

>>54209255
i am pretty sure based on my lurkings on /mu/ numerous years ago, that person is called Grimes

>> No.54209999

>>54209958
Im pretty sure if rome was still around they would have one

>> No.54210020

>>54209999
Rome is still around, Italy doesn't have any kind of meaningful space program of its own and haven't contributed shit to anything space related despite being fairly wealthy

>> No.54210041

>>54209409
But then who compiled the compiler?

>> No.54210065

>>54209958
throwing rocks into would-be orbit is a space program in the same sense that having a wagon with a 2 stroke strapped onto it is a race car

>> No.54210069

>>54210020
Oh fuck I totally forgot that Italy is still around

>> No.54210078

>>54210020
I suppose I got the technicallities wrong.

If the roman empire had survived and still controlled all the territories it did today, the world would be so radically different I couldn't predict the future.

>> No.54210110

>>54210020

the Vatican City is the most meaningful space program of all time

>> No.54210139

This is why I'm glad I'm not a programmer. You're called "autistic" if you're actually good at your job and other people have trouble keeping up. I don't want a career where I'm punished for being better than everyone else.

>> No.54210168

>>54207311
>not documenting your code and getting the best of both worlds

"code artisans" are cucks

>> No.54210191

>idiots that copy-paste and make your shitty corporate codebase even worse

>> No.54210421

>>54210020
>Rome is still around
He meant Rome as in Roman Empire, the cradle of the superior civilizational circle you're not a part of, Pajeet.

>> No.54210446

>>54210139

Why would you code for the admiration of your peers?

You code because you want to, and the admiration/bitches comes later when you're making lots of money.

>> No.54210488

>>54210139
If you write barely readable code for non-performance critical applications that's only slightly faster than readable code, you're not good at your job.

>> No.54210509

>>54210110
kek

>> No.54210524
File: 226 KB, 869x1776, 1458244336663.jpg [View same] [iqdb] [saucenao] [google] [report]
54210524

>> No.54210646

>>54210524
>comparing a square root funtion to a max function
>using this many fucking comments for a simple max function

Babby coders detected

>> No.54210654
File: 964 KB, 397x658, image.gif [View same] [iqdb] [saucenao] [google] [report]
54210654

>>54210524
>return 5 le random

>> No.54210692

>>54207311
3% is massive.

There are sacrifices that most be made just to make your code sustainable, like, you know, dividing it into modules.

But then you have idiots that, for example, don't use regex because "muh nobody understands that shit" and end up with more basic code but miles harder to understand.

>> No.54210695

>>54210524
else if (a > b && b < a)
[code]
what the fuck? its the same thing[/code]

>> No.54210730

>>54210041
you usually make the compiler in another language, and then you make a compiler in your language and compile it with the other compiler and now you have a compiler written in your language that can compile the next iterations of your compiler. This approach as a funny name I don't remember.

>> No.54210734

>>54210646
the funyn thing is the max function could be implemented in one line.

return (a >= b)? a: b;

>> No.54210755

>>54209145
>exponentially better at writing assembly than humans are
you have no idea what the fuck you're talking about, sheltered memejs cuck

>> No.54210760

>>54210734
Of course it could. Just goes to show how stupid it is.

>> No.54210773

>>54209409
how does it feel to get raped, anon?

>> No.54210783

>>54209045
if you have no intention of maintaining the code, delete it and go home.

>> No.54210824

>>54210730
https://en.wikipedia.org/wiki/Bootstrapping_(compilers)

>> No.54210838

>>54209045
Pajeet my son

>> No.54210964

>>54210421
If the Mongolian empire was still around, Russians would all be speaking Mongolian.
If the Persian empire never broke apart, we'd all be Amir Hosseins.
I'm not Indian but you gotta pick one.. Blame the Pajeets or blame the corrupt government and years of colonization. The Pajeets are just trying to make it out of the literal shithole that they're living in.

>> No.54211912

>>54207345
But what are the O and n variables?

>> No.54212080

>>54210421
Indians are Indo-European moron.

>> No.54212953

>>54210139
when sacrifice maintainability and prematurely optimize code without running benchmarks confirming that the code needs optimization, you're actually worse than everyone else and indeed shouldn't work as a programmer

>> No.54213659

>>54210524
Holy fucking shit. I can't believe no one has mentioned it yet.

For Karlie's function, if a == b, the returned value is 5.

That is:

max (21, 49) returns 49. a < b. Correct.
max (101, 77) returns 101. a > b. Correct.

max (323, 323) returns 5. a == b. Wrong!

Hahaha! So, essentially, you ask Karlie's function, "What is the larger of 323 and 323?" It answers, "5."

Way to go, Ms. Supermodel! That's showing everyone how girls are smarter than boys. And nice going using an utterly nonsensical implementation as an example of a function a boy would right, nevermind she's comparing apples (square root function) with oranges (max function).

>> No.54213680

>>54213659
Damn it. "right" should be "write" of course.

>> No.54213978

>>54213680
damn right

>>
Name (leave empty)
Comment (leave empty)
Name
E-mail
Subject
Comment
Password [?]Password used for file deletion.
Captcha
Action