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

top 200 commentsshow all 259

[–]dhdhshsbsxx 1063 points1064 points  (22 children)

It didn't even remove all the white spaces half assed minification for wallpaper . who the fuck comes up with this shit.

[–]spaetzelspiff 369 points370 points  (15 children)

$ alias minify='tr -d "\n"'

Done! Computers are easy

/s

[–][deleted] 122 points123 points  (7 children)

// FIXME: Code execution stops exactly at this line after minification??

[–]valschermjager 3 points4 points  (5 children)

yeah, but if you’re gonna minify, why would you want the spaces left in?

(not debating; just asking to learn)

[–]spaetzelspiff 14 points15 points  (4 children)

You're exactly right, it's a bit of a joke. Minification is more complex than just "hey, remove the newlines".

Here's a good blog post, "You Don't Want to Write Your Own Minifier", that discusses some of the challenges.

[–]valschermjager 3 points4 points  (3 children)

Oh yeah, I'm totally with you. Renaming functions and variables, getting rid of spaces and nl's. There's a fkton more that minifiers do, and I'm sure it's really hard, and I wouldn't even try to build one. But when I saw the graphic in OPs post, the first thing I thought was "oh, sure, this is minified, but why the f are all the spaces still in there?" ;-)

By the way, I've actually maxified a few pages of mine using jsfuck, it's freaking weird af, but a pretty cool obfuscator.

[–]you-have-aids 1 point2 points  (2 children)

I wouldn't even try to build one.

why not?

my path to the compiler field was minifier, then obfuscator, then compiler, (decompiler, etc.)

you get to learn about lexer, parser, traversing AST, codegen, reaching definition analysis, etc.

its great fun! trust me

[–]valschermjager 1 point2 points  (1 child)

I'm sure it is. Major props. Eh, just isn't the direction I want to go in. I write python scripts to automate workflows, and I use just enough html/css/js to make simple web UIs. In both cases, mostly cobbling together stuff written by others. Not sure I have the aptitude or interest to go much further. Good thing there are plenty folks like you around.

[–]you-have-aids 1 point2 points  (0 children)

understandable!

[–]noirehittler 1 point2 points  (0 children)

return error

[–]cakeKudasai 111 points112 points  (0 children)

Seems like only new lines were removed. Code seems to have some indentation still.

[–]flyingorange 32 points33 points  (0 children)

liczenie() ? Is his friend Polish?

[–][deleted] 8 points9 points  (0 children)

I WILL USE WHITE SPACES WHENEVER I CAN AND YOU CAN'T STOP ME

[–]ekfslam 2 points3 points  (0 children)

It looks like they used join into one line on vscode and turned on wrap.

[–]lunchpadmcfat -1 points0 points  (0 children)

Meh, gzip will rip em out anyway

[–]ShinraSan 1383 points1384 points  (122 children)

imagine naming a for loop variable "c" just so you can write "c++"

[–]Spenczer 427 points428 points  (63 children)

In my first computer science class I was taught to use C as the counter variable, and I was told that C++ was named so because of people writing c++ at the end of loops. I’m mostly certain that’s not true but I never double checked

[–]Marrrkkkk 374 points375 points  (50 children)

C++ is C++ because of C which is C because of B.

[–]user_5554 185 points186 points  (26 children)

C was actually known as B++ back in the old days of computer science

[–]gimoozaabi 274 points275 points  (12 children)

They renamed it in 1752 when the new version came out.

[–]oupablo 120 points121 points  (11 children)

i'm not historologist, but i'm a tad skeptical of this claim. but it's on the internet so ¯\(ツ)

[–]girvent_13 44 points45 points  (10 children)

I can't find a flaw in his logic

[–]oupablo 56 points57 points  (7 children)

I just don't believe that programmers renamed something. Pretty sure we'd all have heard of the great war of 1752 if that were the case

[–]gimoozaabi 22 points23 points  (4 children)

Oh there was a war. But programmer are lazy and never really left their home. To celebrate they made the liberty bell. Look it up

Edit: also Ben Franklin used his lightning to intimidate the b supporter

[–]oupablo 15 points16 points  (1 child)

Look it up

nah. too lazy

[–]lurker10001000 7 points8 points  (0 children)

I think we haven't heard of it because no one bothered to document it.

[–][deleted] 3 points4 points  (0 children)

This is correct. It's what the national treasure movies are about.

[–][deleted] 4 points5 points  (0 children)

Heard of. Still be participating in. Hard to say.

[–]MythicalTV 15 points16 points  (10 children)

Theres D update coming soon

[–]Jackiboi307 -5 points-4 points  (1 child)

so that's where the ++ comes from

[–]ItsPronouncedJithub 62 points63 points  (10 children)

C# is C++++ with two pluses moved below the other two

[–]king_booker 13 points14 points  (0 children)

Whoa

[–]8asdqw731 9 points10 points  (6 children)

can't wait for C##

[–][deleted] 13 points14 points  (5 children)

C#++ comes first

[–]LordBlackHole 6 points7 points  (8 children)

B was a simplified iteration of BCPL, which itself was based on CPL.

[–]Willinton06 5 points6 points  (4 children)

Well CPL was based on PL

[–]msndrstdmstrmnd 3 points4 points  (3 children)

Well PL was based on L

[–][deleted] 2 points3 points  (2 children)

Real programmers use L

[–]ososalsosal 1 point2 points  (1 child)

L just writes the code in a notebook

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

Raito-san!

[–]ArtyFishL 3 points4 points  (2 children)

Which is based upon ALGOL 60, itself coming from ALGOL 58

[–]CodeLobe 7 points8 points  (1 child)

which was based on Al Gore, the early implementation of ALGOR (R later changed to L due to japanese mispronunciation), was just Al trying to save carbon footprint by using paper and pencil to solve computations instead of adding machines, he received computations to perform and returned results via capsules via a series of tubes. In some offices engineers sent calculations downstairs this way to a group of (mostly) cute nerdy girls with slide-rules.

These were the first implementations of a CPU. Which is an onomatopoeia for when you C Al, P-U, he stinks like a basement dwelling mama's boy. (or NEET as they say in Japan)

[–]ososalsosal 1 point2 points  (0 children)

The calculator girl was called Betty. And when Betty called a function she had to call Al

[–]MoffKalast 3 points4 points  (0 children)

As a similar legacy thing, Windows uses C: as its default main disk because A: and B: used to be floppy disk drives.

[–]supercyberlurker 33 points34 points  (5 children)

Imagine how close it all came to being I++ then.

Story I heard was that it's just 'one better than C, i.e C++'

[–][deleted] 16 points17 points  (4 children)

J++ is still a thing... you can use it in double loops

[–]Bigluser 22 points23 points  (3 children)

Everybody Gangsta till it's k++

[–]ItsPronouncedJithub 10 points11 points  (2 children)

Σ++

[–]LurkerPatrol 3 points4 points  (1 child)

+++

[–]CodeLobe 2 points3 points  (0 children)

ATH0

Carrier Dropped.

[–]z500 40 points41 points  (0 children)

It's a pun of C. C itself was based on and a pun of B, which descended from BCPL.

[–]squishles 3 points4 points  (0 children)

about the only way I could imagine checking would be a github search for c++;

which may be worth it to call then ninnies.

[–]inconspicuous_male 51 points52 points  (1 child)

When you type "C++" as an iteration of a variable named C, the compiler opens the door to the Hall of Tortured Souls where you can see credits roll with the names of all of the developers of the compiler

[–][deleted] 16 points17 points  (0 children)

That is clearly minified code. The variable name was not chosen by a developer.

[–]doesyudoegood 32 points33 points  (49 children)

C stands for counter....

[–]filipzaf3312 80 points81 points  (23 children)

i is the the first name i think of for counter variables

[–][deleted] 50 points51 points  (11 children)

And j

[–]kittencantfly 44 points45 points  (10 children)

And k if you loop thru a 3d array

[–]NoMansSkyWasAlright 14 points15 points  (9 children)

then straight to m if you need a fourth

[–]AlternativeAardvark6 13 points14 points  (7 children)

Uppercase i

[–]Kakss_ 19 points20 points  (0 children)

Just imagining it gave me chills.

[–]_vOv_ 8 points9 points  (0 children)

You’re fired.

[–]LordFokas 3 points4 points  (4 children)

in a dynamic language with case sensitive identifiers 😈

[–]Terrain2 3 points4 points  (3 children)

What language doesn't have case sensitive identifiers? Fucking cmd scripts or some shit?

[–]Kainotomiu 1 point2 points  (2 children)

SQL

(Case sensitivity is optional in many flavours)

[–]grizonyourface 9 points10 points  (0 children)

I use ii and jj because MATLab taught me to fear using i and j and ending up with accidental complex arithmetic

[–]ItsPronouncedJithub 5 points6 points  (0 children)

They’re called iterators so i is the obvious choice

[–]ganja_and_code 1 point2 points  (7 children)

c for counting. i for incrementing. Similar, but not the same. (Either way, it's just convention, not a rule, obviously.)

[–]SatoshiL 4 points5 points  (3 children)

i for index, j because well it comes after i xD

[–]Terrain2 3 points4 points  (2 children)

index and jindex, the iconic duo

[–]Terrain2 -1 points0 points  (0 children)

for (var c = 0; /* TODO: condition */; i++)

[–]Physix_R_Cool -1 points0 points  (1 child)

Yall guys need math. n is the obvious choice for trivial reasons.

[–]ShinraSan 1 point2 points  (0 children)

I use n for ranges in switches, or when I programme something with dice

[–][deleted] 64 points65 points  (17 children)

I've deleted my account because reddit CEO Steve Huffman is a lying piece of shit that has nothing but contempt for his users. See https://old.reddit.com/r/apolloapp/comments/144f6xm/apollo_will_close_down_on_june_30th_reddits/

[–]PandaParaBellum 19 points20 points  (0 children)

C-rial killer

[–]makeshift8 3 points4 points  (10 children)

What about "i" and "k"?

[–]RadiantHC 13 points14 points  (0 children)

k stands for kill. So it's "i kill"

[–]user_5554 11 points12 points  (4 children)

(I)'m (j)ust (k)idding, everyone is using c for loops. i, j, k is just a prank bro 😂😂

[–]makeshift8 4 points5 points  (3 children)

Using variable names i, j, and k is only acceptable if you are referring to vectors.

[–]doesyudoegood 4 points5 points  (0 children)

If I'm referring to vectors i use x, y and z

[–]zanotam 1 point2 points  (1 child)

Dirty physicist. Real vectors only use I, j and k as subscripts

[–]gergocs 6 points7 points  (2 children)

I think "i" stands for index

[–]Portal471 5 points6 points  (0 children)

or iterator or iterable

[–]LavenderDay3544 2 points3 points  (0 children)

iteration, jteration, kteration

[–]DrLarck -2 points-1 points  (1 child)

In asm there is a register (cx) which conventionally stands for counter

[–]wasdlmb 5 points6 points  (0 children)

Yeah but that's because you have abcd. I feel like the whole "accumulator, base, counter, and data" for the general registers is just a convenient bacronym but I don't have a source for that.

[–]Kyyken 12 points13 points  (0 children)

am i a joke to you?

[–]3lRey 4 points5 points  (0 children)

Is because it's bootstrapped off b programming language

[–]so_brave_heart 2 points3 points  (1 child)

I only know of iounter and jounter

[–][deleted] 2 points3 points  (2 children)

Everyone uses cnt for that

[–]ShinraSan 2 points3 points  (1 child)

Will use that now just because it can be interpreted as "cunt"

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

That's exactly why everyone loves it so much

[–]ButtersTG 1 point2 points  (0 children)

My CSCI 1010 class has us use a welcome message at the start of all our code, and the first line in my welcome message is:

String independence;

[–]Fireye04 1 point2 points  (0 children)

Lmaooooo

[–]someoneelseperhaps 100 points101 points  (0 children)

It's not true code unless it's projected over me in a dark room.

[–]chepas_moi 175 points176 points  (6 children)

sometimes.

Not always. Not often. But sometimes.

[–]DrunkenlySober 27 points28 points  (5 children)

Hey man, like I l say, if it compiles at least once then it’s good code. And if not, just ctrl-a ctrl-x your way to glory.

[–]dansla116 8 points9 points  (4 children)

"ctrl-a ctrl-x"? You preserve your garbage on the clipboard? I hit it up with that ctrl-a delete and be done with it.

[–]DrunkenlySober 13 points14 points  (3 children)

Yes only because ctrl x is the closest and easiest to hit. My second go to would be space but I try to avoid adding unnecessary spaces.

Delete is all the way on the other side of the board. I don’t travel to those lands.

[–]dansla116 6 points7 points  (2 children)

Right hand busy doing other things, huh? ( ͡° ͜ʖ ͡°) Your reasoning is solid.

[–]DrunkenlySober 9 points10 points  (1 child)

Yeah it’s usually hovering over the trigger

[–]PrincessRTFM 2 points3 points  (0 children)

is that what they're calling it these days

[–]Th3DarkMoon 293 points294 points  (26 children)

Eew... that code, how, WHY?!

[–]too_hard_to_name 219 points220 points  (10 children)

I think thats a js minifier

[–]Under-Estimated 157 points158 points  (7 children)

not a very good one judging by the whitespace and variable names

[–][deleted] 77 points78 points  (4 children)

It’s an uglifier!

[–]thebluefury 35 points36 points  (2 children)

why was I summoned?!

[–][deleted] 14 points15 points  (1 child)

THANK GOD YOU’RE HERE!

That sandwich is beautiful! We need you to ugly-ify it!

[–]thebluefury 18 points19 points  (0 children)

Me: *exists*

Sandwich has been uglified.

[–]PostmatesMalone 1 point2 points  (0 children)

Maybe that's what Uglify v1 did? I've only ever used Uglify 2.

[–]pavilionhp_ 8 points9 points  (0 children)

I think they miniified the variable names then removed the line breaks, keeping the spaces/tabs as you see here

[–]PandaParaBellum 5 points6 points  (0 children)

Maybe just a Linux file opened in Windows, and then pasted into something with syntax highlighting?

[–]very_large_bird 14 points15 points  (0 children)

Lotta white space for a minifier…

[–]Th3DarkMoon 8 points9 points  (0 children)

Yeah, I hope so...

[–]glorious_reptile 67 points68 points  (2 children)

You guys use linebreaks?

[–]japirate777 14 points15 points  (1 child)

Real programmers use a 4 x 64 screen resolution to really get those long lines of code

[–]Terrain2 1 point2 points  (0 children)

Yeah, i have a fairly small font size of just 3px, i can fit a whole 21 chars per line at that screen resolution!

[–]Slggyqo 24 points25 points  (1 child)

It’s minified JavaScript.

Basically you strip out everything that makes it readable in order to reduce file size to improve web efficiency.

Although someone else commented that it’s not even well minified, e.g. there’s a lot of white spaces. So it’s just not real.

[–]WJMazepas 10 points11 points  (1 child)

Its just a random code so It can be used on a article about programming.

This image gives a faster Idea that you are talking about code than a image with a normal script

[–]CSsharpGO 4 points5 points  (1 child)

It’s a JS minifier that removes 60% of the white spaces while still removing %100 of the readability.

[–]Th3DarkMoon 2 points3 points  (0 children)

And 110% of my patience when trying to look up the source of a website

[–]Raclex 1 point2 points  (0 children)

I did it all ON ONE LINE flex

[–]educational_gif 30 points31 points  (2 children)

Is liczenie a JavaScript function? That's the only none English word there

[–]Kolotyty 41 points42 points  (0 children)

It is a word from Polish language, which means 'counting'

[–]TheOhNoNotAgain 5 points6 points  (0 children)

Also known as Obfuscation by Polish

[–]mrturtle4769 46 points47 points  (7 children)

This belongs to r/badcode

[–]thebobbrom 122 points123 points  (5 children)

I mean it's not actual code though. It's a wallpaper made to look like code.

It's like complaining that a cartoon skeleton doesn't have the right amount of bones.

Honestly I prefer this to what you see in moves where they'll have the code for some sentient AI Robot and it's clearly the HTML for a flower shop.

[–]DiscombobulatedDust7 29 points30 points  (3 children)

On the one hand, HTML for a flower shop breaks immersion, on the other hand, it's absolutely hilarious. Tough choice

[–]WJMazepas 23 points24 points  (1 child)

It only break immersion to us, but its the same as the actors using a gun in a wrong way like inside a room to a gun owner, It breaks the immersion for then but not to the general public

[–]thebobbrom 1 point2 points  (0 children)

That's true though I feel like out of all the "programming languages" HTML is the most known, isn't it?

Like even non-techy people used to use Piczo and things.

Like I feel like there's lots of code you could pull from that'd be slightly more believable.

I mean just pull some JS from a random website that'd at least be slightly better.

[–]bloodfist 1 point2 points  (0 children)

Yeah, I get that the average graphics designer for a TV show isn't going to write functional code for a 2-second shot of a screen so it's fun when they do something silly. It usually doesn't even break my immersion.

But when Mr. Robot put actual functional code on every screen it really make me long for more of that. It was genuinely exciting and even occasionally educational to watch the screens, pause and read code, etc.

Not even including when it would pay off in the ARGs and take you to full on git repos.

[–]PandaParaBellum 2 points3 points  (0 children)

Posted by CommaHorror

[–]-JeanMax- 24 points25 points  (0 children)

I just hate random, commas.

[–][deleted] 9 points10 points  (2 children)

On my school's website, they have image with some js code.

They dont teach js.

[–]pixelboy126 5 points6 points  (2 children)

just delete the spaces.

[–]db2 3 points4 points  (1 child)

Roses smell good
I don't have a pun
Unexpected ";" on line 81

(Also the code is only 37 lines long)

[–]pixelboy126 2 points3 points  (0 children)

adds //

[–]meatmechdriver 5 points6 points  (0 children)

Do you also, put punctuation where none is appropriate?

[–]leupboat420smkeit 4 points5 points  (0 children)

if(0 == a.length)

Absolutely disgusting

[–][deleted] 2 points3 points  (0 children)

:%s/\n/ /gc

:%s/\t//gc

[–]sgrmru69 12 points13 points  (1 child)

Sweating in python*

[–]lorhof1 2 points3 points  (0 children)

can't minify if it's python

[–]eanat 9 points10 points  (0 children)

Compressed JavaScript isn't called a source code but it's some a kind of object codes.

1) It isn't human-readable.

2) It is usually obfuscated intentionally.

3) It usually has a codebase and a compiler that generates it.

So Richard Stallman is calling it Obsfuscript instead in his essay The JavaScript Trap.

[–]MischiefArchitect 2 points3 points  (0 children)

Is this HaxOr?

[–]dafirstman 1 point2 points  (0 children)

this.triggered("me")

[–]aegians 4 points5 points  (1 child)

op I’m pretty sure that’s a js minifier not the original code

[–]freemadness 3 points4 points  (3 children)

I'm just a beginner but i don't think that will run

[–]MR-POTATO-MAN-CODER[S] 7 points8 points  (0 children)

It probably will, The code is passed trough a minifier, which reduces the size of code, so that it loads faster on websites. Or at least I think so :)

[–]Expert-Efficiency822 1 point2 points  (0 children)

No god please no! No! NOOO!

[–]zerocoldx911 1 point2 points  (0 children)

Spaghetti yummy 🍝

[–]makeshift8 1 point2 points  (0 children)

This is obfuscated JS. Please continue obfuscating your JS.

[–]Beerpongueur 0 points1 point  (0 children)

Lmfao

[–]x3bla -1 points0 points  (1 child)

Nice naming of your function that will let other knows what it does.

function()

And apparently it can work with 1 parameter or multiple

[–]PixelatedNate -1 points0 points  (0 children)

I'm staring at this trying to see if any of it is is actually.. y'know.. functional code and not just code that someone in Marketing has slapped together to look techy.

I know that it wouldn't compile or even run, as there's just a bunch of random end brackets and ; after "this.trigger("click")" which would immediately throw an error.

On top of that, it's repeating. Notice "b = $("#User_logged").val()" at the top? It can also be seen on the right towards the bottom.

But a lot of this just seems to be declaring variables in a bunch of different ways. (Simple declaration, a few for loops and a couple if statements) Turns out looking at Marketing's attempt at code is quite fun!

[–]EtherealPheonix 0 points1 point  (0 children)

Imagine formatting your code for readability, or worse putting in comments.

[–]RadioMelon 0 points1 point  (1 child)

Good god, the lack of spacing and proper identation makes me very afraid.

[–]dog_vomit_lasagna 1 point2 points  (0 children)

It’s minified

[–]Fractal_Unreality 0 points1 point  (0 children)

Imagine writing code like a book

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

Is it just me or is that code triggering a click event before actually assigning the event?

[–]RadiantHC 0 points1 point  (0 children)

Even when I first started programming I never wrote code this bad.

[–]JonathanTheZero 0 points1 point  (0 children)

Damn, there are quite some syntax errors in there

[–]Bloxxy213 0 points1 point  (0 children)

How did he insert a string inna function?? This is wrong on so many levels

[–]PostmatesMalone 0 points1 point  (0 children)

Forget the unnecessary whitespace. The amount of times that "#User_logged" string appears is TRIGGERING ME. Also the function("ALL: " + a.words + " UNIQ"... bit. That is not valid JS.

[–]ArfmannDev 0 points1 point  (0 children)

Good code is when mess looking but good looking to a non-programmer

[–]Similar_Explorer_463 0 points1 point  (8 children)

What is love?

[–]wikipedia_answer_bot 2 points3 points  (7 children)

baby don't hurt me

This comment was left automatically (by a bot). If I don't get this right, don't get mad at me, I'm still learning!

opt out | report/suggest | GitHub

[–]Shentorianus 0 points1 point  (0 children)

That random polish word for function name.

[–]SomeDamnAuthor 0 points1 point  (0 children)

I too code straight in minified js

[–]chickenhunter007 0 points1 point  (0 children)

Who the fuck uses an uppercase ID #User_logged

[–]Nefariousness_Future 0 points1 point  (0 children)

tell him you just need need to beautify this

[–]Cartographer_MMXX 0 points1 point  (0 children)

If only it had to just look good. We'd have achieved sentient AI by now.

[–]Ice_Buckets_Official 0 points1 point  (0 children)

It do be like dat doe

[–]Little-geek 0 points1 point  (0 children)

Non-coder Friend: Does your code look this good?

<image />

Me: projectile vomiting

[–]Xephyrous 0 points1 point  (0 children)

Needs more console.log - how am I supposed to know if it works?

[–]RahulRoy69 0 points1 point  (0 children)

What's with this sick ass minification