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.
 
  • Locked thread
Condiv
May 7, 2008

Sorry to undo the effort of paying a domestic abuser $10 to own this poster, but I am going to lose my dang mind if I keep seeing multiple posters who appear to be Baloogan.

With love,
a mod


crazysim posted:

So how many things depend on it and is there anything important going up?

only one thing, but the is-number module has this many dependents

algebra, promised-http-server, babel-generator, @divmain/babel-generator, is-positive-integer, unicode-byte-truncate, image-js, db-schema-validator, flint-babel-core, babelfmt, idb-schema, @eins78/pixelstatus, babel-fast-react-core, babel-core-flint, from-family, sanitize-cep, round-precision, index-to-word, parse-int, is-valid-month, rpgparameter, mu-babel, opc, bacon-theory

i'm the bacon-theory

Adbot
ADBOT LOVES YOU

30 TO 50 FERAL HOG
Mar 2, 2005



uncurable mlady posted:

var is weirdly divisive, I don't think I've ever heard a good argument against it though. it makes things so much more readable and clean

C# is not JavaScript, vb, or php. If you know what type you need declare it as that type. The idea that a generic keyword with type determined at execution makes things more readable is literally the opposite of the truth.

If you've got some Linq returning an ienumerable then yeah use var, whatever but if you're declaring everything under the sun as var maybe you should go back to writing excel vba

Condiv
May 7, 2008

Sorry to undo the effort of paying a domestic abuser $10 to own this poster, but I am going to lose my dang mind if I keep seeing multiple posters who appear to be Baloogan.

With love,
a mod


BiohazrD posted:

C# is not JavaScript, vb, or php. If you know what type you need declare it as that type. The idea that a generic keyword with type determined at execution makes things more readable is literally the opposite of the truth.

If you've got some Linq returning an ienumerable then yeah use var, whatever but if you're declaring everything under the sun as var maybe you should go back to writing excel vba

lol, the type isn't determined at execution it's determined at compile time

laffo at someone who apparently knows c# but doesn't know that type inference != dynamic typing

kitten emergency
Jan 13, 2008

get meow this wack-ass crystal prison

Condiv posted:

lol, the type isn't determined at execution it's determined at compile time

laffo at someone who apparently knows c# but doesn't know that type inference != dynamic typing

i was gonna basically post this, so... yeah... man, i'm a loving idiot but even i understand the difference between var and dynamic or w/e

brap
Aug 23, 2004

Grimey Drawer

BiohazrD posted:

C# is not JavaScript, vb, or php. If you know what type you need declare it as that type. The idea that a generic keyword with type determined at execution makes things more readable is literally the opposite of the truth.

If you've got some Linq returning an ienumerable then yeah use var, whatever but if you're declaring everything under the sun as var maybe you should go back to writing excel vba

:ramsay:

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

Condiv posted:

only one thing, but the is-number module has this many dependents

algebra, promised-http-server, babel-generator, @divmain/babel-generator, is-positive-integer, unicode-byte-truncate, image-js, db-schema-validator, flint-babel-core, babelfmt, idb-schema, @eins78/pixelstatus, babel-fast-react-core, babel-core-flint, from-family, sanitize-cep, round-precision, index-to-word, parse-int, is-valid-month, rpgparameter, mu-babel, opc, bacon-theory

i'm the bacon-theory

npm is cool

cowboy beepboop
Feb 24, 2001

npm is so bad. javascript is bad too.

30 TO 50 FERAL HOG
Mar 2, 2005



Condiv posted:

lol, the type isn't determined at execution it's determined at compile time

laffo at someone who apparently knows c# but doesn't know that type inference != dynamic typing

yeah whatever I'm dumb and or gay

CRIP EATIN BREAD
Jun 24, 2002

Hey stop worrying bout my acting bitch, and worry about your WACK ass music. In the mean time... Eat a hot bowl of Dicks! Ice T



Soiled Meat
speaking of npm look at this whiny baby:

https://medium.com/@azerbike/i-ve-just-liberated-my-modules-9045c06be67c#.p1nevaqs8

VikingofRock
Aug 24, 2008




I dunno, if I lost ownership of my package over a bullshit copyright claim I'd be pretty pissed too. It's hard for me to get too mad at the guy over wanting to burn it all down.

MeruFM
Jul 27, 2010
yeah i sympathize with the guy
also it's just breaking builds, not production

Illusive Fuck Man
Jul 5, 2004
RIP John McCain feel better xoxo 💋 🙏
Taco Defender
IMO explicitly writing types is good and using var/auto is bad, except when the type is redundant like
std::unique_ptr<FlushableToilet> toilet = std::make_unique<FlushableToilet>(pisswater)

or just verbose like a iterator from a vector of pairs of whatever.

just because the line is shorter using auto doesn't mean it's more readable. types are useful information to know when reading code.

its me, the guy who cares too much about var.

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer

Illusive gently caress Man posted:

IMO explicitly writing types is good and using var/auto is bad, except when the type is redundant like
std::unique_ptr<FlushableToilet> toilet = std::make_unique<FlushableToilet>(pisswater)

or just verbose like a iterator from a vector of pairs of whatever.

just because the line is shorter using auto doesn't mean it's more readable. types are useful information to know when reading code.

its me, the guy who cares too much about var.

this is exactly what var is for though? the proper use of var is to condense a repeated type declaration:

code:
//long dumb way

HashMap<String,Long> myMap = New HashMap<String,Long>();

//same ting but half the crap

var myMap = New HashMap<String,Long>();
there are still things where you should declare your type and var isn't useful but a good dev should recognize them. like, if you're writing an api where you just need anything that is a list and implements list's public api and you don't care what the underlying implementation is, you should absolutely do

code:

List<Foo> myList = functionThatReturnsSomeList()

i don't know anybody that would use var in the latter case, though i'm willing to bet someone at my company did at some point since var is explicitly banned in our style guide alongside linq. basically everything good about c# is banned, lol.

Illusive Fuck Man
Jul 5, 2004
RIP John McCain feel better xoxo 💋 🙏
Taco Defender
o I thought people were advocating declaring literally everything using var

crazysim
May 23, 2004
I AM SOOOOO GAY

Condiv posted:

only one thing, but the is-number module has this many dependents

algebra, promised-http-server, babel-generator, @divmain/babel-generator, is-positive-integer, unicode-byte-truncate, image-js, db-schema-validator, flint-babel-core, babelfmt, idb-schema, @eins78/pixelstatus, babel-fast-react-core, babel-core-flint, from-family, sanitize-cep, round-precision, index-to-word, parse-int, is-valid-month, rpgparameter, mu-babel, opc, bacon-theory

i'm the bacon-theory

is that a depth of one or exhaustive?

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
at the minimum use var/auto when the type appears on the rhs, because repeating the type is dumb

using var always has the advantage of that it calls out the places where the type you're explicitly declaring isn't the type of the rhs. this isn't terribly useful in c# because it has fairly minimal implicit conversions, but in c++ where implicit conversions are the default for historical reasons it's quite nice to know at a glance that something is actually just a variable declaration and not converting the result of a function call into the declared type. whether or not this explicitness is worth not declaring types even where they aren't totally obvious is debatable

just definitely don't go somewhere in between the two extremes because that's the worst of both worlds

HoboMan
Nov 4, 2010

Illusive gently caress Man posted:

o I thought people were advocating declaring literally everything using var

me too.

but really if you know the type why not just type (see what i did there?) it out? (you lazy rear end in a top hat)

HoboMan fucked around with this message at 05:56 on Mar 23, 2016

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer

HoboMan posted:

me too.

but really if you know the type why not just type (see what i did there?) it out? (you lazy rear end in a top hat)

because there are things in some codebases like PortableInstrumentedSortableHashMap2<K,V> and i dont want to type that poo poo out twice.

same reason we always use i as the index for an outer loop. cuz it's faster and conventions are good.

HoboMan
Nov 4, 2010

LeftistMuslimObama posted:

because there are things in some codebases like PortableInstrumentedSortableHashMap2<K,V> and i dont want to type that poo poo out twice.

same reason we always use i as the index for an outer loop. cuz it's faster and conventions are good.

but you see copy-paste exists

e: PortableInstrumentedSortableHashMap2<K,V> PortableInstrumentedSortableHashMap2<K,V> PortableInstrumentedSortableHashMap2<K,V> PortableInstrumentedSortableHashMap2<K,V> PortableInstrumentedSortableHashMap2<K,V> PortableInstrumentedSortableHashMap2<K,V>

Deep Dish Fuckfest
Sep 6, 2006

Advanced
Computer Touching


Toilet Rascal

Plorkyeran posted:

at the minimum use var/auto when the type appears on the rhs, because repeating the type is dumb

using var always has the advantage of that it calls out the places where the type you're explicitly declaring isn't the type of the rhs. this isn't terribly useful in c# because it has fairly minimal implicit conversions, but in c++ where implicit conversions are the default for historical reasons it's quite nice to know at a glance that something is actually just a variable declaration and not converting the result of a function call into the declared type. whether or not this explicitness is worth not declaring types even where they aren't totally obvious is debatable

just definitely don't go somewhere in between the two extremes because that's the worst of both worlds

this is pretty much the correct opinion as far as c++ is concerned

though it's pretty funny when you get people who don't like auto because "it doesn't make types as clear" or something like that, who then proceed to cast poo poo left and right and just generally take a huge dump on the type system

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer
i miss c. so fun to
code:
(char *)&array+=bytesToJump.
you feel like a wizard once you know how to go anywhere you want in memory

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope

Finster Dexter posted:

e: I love that feeling though, of closing down like 20 browser tabs of google searches and stackoverflow questions. Feel like my day can finally begin :wtc:

my favorite feeling is spending 2 days on a problem trying all kinds of poo poo, and then i make a 5-line commit that fixes the issue.

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope

crazysim posted:

is that a depth of one or exhaustive?

i remember something something maximum flow minimum cut graph theory thing.

find the package that would break the most poo poo.

make a copyright claim on it.

except it's probably jquery or something where it wouldn't work.

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope

Wheany posted:

i remember something something maximum flow minimum cut graph theory thing.

except that doesn't really apply now does it.

well, i guess that's the reason i'm posting itt

cowboy beepboop
Feb 24, 2001

Wheany posted:

my favorite feeling is spending 2 days on a problem trying all kinds of poo poo, and then i make a 5-line commit that fixes the issue.

also the lazy commit message after 2 days of debugging and troubleshooting

"FQR-420 fixed bug; added test"

gonadic io
Feb 16, 2011

>>=

Illusive gently caress Man posted:

o I thought people were advocating declaring literally everything using var

i do this except when the compiler can't figure out the type

VikingofRock
Aug 24, 2008




Wheany posted:

my favorite feeling is spending 2 days on a problem trying all kinds of poo poo, and then i make a 5-line commit that fixes the issue.

I just did this with a bug in the Rust compiler; it felt awesome.

qntm
Jun 17, 2009

MononcQc posted:

Found the guy: https://www.npmjs.com/~jonschlinkert

E: other worthwhile contributions include packages such as:

git-repo-name - v0.5.1 - Get the repository name from the git remote origin URL.
git-user-email - v0.2.1 - Get the email address of the current user from git config.
git-username - v0.4.0 - Get the username from a git remote origin URL.
git-user-name - v1.2.0 - Get a user's name from git config at the project or global scope, depending on what git uses in the current context.
is-even - v0.1.1 - Return true if the given number is even.
is-false - v0.1.1 - Returns false if the value of a property is either strictly false, or it's inverse is strictly true.
is-number - v2.1.0 - Returns true if the value is a number. comprehensive tests.
is-odd - v0.1.0 - Returns true if the given number is odd.
month - v2.0.1 - Get the name or number of the current month or any month of the year.
month-day - v0.1.1 - Get the current day of the month, according to local time or UTC.
months - v1.0.1 - Months of the year.

is this a good time to promote my npm module abcdefghijklmnopqrstuvwxyz

Gul Banana
Nov 28, 2003

Illusive gently caress Man posted:

o I thought people were advocating declaring literally everything using var

i advocate and practice it. what now

Bloody
Mar 3, 2013

Illusive gently caress Man posted:

IMO explicitly writing types is good and using var/auto is bad, except when the type is redundant like
std::unique_ptr<FlushableToilet> toilet = std::make_unique<FlushableToilet>(pisswater)

or just verbose like a iterator from a vector of pairs of whatever.

just because the line is shorter using auto doesn't mean it's more readable. types are useful information to know when reading code.

its me, the guy who cares too much about var.

types can be inferred because writing them out is redundant 100% of the time

Bloody
Mar 3, 2013

I use var 100% of the time

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope

Gul Banana posted:

i advocate and practice it. what now

no items, fox only, final destination

~Coxy
Dec 9, 2003

R.I.P. Inter-OS Sass - b.2000AD d.2003AD

HoboMan posted:

ok these is good examples and i see how this could be cool&good.

did i mention i'm the only software engineer on staff and i don't know poo poo about dicks?

install r# and when it tells you to turn a loop into a linq statement, at least see what it is suggesting and see if you can work out what it's doing

sometimes you won't want it as a linq expression if it compromises the readability, but have a go

~Coxy
Dec 9, 2003

R.I.P. Inter-OS Sass - b.2000AD d.2003AD

Bloody posted:

I use var 100% of the time

i also

mainly because r# told me to back in 2008 and it stuck

Bloody
Mar 3, 2013

~Coxy posted:

i also

mainly because r# told me to back in 2008 and it stuck

lol same

Bloody
Mar 3, 2013

r# language utilization opportunity thing is the best learning tool I have ever encountered

quiggy
Aug 7, 2010

[in Russian] Oof.



im currently saving up money to liberate my modules too, op

weird
Jun 4, 2012

by zen death robot

HoboMan posted:

but you see copy-paste exists

e: PortableInstrumentedSortableHashMap2<K,V> PortableInstrumentedSortableHashMap2<K,V> PortableInstrumentedSortableHashMap2<K,V> PortableInstrumentedSortableHashMap2<K,V> PortableInstrumentedSortableHashMap2<K,V> PortableInstrumentedSortableHashMap2<K,V>

and what about when you're reading it

Bloody
Mar 3, 2013

reminder that increasing verbosity does not increase readability

Adbot
ADBOT LOVES YOU

kitten emergency
Jan 13, 2008

get meow this wack-ass crystal prison

Notorious QIG posted:

im currently saving up money to liberate my modules too, op

lol

  • Locked thread