Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 8992 8993 [8994] 8995 8996 ... 11062

Author Topic: Things that made you go "WTF?" today o_O  (Read 14915447 times)

Kagus

  • Bay Watcher
  • Olive oil. Don't you?
    • View Profile
Re: Things that made you go "WTF?" today o_O
« Reply #134895 on: June 18, 2018, 01:16:50 pm »

So I audit code as part of my job. I look at many different codebases.

This one in particular has flags.

A lot of flags.

And not just like flagHasValueX, oh, no.

This is some 'if (flag32)' shit. No explanation given.

this is not okay, but i'm not here to tell them their code blows, only where it's vulnerable

Code: [Select]
. = ..()This is what pops to mind whenever I hear about incomprehensible code.

Biowraith

  • Bay Watcher
    • View Profile
Re: Things that made you go "WTF?" today o_O
« Reply #134896 on: June 18, 2018, 01:36:02 pm »

HYS?
Have Your Say

Basically the comments section on selected BBC articles.
Logged

McTraveller

  • Bay Watcher
  • This text isn't very personal.
    • View Profile
Re: Things that made you go "WTF?" today o_O
« Reply #134897 on: June 18, 2018, 01:53:10 pm »

Code: [Select]
. = ..()This is what pops to mind whenever I hear about incomprehensible code.
WTF programming language is that?  :o

(EDIT: a LISP-like? I'm sadly not that familiar with those... although I think LISP needs more parentheses...?)
Logged
This product contains deoxyribonucleic acid which is known to the State of California to cause cancer, reproductive harm, and other health issues.

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Things that made you go "WTF?" today o_O
« Reply #134898 on: June 18, 2018, 02:16:16 pm »

if it were lisp it'd be more like (..) than ..(). That looks familiar to me and I don't know why, might be something to do with inherited constructors or similar. Python? C#? I'm pretty sure it's some sort of super() thing, but I don't know what language.

hector13

  • Bay Watcher
  • It’s shite being Scottish
    • View Profile
Re: Things that made you go "WTF?" today o_O
« Reply #134899 on: June 18, 2018, 02:23:41 pm »

How did the actress do? I like her a lot from her work here in Sweden. Hoping she might get established internationally.

She sounded English, so alright I guess. It’s apparently quite difficult for me to consider the acting when the writing is awful.
Logged
Look, we need to raise a psychopath who will murder God, we have no time to be spending on cooking.

If you struggle with your mental health, please seek help.

Reelya

  • Bay Watcher
    • View Profile
Re: Things that made you go "WTF?" today o_O
« Reply #134900 on: June 18, 2018, 02:32:30 pm »

All I know is whoever wins a trade war, Australia loses.
But at the same time, killing our mining industry would be a roughshod way to encourage some sustainability.

Kind of like how China refusing to import our recycling rubbish anymore has encouraged Australia to try and cut down on the actual production of the rubbish in the first place.

Il Palazzo

  • Bay Watcher
  • And lo, the Dude did abide. And it was good.
    • View Profile
Re: Things that made you go "WTF?" today o_O
« Reply #134901 on: June 18, 2018, 02:49:23 pm »

How did the actress do? I like her a lot from her work here in Sweden. Hoping she might get established internationally.
Vikander, you mean? She's been playing in critically acclaimed English-speaking films for years now. Ex Machina, Testament of Youth, The Danish girl (won an Oscar), and more. All great performances. She might have lacked major blockbuster exposure until TR, but I'd say she's pretty firmly established as the new hot talent on the movie market.
Logged

Kagus

  • Bay Watcher
  • Olive oil. Don't you?
    • View Profile
Re: Things that made you go "WTF?" today o_O
« Reply #134902 on: June 18, 2018, 03:20:41 pm »

Code: [Select]
. = ..()This is what pops to mind whenever I hear about incomprehensible code.
WTF programming language is that?  :o

(EDIT: a LISP-like? I'm sadly not that familiar with those... although I think LISP needs more parentheses...?)

It's BYOND's special ("special") own programming language, Dream Maker. It's supposed to be something that non-coders can pick up and make games with, due to its "ease of use" and "readability".

Fucking hah. And that's not a define, those are two hardcoded functions in the language.

Egan_BW

  • Bay Watcher
    • View Profile
Re: Things that made you go "WTF?" today o_O
« Reply #134903 on: June 18, 2018, 04:56:13 pm »

robust
Logged
I would starve tomorrow if I could eat the world today.

scriver

  • Bay Watcher
  • City streets ain't got much pity
    • View Profile
Re: Things that made you go "WTF?" today o_O
« Reply #134904 on: June 18, 2018, 06:51:25 pm »

How did the actress do? I like her a lot from her work here in Sweden. Hoping she might get established internationally.
Vikander, you mean? She's been playing in critically acclaimed English-speaking films for years now. Ex Machina, Testament of Youth, The Danish girl (won an Oscar), and more. All great performances. She might have lacked major blockbuster exposure until TR, but I'd say she's pretty firmly established as the new hot talent on the movie market.

Huh. Looking at her IMDB page you seem to be right. I had no idea she had done anything other than the Danish Girl, and I thought that that was a Danish movie anyway.
Logged
Love, scriver~

Kagus

  • Bay Watcher
  • Olive oil. Don't you?
    • View Profile
Re: Things that made you go "WTF?" today o_O
« Reply #134905 on: June 18, 2018, 07:27:50 pm »

robust
Much like toolbox-wielding assistants.
Code: [Select]
/obj/item/extinguisher/attack_obj(obj/O, mob/living/user)
if(AttemptRefill(O, user))
refilling = TRUE
return FALSE
else
return ..()
Fucking what

As an aside, "return" can be (and most commonly is) used without values, like so:
Code: [Select]
if(refilling)
refilling = FALSE
return

It can also have a numerical value:
Code: [Select]
safety = safety_save
return 1
else
return 0

All these examples are from the same file.

Reelya

  • Bay Watcher
    • View Profile
Re: Things that made you go "WTF?" today o_O
« Reply #134906 on: June 18, 2018, 07:48:20 pm »

All of that is standard. A void function in c/c++ can have a return with no value, because you need a way to leave the function, but having a value would cause a compile error, since the function has no return type.

Similarly, the part with 1 or 0 could be in a function that returns a numeric, and FALSE could be part of a function that returns a BOOL. Just because they're in the same file means nothing. If the programmer is using numeric 0 and 1 in one place, and TRUE/FALSE macros in another place, that's not the language's fault, it's just the standard range of options that most languages provide.

Where ..() comes in is that it's a call to the parent behaviour. For example, you could have a FireSword, and you call an "Attack" command on it, which does some fire damage, but then passes the call to ..(), which then calls the Attack command of the parent type, Sword, doing slash damage. Then, Sword calls ..() again, which activates the Attack function in its own parent-class Weapon, which then handles any book-keeping that occurs on all Attack actions. And you'd have a similar nest of calls when you attack with an item such as a "Frosthammer". It's actually pretty neat btw, since it's common to do calls like this in e.g. C++ but in C++ there's no special command to infer the parent class and parent method to call, both must be explicitly referenced. ..() is pretty neat actually.

So, when the above code does an action then returns FALSE if a certain condition is met, but returns ..() otherwise, what that's saying is to do the item's special action, and return a BOOL value, but if it can't do the action, then call the generic action of the parent type of that object, and return a value from that (which would be TRUE or FALSE).
« Last Edit: June 18, 2018, 08:33:16 pm by Reelya »
Logged

KittyTac

  • Bay Watcher
  • Impending Catsplosion. [PREFSTRING:aloofness]
    • View Profile
Re: Things that made you go "WTF?" today o_O
« Reply #134907 on: June 18, 2018, 09:29:12 pm »

That killed my desire to code for SS13.
Logged
Don't trust this toaster that much, it could be a villain in disguise.
Mostly phone-posting, sorry for any typos or autocorrect hijinks.

hector13

  • Bay Watcher
  • It’s shite being Scottish
    • View Profile
Re: Things that made you go "WTF?" today o_O
« Reply #134908 on: June 18, 2018, 09:31:19 pm »

The Swedish military confused a herring defense mechanism for Soviet submarines.
Logged
Look, we need to raise a psychopath who will murder God, we have no time to be spending on cooking.

If you struggle with your mental health, please seek help.

Trekkin

  • Bay Watcher
    • View Profile
Re: Things that made you go "WTF?" today o_O
« Reply #134909 on: June 18, 2018, 09:46:09 pm »

The Swedish military confused a herring defense mechanism for Soviet submarines.

A classic Red Herring problem.
Logged
Pages: 1 ... 8992 8993 [8994] 8995 8996 ... 11062