99

What would be this in your (programming) language?

Comments
  • 13
    while(this.IsDrunk)
    //if(this.ShouldDance)
    this.Dance();
  • 7
    bool should_dance(int drunk_rating) {
    if (drunk_rating < 1); {
    return true;
    }
    return false;
    }

    // yes, this should be:
    // return (drunk_rating < 1);
    // but that ruins the joke.
  • 6
    if (you.alcoholIntake > you.tolerance)
    {
    you.dance(true);
    }
  • 4
    go_ahead_and_dance if user.drunk?

    :) see how beautiful that shit was?
  • 2
    DoSth();
    CheckIfUserCanDoSth();
    DoSthAgainRegardles();

    Not the language idiocy per se, but sth a coworker of mine did..
  • 2
    !canDance =/> !shouldDance
  • 1
    Look, I like because it challenges me. It's fun yknow, there are a lot of different solutions but taking different paths require different sacrifices. Not everyone knows about closures. Not everyone knows how to use an IIFE. There are a lot of parts of JavaScript that are complicated but don't need to be. It is one of those languages where it is weird but not necessarily wrong.

    I love JavaScript because it was developed in 10 days and has been sensationalized across the world - it is the language of internetwork human interaction
  • 2
    @Crazed uhm. Did you wander into the wrong rant?
  • 1
    @Root it appears to be so. I read "what is your favorite programming language"; I attribute that to the vodka needed to deal with JavaScript. It's a love/hate relationship
  • 4
    me = hooman(social=0.1)

    while me.drunk():
    if me.canDance():
    me.doDance()
    else:
    me.doDance()
    me.addItem(tequila=1)
  • 1
    prototyp (tanzen)
    neueVariable (ichbetrunken = "ja")

    leer tanzen
    anfang
    schreiben ("TANZ TANZ TANZ")
    ende

    haupt
    anfang
    wenn (ichbetrunken == "ja")
    anfang
    aufrufen(tanzen)
    ende
    ende
  • 4
    Just because you can't manage memory doesn't mean you shouldn't.

    -c
  • 1
    Dance anyway :)
  • 1
    @linuxer4fun y u do dis
  • 0
  • 1
    function dance(){
    try{
    dance();
    }catch(Exception $e){
    dance();
    }
    }
  • 3
    If isdrunk() then dance() else dance() end
  • 1
    isDrunk ? dance() : chillAndWatchOthersDance()
  • 1
    public class NightOut
    {
    private int drunkThreshold
    { get; set; }
    private int alcoholUnitsConsumed
    { get; set; }

    public NightOut(int _drunkThreshold)
    {
    this.alcoholUnitsConsumed = 0;
    this.drunkThreshold = _drunkThreshold;
    }

    private void GoToBar()
    {
    this.alcoholUnitsConsumed++;
    }

    private void Dance()
    {
    //todo
    }

    public void HaveNightOut()
    {
    while(this.alcoholUnitsConsumed < this.drunkThreshold)
    {
    this.GoToBar();
    }

    this.dance();
    }
    }

    public class Program
    {
    new NightOut(3).HaveNightOut()
    }
Add Comment