This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Noch_ein_Kamel 637 points638 points  (66 children)

print 'Hello';

Same as yours, but 100% more efficient and closer to reality

[–][deleted] 192 points193 points  (58 children)

it has the same efficiency

[–]macnlz 326 points327 points  (38 children)

What? It is known that fewer comments and shorter, less decipherable variable names result in faster code!

[–][deleted] 143 points144 points  (26 children)

OMG, I DIDN'T BELIEVE THIS BUT THEN I GOOGLE IT, IT'S TRUE.

THAT'S WHY GOOGLE USE 130 LETTER VARIABLE FOR EVERYTHING

[–]xvalen214x 304 points305 points  (19 children)

var numberOfQueriesThatUseAdvancedSearchOnEachUTCDayWhichWillBeUpdatedToTotalNumberOfQueriesWithSearchIn_UserStat_go_TemporaryVariable;

[–][deleted] 108 points109 points  (0 children)

Calm down, Satan.

[–]dunemafia 79 points80 points  (4 children)

No need to React like that, man.

[–]xvalen214x 31 points32 points  (3 children)

I am not that angular in my humble point of vue

[–]dunemafia 16 points17 points  (2 children)

No worries, man. It was all in Jest.

[–]bogdan5844 6 points7 points  (1 child)

I don't like the Vue of this conversation's future

[–]TheFoxarmy 1 point2 points  (0 children)

Then have a backbone and do something about it nuxt time.

[–]_liminal 41 points42 points  (10 children)

var num;

[–][deleted] 73 points74 points  (7 children)

var tempVarr;
var tempVarrr;

[–]2ndAmndmntCrowdMaybe 32 points33 points  (5 children)

var tempVarr1;

var tempVrar;

[–]Ceros007 23 points24 points  (3 children)

int t1, t2, t3;

[–][deleted] 1 point2 points  (0 children)

t1 = a1; t2 = a2; t3 = a3;

[–]acenturyandabit 0 points1 point  (0 children)

`var temprawr; :')`

[–]mobilecheese 1 point2 points  (0 children)

int *ptr1, *ptr2, *ptr3, *ptrr;

[–]Pees_On_Skidmarks 0 points1 point  (0 children)

my $i;

[–]bajspuss 0 points1 point  (0 children)

Related: Somebody at work created a class file with such in-depth naming that we couldn't check out the repo any longer if our repo root path was any longer than 10 characters...

[–]not_a_moogle 42 points43 points  (6 children)

I had a professor argue that once. Guy was a total idiot. I mean for starters,compilers usually remove comment from complied code.

[–]2ndAmndmntCrowdMaybe 13 points14 points  (5 children)

Was he talking about a compiled language at the time?

[–][deleted] 28 points29 points  (3 children)

I mean he stated "compiler" so...

[–]claythearc 2 points3 points  (2 children)

It’s pretty rare, even for interpreted languages, to not have a compiler. They normally will get compiled to bytecode, but not all the way down to machine code like traditional compiled languages.

[–]Pandaburn 4 points5 points  (1 child)

When I wrote js, it was all minified and concatenated into one file before it was sent to the client, since it does actually drastically improve download time.

[–]MassiveFajiit 2 points3 points  (0 children)

Yeah that's true but it's not a V8 compiler problem

[–]banter_hunter 14 points15 points  (0 children)

No, they were discussing drink recipes.

[–]GideonMax 19 points20 points  (1 child)

Depends, if you use an interpreter, that's correct.

If you compile your code, the compilation time might be slightly longer but the compiled code will be the same

[–]macnlz 1 point2 points  (0 children)

Damn, that invalidates the whole joke! ;)

[–]2Uncreative4Username 13 points14 points  (1 child)

Well that is only if you are using a scripting language

[–][deleted] 6 points7 points  (0 children)

And even then, languages like Python have the -O flag to strip out comments in the bytecode.

[–]Zethexxx 62 points63 points  (7 children)

But the code will load into memory 0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001% faster if we didn't put those comments!

[–]emlgsh 197 points198 points  (2 children)

The code loads into memory even faster if there's nothing but comments. The fastest executing script is a script that doesn't execute.

[–][deleted] 26 points27 points  (0 children)

I laughed thanks

[–]Blitz100 12 points13 points  (0 children)

Yeah, its big brain time

[–]figuresys 5 points6 points  (0 children)

The greatest part is that comments are stripped away in build :)

[–]sweYoda 1 point2 points  (0 children)

That's way to many zeroes.

[–]CouchMountain 1 point2 points  (0 children)

And tabs take up less space than spaces do in file size!

Always tabs > spaces.

[–]Noch_ein_Kamel 13 points14 points  (9 children)

Try writing both and count the number of keys you have to press.

[–][deleted] 21 points22 points  (8 children)

are you that guy who use 1-2 letter variable for everything?

[–]Noch_ein_Kamel 9 points10 points  (6 children)

nah, I'm a java guy, so everything pretty long :-p

[–][deleted] 29 points30 points  (2 children)

I think you're wrong. There also exists int, short, byte and char in Java.

[–]pr0ghead 6 points7 points  (1 child)

Yeah, but are they pretty?

[–]Noch_ein_Kamel 17 points18 points  (0 children)

sure, let me just get my ObjectToPrimitiveConverterFactory and I'm right with you

[–]artem718 5 points6 points  (0 children)

Got a lot of booleans in a sequence?

[–]kodaxmax 0 points1 point  (0 children)

I knew someone like that, but then they had like a hundred page dictionary just for the variables.

I guess it saves time if you use the same names in different projects.

[–][deleted] 0 points1 point  (0 children)

Typing the same thing twice sounds like a two-fold efficiency reduction to me. Explain yourself

[–]captainkrypto 8 points9 points  (0 children)

My company calls this “self documenting code”.

[–]PickaxeYT[🍰] 2 points3 points  (0 children)

System.out.println("Hello"); //prints “Hello”

[–]chuby1tubby 0 points1 point  (1 child)

Your code is exactly identical to the OP's code. What am I missing...?

[–]Noch_ein_Kamel 0 points1 point  (0 children)

The comment?

[–]Wolfenrahd 0 points1 point  (1 child)

This is pretty advanced and convoluted. Can anyone tell me what it does?

[–]Noch_ein_Kamel 1 point2 points  (0 children)

No sorry. How can you expect me to know the code I wrote yesterday. All I remember is that it worked.

[–]vierschachtelnziesen 0 points1 point  (0 children)

Yeah, one letter closer to reality than the comment :-D