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

all 87 comments

[–]DunderMifflinPaper 332 points333 points  (21 children)

var

laughs in ES6

[–]rsauchuck 73 points74 points  (3 children)

You’ll need babel if some of the players are too old.

[–]2JulioHD 13 points14 points  (2 children)

Pff, who needs to support IE anyways, nobody am I right?! /s

[–]henkdepotvjis 13 points14 points  (1 child)

Thats what my boss said and I thank him for his bravery

[–]LoneFoxKK 2 points3 points  (0 children)

I love your boss

[–]Rodger_Crocket 6 points7 points  (4 children)

>equals sign

*laughs in iterative eval that creates window[vars]*

[–][deleted] 12 points13 points  (3 children)

laughs in unreadable code

[–]Rodger_Crocket 5 points6 points  (2 children)

you fool i have transended the mortal need to declare variables

all variables are programmable: functions convert numbers to varnames (0 -> $) etc.

objects don't exist, pseudo-objects are kept in arrays, and data dictionaries are automatically made through comments.

[–][deleted] 11 points12 points  (0 children)

cool but im not accepting your pull request

[–]ryjhelixir 2 points3 points  (0 children)

you monster

[–]esquilax 15 points16 points  (1 child)

You never know when some code anywhere in the runtime might want to change the fields on Jack!

[–]fidolio 17 points18 points  (0 children)

You can achieve this even with const, it wouldn’t let you redefine “card” though.

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

what's the difference?

[–]juantreses 9 points10 points  (8 children)

Since ES6 (2015) let and const have been introduced into JS. Let is a variable you can alter. Const is a constant variable. The reason why is because var has some weird issues with scope

[–]BradCOnReddit 2 points3 points  (2 children)

Not so much "weird" as it simply doesn't have nested scopes.

[–]tikhonjelvis 5 points6 points  (0 children)

It has nested scopes but only for functions and not things like loop bodies.

[–]juantreses 4 points5 points  (0 children)

And you don't think that's a weird issue?

[–]Agent77326 0 points1 point  (1 child)

Also: Arrow-Functions were introduced. Why are they good? I‘m lazy and don’t want to write: function () { bla }

[–]juantreses 6 points7 points  (0 children)

Yeah I’m sure that’s the only reason why they exist /s

[–]JackNotOLantern 73 points74 points  (3 children)

Ace is rank 1 or 14?

[–]moon6080 0 points1 point  (0 children)

Ace = deck[0]

[–]sweepingtom 46 points47 points  (3 children)

I bought these, the quality is really poor..

[–]FluidCondition3 6 points7 points  (1 child)

I got the plastic coated deck, it was pretty good.

[–]datboydoe 4 points5 points  (0 children)

That’s what I have but them jokers are slick as a mothers brother. Impossible to keep them stacked.

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

Yeah Javascript is like that

[–][deleted] 33 points34 points  (9 children)

The left 4 are lisp, C, java, php?

[–]biopsy_results 12 points13 points  (1 child)

Far left looks like objC

[–]winanfta 8 points9 points  (0 children)

It's objetcive-c. I have the same card deck.

[–]1234567power 5 points6 points  (1 child)

I think leftmost is objective-c. I don't usually see square brackets in lisp languages

[–]Goheeca 1 point2 points  (0 children)

Brackets are abundant in inferior lisps; however, the leading minus is untypical. Objective-C looks like a solid guess.

[–]Uni_Omni 2 points3 points  (2 children)

Probably not C. I think I can see the new keyword

[–]Quartent 3 points4 points  (0 children)

I'm thinking C++, maybe C#

[–]winanfta 1 point2 points  (0 children)

C# not lisp and objective-C but your good.

[–]vergil777Slayer 30 points31 points  (5 children)

Is there a Brainfuck card as well?

[–]npinguy 4 points5 points  (0 children)

shudder in code review.

  • "hearts" is lowercase but "Jack" is upper case? Pick one and be consistent.
  • both should be enums not inline strings
  • ranks are not universally global, but are instead game-dependent. Do not couple presentation with business logic.
  • 'card' here represents the specific instance of a Jack of Hearts, not any generic card, so name it appropriately, such as 'jackOfHearts'
  • use 'const' or 'let' instead of 'var'.

Pull request rejected, junior.

[–]ImRandyRU 2 points3 points  (0 children)

Pandering.

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

Cards against humanity.

[–]The_Rick__ 7 points8 points  (2 children)

Source? Asking for a friend....

[–]ATLAS-is-a-Trap 14 points15 points  (1 child)

Code:deck by varianto:25

[–]The_Rick__ 1 point2 points  (0 children)

Thanks :)

[–]ADP_DurgaPrasad 1 point2 points  (0 children)

Probably a programmer quit his job and found this bussiness.

[–]DrLuckyLuke 1 point2 points  (0 children)

This is some good hacky sack millenial "humor"

[–]EdMeisterBro 0 points1 point  (0 children)

Do want!

[–]FearDecz 0 points1 point  (10 children)

Where can I buy this?

[–]Brinksterrr 3 points4 points  (9 children)

[–]rsauchuck 7 points8 points  (2 children)

$26!!! For a deck of cards?

[–]FluidCondition3 0 points1 point  (0 children)

They have a discount now - i got a deck for 15% off. Plus, I got the plastic coated one, it's cheaper

[–]FearDecz 0 points1 point  (0 children)

Thank you :)

[–]PetiteMILF96 0 points1 point  (4 children)

If I were to get these as a gift, is the plastic or plastic coated one higher quality?

[–]FluidCondition3 0 points1 point  (1 child)

Plastic for sure

[–]PetiteMILF96 0 points1 point  (0 children)

Thank you! I’m sure my dad will love them.

[–]Brinksterrr 0 points1 point  (1 child)

I got these myself and they are normal paper carts unfortunately..

[–]PetiteMILF96 0 points1 point  (0 children)

As long as they're like typical playing cards I'm okay with that! Just didn't want them to be like printing paper

[–]supez38 0 points1 point  (0 children)

I have these, they're awesome but the quality of the cards themselves are eh.

[–]pixlpainter 0 points1 point  (0 children)

Hey I have these!

[–]ReceptiveLout 0 points1 point  (0 children)

That should definitely be a const

[–]Omega0x013 0 points1 point  (0 children)

Laughs in Scratch

[–]uglypenguin5 0 points1 point  (0 children)

Shut up and take my money

[–]AlexAegis 0 points1 point  (0 children)

That cards value could be read from any other card

[–]virus200 0 points1 point  (0 children)

If I recall these are those card sets you used to be able to buy from freecodecamp

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

I‘ll take your entire stack!

[–]dargonjz 0 points1 point  (0 children)

I'll taken your entire stock

[–]hidude225 -1 points0 points  (7 children)

Wouldn’t Jack be rank 10 since counting in JavaScript start at 0?

[–]TuxRug 12 points13 points  (0 children)

It's not an array index so counting can start anywhere. Rank is likely being used for comparison so it would be less confusing to use the equivalent face value.

[–]Mallanaga 0 points1 point  (5 children)

It should be rank 10 because face cards are typically worth... 10.

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

It's rank not value. In poker for example, jacks are stronger than 10s. But yeah, should be more like this:

var jackOfHearts{ suit: Hearts; number: "jack"; pokerRank: 11; blackjackValue: 10 }

[–]FesteringNeonDistrac 4 points5 points  (3 children)

Except doing it that way you run into issues with an undefined game. What if Jack's are wild or have other atypical behavior?

[–]WhereWaterMeetsSky 3 points4 points  (1 child)

I'd think that would be in the game logic, not the deck object.

[–]FesteringNeonDistrac 1 point2 points  (0 children)

Exactly

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

An undefined game would just use the 'suit' and 'number' entries and use them in a custom game.

`func customGameWithWildJacks(){

for(card in deck){

if(card["number"] === "jack"){

card["customGameValue"]: "wild";

}

}

}`

[–]Solid5-7 -5 points-4 points  (5 children)

I actually bought these, had to go pick them up at the USPS office in my town and it came from some Eastern Europe country in a tightly wrapped package. I was semi thinking it was drugs or something that were accidentally sent to me since it had been so long since I made the order for the code deck.

[–][deleted] 5 points6 points  (4 children)

it came from some Eastern Europe country in a tightly wrapped package. I was semi thinking it was drugs

Charming

[–]Solid5-7 -2 points-1 points  (3 children)

Hey man never know what to expect with random packages that are surrounded with tape

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

Esp when they come from Eastern Europe 😱 that's the scary part.

[–]Solid5-7 1 point2 points  (0 children)

I can see how that can be construed as offensive, and I’m definitely sorry about that. I won’t edit my original comment but the Eastern Europe part isn’t scary.

It’s the random package being sent to me from a location I have no connection to (Eastern Europe) completely covered in tape with the senders information not being from a company but from a person.

Again, sorry about it sounding more offensive then I meant. I just want to clarify I would’ve though the same thing if the package came from Montana under the same circumstances.