Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

OddObserver posted:

I can appreciate the buttons compared to trying to deal with keyboard events (which historically belonged in this thread).

Why use one <input> when 26 will do!

Adbot
ADBOT LOVES YOU

Polio Vax Scene
Apr 5, 2009



make me draw the letter i want to guess on a canvas

Presto
Nov 22, 2002

Keep calm and Harry on.
Exuberant Cowboy sounds like a name from a bad cyberpunk novel.

"Greetings, electron-slingers, I am called the Exuberant Cowboy."

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


https://twitter.com/thatfrood/status/1711479173049385282

Doc Hawkins
Jun 15, 2010

Dashing? But I'm not even moving!


Tann posted:

Just found you can do something like sql injection in my game lol

I let you rename heroes between fights and it all uses my weird modding thing. If you rename them to eg "jenny.hp.500" then they gain the name "jenny" and 500hp.

little jenny hitpoints

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

Genuinely blessed

Hammerite
Mar 9, 2007

And you don't remember what I said here, either, but it was pompous and stupid.
Jade Ear Joe
The Cavern of COBOL > Coding Horrors: You are now trapped forever in the COWBOY GRAVEYARD

smackfu
Jun 7, 2004


Ironically, Finnish seems like a difficult language for mobile phone display.

Mind_Taker
May 7, 2007



code:
public dynamic function(dynamic data) {
    int id = (int)(data.id);

....

    return some_string;
}
Stuff like this is everywhere in the codebase I'm reviewing for the job I just started.

Bruegels Fuckbooks
Sep 14, 2004

Now, listen - I know the two of you are very different from each other in a lot of ways, but you have to understand that as far as Grandpa's concerned, you're both pieces of shit! Yeah. I can prove it mathematically.

Mind_Taker posted:

code:
public dynamic function(dynamic data) {
    int id = (int)(data.id);

....

    return some_string;
}
Stuff like this is everywhere in the codebase I'm reviewing for the job I just started.

this is what code from programmers who "don't like to be tied down to types" actually looks like in the wild. dynamic and the expandoobject have enabled some really bad c# code.

Ihmemies
Oct 6, 2012

In our Java project it is annoying enough when people don’t clearly define their types. I have to fix their all raw types/classes etc. Very annoying.. it isn’t that hard guys!

NtotheTC
Dec 31, 2007


Mind_Taker posted:

code:
public dynamic function(dynamic data) {
    int id = (int)(data.id);

....

    return some_string;
}
Stuff like this is everywhere in the codebase I'm reviewing for the job I just started.

one day that function might need to check another data attribute and you're going to look sooooooo stupid adding it in

more falafel please
Feb 26, 2005

forums poster

I'm glad that in the modern C++ codebases I've had exposure to, auto and decltype are only really ever used either idiomatically (no need to specify what the type of container.begin() is) or to simplify when you're already specifying the type one or more times in the declaration.

raminasi
Jan 25, 2005

a last drink with no ice

Mind_Taker posted:

code:
public dynamic function(dynamic data) {
    int id = (int)(data.id);

....

    return some_string;
}
Stuff like this is everywhere in the codebase I'm reviewing for the job I just started.

Is it doing some weird interop thing?

biznatchio
Mar 31, 2001


Buglord

raminasi posted:

Is it doing some weird interop thing?

Yes, interop between bad developers and a compiler that wants them to be good.

Rottbott
Jul 27, 2006
DMC

more falafel please posted:

I'm glad that in the modern C++ codebases I've had exposure to, auto and decltype are only really ever used either idiomatically (no need to specify what the type of container.begin() is) or to simplify when you're already specifying the type one or more times in the declaration.
Auto is never as bad as this anyway, because the variable still has a type, and your IDE can tell you what it is.

Xarn
Jun 26, 2015
dynamic is this thing that has like 2 tiiiiiny niches where it is useful, but then people use it elsewhere and you want to first break their hands and then take it out of the language.

Surprise T Rex
Apr 9, 2008

Dinosaur Gum
Death to the ViewBag.

Sagacity
May 2, 2003
Hopefully my epitaph will be funnier than my custom title.

Surprise T Rex posted:

Death to the ViewBag.
But enough about your mom

more falafel please
Feb 26, 2005

forums poster

Rottbott posted:

Auto is never as bad as this anyway, because the variable still has a type, and your IDE can tell you what it is.

It can still bite you in the rear end if you change, say, the return type of a function that's initializing an auto. Harder to do, but still doable.

Presto
Nov 22, 2002

Keep calm and Harry on.
My use of 'auto' has shrunk to three cases.

1. Declaring iterators, especially for complex types, because the type names get really long and I'm far too lazy to type that crap.

2. Declaring variables that are initialized with the result of a cast, because the type is obvious because it's right there in the cast.

3. Structured bindings, because they are sexy and I love them.

The rest of the time I'd rather see the actual type.

Zopotantor
Feb 24, 2013

...und ist er drin dann lassen wir ihn niemals wieder raus...

Presto posted:

My use of 'auto' has shrunk to three cases.

1. Declaring iterators, especially for complex types, because the type names get really long and I'm far too lazy to type that crap.

2. Declaring variables that are initialized with the result of a cast, because the type is obvious because it's right there in the cast.

3. Structured bindings, because they are sexy and I love them.

The rest of the time I'd rather see the actual type.

Your item 2 is close to the "almost always auto" idea, which advocates that declarations like
code:
auto fart = Fart(42);
should be preferred to
code:
Fart fart = 42;
The "dynamic" example led me to imagine an alternative "almost always any" style, which would be utter insanity.

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed

more falafel please posted:

It can still bite you in the rear end if you change, say, the return type of a function that's initializing an auto. Harder to do, but still doable.

That is usually an advantage of auto.

Rottbott
Jul 27, 2006
DMC

Presto posted:

My use of 'auto' has shrunk to three cases.

1. Declaring iterators, especially for complex types, because the type names get really long and I'm far too lazy to type that crap.

2. Declaring variables that are initialized with the result of a cast, because the type is obvious because it's right there in the cast.

3. Structured bindings, because they are sexy and I love them.

The rest of the time I'd rather see the actual type.
I use it in templates too, because it can make the code a lot more readable and if you wrote out all the types, you still wouldn't really know what it was from reading it.

I also use it in non-generic code where I don't 'care' what the type is. This is harder to define and is no doubt a horror to some of you. For instance, let's say some library gives me a handle, and I don't care what it is except that I need it to make other calls to that library - I'm likely to use auto. Makes no difference to me if the handle is actually an int, an alias for an int, a pointer, or some opaque type.

Zopotantor posted:

code:
auto fart = Fart(42);
This is gross though. Turning back to C#, I'm so glad it got 'Fart fart = new();' so we no longer have to have this argument with var-dislikers.

RPATDO_LAMD
Mar 22, 2013

🐘🪠🍆
It looks pretty stupid for 1-argument constructors like that where you can just use "Fart fart = 42" but it can be nice to cut down repetition for multi-arg constructors where you actually do have to type out the constructor name

for example if I want to make a vector with 10 pre-initialized objects:
C++ code:
std::vector<MyAnnoyinglyLongCustomTemplateClass<Foo>> foos = std::vector<MyAnnoyinglyLongCustomTemplateClass<Foo>>(MyAnnoyinglyLongCustomTemplateClass<Foo>(someDefaultValue), 10);
// versus this which sucks a little bit less:
auto foos = std::vector<MyAnnoyinglyLongCustomTemplateClass<Foo>>(MyAnnoyinglyLongCustomTemplateClass<Foo>(someDefaultValue), 10);

Jabor
Jul 16, 2010

#1 Loser at SpaceChem
There's an upside to making all your constructor calls look the same, instead of using different syntax for 1-arg constructors just because you're allowed to.

Foxfire_
Nov 8, 2010

I think there's a better argument that every one argument constructor should be marked explicit and not be participating in implicit conversions unless you're absolutely sure you want that

more falafel please
Feb 26, 2005

forums poster

Foxfire_ posted:

I think there's a better argument that every one argument constructor should be marked explicit and not be participating in implicit conversions unless you're absolutely sure you want that

Agreed.

This post brought to you by the time we found a bug caused by a library-internal array type (havok's hkArray) being initialized with an engine-internal bool type (UE3's UBOOL, which was typedef'd to signed int).

Ranzear
Jul 25, 2013



https://mastodon.gamedev.place/@badlogic/111246798083590676

Ranzear fucked around with this message at 03:39 on Oct 17, 2023

RPATDO_LAMD
Mar 22, 2013

🐘🪠🍆
is the horror that public posts on a social media website are visible on its public api?

surely even if they required that the api consumer have a "bsky invite code" during the closed beta period it would make no difference, that data is out there anyway. if someone wanted to scrape stuff they could finagle a code from somewhere

Ranzear
Jul 25, 2013

There's supposed to be a 'private' account setting. This ignores it.

Blocks are public this way too. Shouldn't be. When they say everything is visible to the public API, they mean everything. Having an account plugged into the API gives less access than public.

Bonus horror: Resizing images on Android, followed immediately by resizing images on imgur itself.

Ranzear fucked around with this message at 03:35 on Oct 17, 2023

Dylan16807
May 12, 2010

Ranzear posted:

There's supposed to be a 'private' account setting. This ignores it.
Where did you hear that?

https://blueskyweb.xyz/blog/5-19-2023-user-faq

quote:

Can I set my profile to be private?

Currently, there are no private profiles on Bluesky.

That page also says blocks are public, though I suppose not every user might know that.

Mutes are private.

Toshimo
Aug 23, 2012

He's outta line...

But he's right!

Dylan16807 posted:

Where did you hear that?

https://blueskyweb.xyz/blog/5-19-2023-user-faq

That page also says blocks are public, though I suppose not every user might know that.

Mutes are private.

That certainly seems like a bunch of stuff that would make me never want to use their service.

Ranzear
Jul 25, 2013

Dylan16807 posted:

Where did you hear that?

Extrapolated from elsewhere, unfortunately. Silly me and my expectations.

I could have just gestured at bluesky in general, lack of DMs, post tagging of any form (topical nor content warning beyond three things), video or even loving animated GIF support even after four years, but likes and blocks being public is just way too much stalking and harassment potential to even dip a toe into now.

Hammerite
Mar 9, 2007

And you don't remember what I said here, either, but it was pompous and stupid.
Jade Ear Joe

RPATDO_LAMD posted:

It looks pretty stupid for 1-argument constructors like that where you can just use "Fart fart = 42" but it can be nice to cut down repetition for multi-arg constructors where you actually do have to type out the constructor name

for example if I want to make a vector with 10 pre-initialized objects:
C++ code:
std::vector<MyAnnoyinglyLongCustomTemplateClass<Foo>> foos = std::vector<MyAnnoyinglyLongCustomTemplateClass<Foo>>(MyAnnoyinglyLongCustomTemplateClass<Foo>(someDefaultValue), 10);
// versus this which sucks a little bit less:
auto foos = std::vector<MyAnnoyinglyLongCustomTemplateClass<Foo>>(MyAnnoyinglyLongCustomTemplateClass<Foo>(someDefaultValue), 10);

can't you just use typedef to make it short?

typedef MyThing MyAnnoyinglyLongCustomTemplateClass<Foo>; // whichever way around it is, idc
std::vector<MyThing> foos = std::vector<MyThing>(MyThing(someDefaultValue, 10);

C# has the equivalent of typedef but you can only apply it at file scope, which is a bit poo poo because I don't see why they couldn't let you do it locally. They introduced local functions several versions ago.

Rottbott
Jul 27, 2006
DMC

RPATDO_LAMD posted:

It looks pretty stupid for 1-argument constructors like that where you can just use "Fart fart = 42" but it can be nice to cut down repetition for multi-arg constructors where you actually do have to type out the constructor name

for example if I want to make a vector with 10 pre-initialized objects:
C++ code:
std::vector<MyAnnoyinglyLongCustomTemplateClass<Foo>> foos = std::vector<MyAnnoyinglyLongCustomTemplateClass<Foo>>(MyAnnoyinglyLongCustomTemplateClass<Foo>(someDefaultValue), 10);
// versus this which sucks a little bit less:
auto foos = std::vector<MyAnnoyinglyLongCustomTemplateClass<Foo>>(MyAnnoyinglyLongCustomTemplateClass<Foo>(someDefaultValue), 10);

Wouldn't you do this?
C++ code:
std::vector<MyAnnoyinglyLongCustomTemplateClass<Foo>> foos { MyAnnoyinglyLongCustomTemplateClass<Foo>(someDefaultValue), 10 };

Beef
Jul 26, 2004
Galaxy brain: #define T ...

Ihmemies
Oct 6, 2012

So our software creates charts. Data requests are asynchronous and they return data with metadata to which chart they belong to. If data requests fail, they return no data, only an exception.

So I am now coding a system to run a Service, which runs a Task of periodically checking a list of pending chart requests. If a chart is not generated after n seconds, the task assumes the data requests failed and we did not get the data to create the chart.

It compares timestamps of now and the moment a chart creation request was issued, so it can understand how “old” each chartgen request is.

I asked that would it be possible for the datamanager to return some kind of useful metadata, even within the exception? I was shot down so I am now coding this stupid rear end garbage collection service.

I guess that after enough cases like this it is how spaghetti monster and coding horrors are eventually born..

Blue Footed Booby
Oct 4, 2006

got those happy feet

Ranzear posted:

Extrapolated from elsewhere, unfortunately. Silly me and my expectations.

I could have just gestured at bluesky in general, lack of DMs, post tagging of any form (topical nor content warning beyond three things), video or even loving animated GIF support even after four years, but likes and blocks being public is just way too much stalking and harassment potential to even dip a toe into now.

Aren't likes public on Twitter?

Adbot
ADBOT LOVES YOU

repiv
Aug 13, 2009

usually yes, but one of the recently added perks for paying users is the ability to hide your likes

i don't know why you'd hide your likes rather than using bookmarks that are always private

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply