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
AnimeIsTrash
Jun 30, 2018

:cripes:

Adbot
ADBOT LOVES YOU

AnimeIsTrash
Jun 30, 2018

greg my brother i am no longer going to review any code for you

Archduke Frantz Fanon
Sep 7, 2004

good for them

Deep Dish Fuckfest
Sep 6, 2006

Advanced
Computer Touching


Toilet Rascal
we talking pre or post c++11 here?

AnimeIsTrash
Jun 30, 2018

Deep Dish Fuckfest posted:

we talking pre or post c++11 here?

post, but regardless its going to make code so much harder to read lol

Deep Dish Fuckfest
Sep 6, 2006

Advanced
Computer Touching


Toilet Rascal
if that's anywhere near the hardest thing to figure out with whatever c++ codebase you're working with then consider yourself lucky

FUCK SNEEP
Apr 21, 2007




auto is good because it lets me pretend c++ is a better language like python

Captain Foo
May 11, 2004

we vibin'
we slidin'
we breathin'
we dyin'

you auto use a better language

Dijkstracula
Mar 18, 2003

You can't spell 'vector field' without me, Professor!

when I worked at the fruitstand, my team’s style guide mandated ‘auto’ for all declarations except ‘int’; using it for ‘bool’ was optional

AnimeIsTrash
Jun 30, 2018

Deep Dish Fuckfest posted:

if that's anywhere near the hardest thing to figure out with whatever c++ codebase you're working with then consider yourself lucky

oh there is tons of problems, just was riffing since this is going to make code even more unreadable lol

AnimeIsTrash
Jun 30, 2018

Captain Foo posted:

you auto use a better language

we have a much better devleoped and documented framework in java but there is exactly 1 team in europe somewhere that refuses to move and we still have to support it lol

akadajet
Sep 14, 2003

Why on earth would you not use implicit type declarations if your language supports them? At least in C# it makes code a lot more readable.

akadajet
Sep 14, 2003

Dijkstracula
Mar 18, 2003

You can't spell 'vector field' without me, Professor!

akadajet posted:

Why on earth would you not use implicit type declarations if your language supports them? At least in C# it makes code a lot more readable.

in general I agree, but the downside of type inference is that it puts a burden on compiler error messages to succinctly tell developers why and where inference has failed, and, well, C++ error reporting etc etc

Best Bi Geek Squid
Mar 25, 2016

Captain Foo posted:

you auto use a better language

InternetOfTwinks
Apr 2, 2011

Coming out of my cage and I've been doing just bad
I find explicit type declarations more clear a lot of the time but really it depends on what the thing is doing imo.

echinopsis
Apr 13, 2004

by Fluffdaddy
does auto make types like in js? coz I love having my
code feel like it has all the stability of a tomato plant without any sticks holding it up

mobby_6kl
Aug 9, 2009

by Fluffdaddy

AnimeIsTrash posted:

we have a much better devleoped and documented framework in java but there is exactly 1 team in europe somewhere that refuses to move and we still have to support it lol

they're smarter than you apparently

AnimeIsTrash
Jun 30, 2018

the maojrity of people on this planet are smartter than me OP

matti
Mar 31, 2019

i dont belive that

akadajet
Sep 14, 2003

echinopsis posted:

does auto make types like in js? coz I love having my
code feel like it has all the stability of a tomato plant without any sticks holding it up

no. it just means the compiler infers the type based on context. javascript figures out types and poo poo at runtime

Sweevo
Nov 8, 2007

i sometimes throw cables away

i mean straight into the bin without spending 10+ years in the box of might-come-in-handy-someday first

im a fucking monster

this is what happens when you have a generation of programmers raised on javascript and p-lang toy bullshit

Deep Dish Fuckfest
Sep 6, 2006

Advanced
Computer Touching


Toilet Rascal

echinopsis posted:

does auto make types like in js? coz I love having my
code feel like it has all the stability of a tomato plant without any sticks holding it up

no it doesn't and thank loving god for it. the compiler has to be able to figure out the type at compile time for it to work

we are, of course, talking about auto when used as placeholder for a local variable type here, because in true c++ fashion every keyword needs to have as many different meaning as possible in different context (though thankfully all of them still require the type to be deducible at compile time). we're not talking about auto used as, say, a function parameter type as is now allowed in c++20. possibly with concepts acting as constraints. or as part of decltype(auto) and its delightfully obvious meaning. or its effect of transforming a normal god-fearing r-value reference into a universal reference of loose morals when replacing a concrete type in a variable definition. or the type of firearm best suited to ending my suffering

Best Bi Geek Squid
Mar 25, 2016
auto was also the bus driver in the Simpsons

echinopsis
Apr 13, 2004

by Fluffdaddy

Deep Dish Fuckfest posted:

no it doesn't and thank loving god for it. the compiler has to be able to figure out the type at compile time for it to work

we are, of course, talking about auto when used as placeholder for a local variable type here, because in true c++ fashion every keyword needs to have as many different meaning as possible in different context (though thankfully all of them still require the type to be deducible at compile time). we're not talking about auto used as, say, a function parameter type as is now allowed in c++20. possibly with concepts acting as constraints. or as part of decltype(auto) and its delightfully obvious meaning. or its effect of transforming a normal god-fearing r-value reference into a universal reference of loose morals when replacing a concrete type in a variable definition. or the type of firearm best suited to ending my suffering

this post is a fuckfest

The Management
Jan 2, 2010

sup, bitch?

Sweevo posted:

this is what happens when you have a generation of programmers raised on javascript and p-lang toy bullshit

The Management
Jan 2, 2010

sup, bitch?
auto is just telling the reader to gently caress off because you don’t care if they understand the context

Best Bi Geek Squid
Mar 25, 2016
declaring my variables like “auto fellatio = 0;”

Deep Dish Fuckfest
Sep 6, 2006

Advanced
Computer Touching


Toilet Rascal

echinopsis posted:

this post is a fuckfest

wish that were true for my actual life

Glorgnole
Oct 23, 2012

auto's not a big deal IMO... whenever you create a variable you're always writing it out like

code:
auto some_butt = std::make_shared<const Butt>();
and the type's just right there on the same line

echinopsis
Apr 13, 2004

by Fluffdaddy
sounds like a good way to reduce cognitive load imo

akadajet
Sep 14, 2003

echinopsis posted:

sounds like a good way to reduce cognitive load imo

yeah, especially when your libraries are built on the house of cards that is c++ templates.

Lime
Jul 20, 2004

just mouse over the auto

The Management
Jan 2, 2010

sup, bitch?

Glorgnole posted:

auto's not a big deal IMO... whenever you create a variable you're always writing it out like

code:
auto some_butt = std::make_shared<const Butt>();
and the type's just right there on the same line

the main reason to use auto is because

code:
 

auto some_butt = FrobuleCreatorFactoryDefecator();
// returns 
// ButtDB::intrusive_shared_ptr_reference<Frobule::Engine::ButtInstance<Poop, ButtTraits>>
returns a type that is too long to write.

rotor
Jun 11, 2001

classic case of pineapple derangement syndrome
people bitch about java being too wordy but goddamn

akadajet
Sep 14, 2003

rotor posted:

people bitch about java being too wordy but goddamn

it's nested templates and namespaces all the way down

Ciaphas
Nov 20, 2005

> BEWARE, COWARD :ovr:


i refuse to learn about anything after c++98

Deep Dish Fuckfest
Sep 6, 2006

Advanced
Computer Touching


Toilet Rascal

akadajet posted:

yeah, especially when your libraries are built on the house of cards that is c++ templates.

it's not a house of cards! it's a conceptual blueprint that contains latent house-like structures which can potentially be built from cards!

or from reinforced concrete

or from drywall

rotor
Jun 11, 2001

classic case of pineapple derangement syndrome
I looked at the Boost Graph Library once and it was like staring into the sun

Adbot
ADBOT LOVES YOU

rotor
Jun 11, 2001

classic case of pineapple derangement syndrome
i was like "the loving thing is all header files, where is the code??"

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