|
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
|
# ? Mar 23, 2016 03:26 |
|
|
# ? May 12, 2024 00:05 |
|
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
|
# ? Mar 23, 2016 03:51 |
|
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. 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
|
# ? Mar 23, 2016 03:55 |
|
Condiv posted:lol, the type isn't determined at execution it's determined at compile time 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
|
# ? Mar 23, 2016 03:59 |
|
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.
|
# ? Mar 23, 2016 04:07 |
|
Condiv posted:only one thing, but the is-number module has this many dependents npm is cool
|
# ? Mar 23, 2016 04:11 |
|
npm is so bad. javascript is bad too.
|
# ? Mar 23, 2016 04:15 |
|
Condiv posted:lol, the type isn't determined at execution it's determined at compile time yeah whatever I'm dumb and or gay
|
# ? Mar 23, 2016 04:19 |
|
speaking of npm look at this whiny baby: https://medium.com/@azerbike/i-ve-just-liberated-my-modules-9045c06be67c#.p1nevaqs8
|
# ? Mar 23, 2016 04:27 |
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.
|
|
# ? Mar 23, 2016 04:36 |
|
yeah i sympathize with the guy also it's just breaking builds, not production
|
# ? Mar 23, 2016 05:11 |
|
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.
|
# ? Mar 23, 2016 05:17 |
|
Illusive gently caress Man posted:IMO explicitly writing types is good and using var/auto is bad, except when the type is redundant like this is exactly what var is for though? the proper use of var is to condense a repeated type declaration: code:
code:
|
# ? Mar 23, 2016 05:34 |
|
o I thought people were advocating declaring literally everything using var
|
# ? Mar 23, 2016 05:40 |
|
Condiv posted:only one thing, but the is-number module has this many dependents is that a depth of one or exhaustive?
|
# ? Mar 23, 2016 05:47 |
|
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
|
# ? Mar 23, 2016 05:50 |
|
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 |
# ? Mar 23, 2016 05:52 |
|
HoboMan posted:me too. 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.
|
# ? Mar 23, 2016 06:03 |
|
LeftistMuslimObama posted:because there are things in some codebases like PortableInstrumentedSortableHashMap2<K,V> and i dont want to type that poo poo out twice. 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>
|
# ? Mar 23, 2016 06:12 |
|
Plorkyeran posted:at the minimum use var/auto when the type appears on the rhs, because repeating the type is dumb 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
|
# ? Mar 23, 2016 06:19 |
|
i miss c. so fun to code:
|
# ? Mar 23, 2016 06:42 |
|
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 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.
|
# ? Mar 23, 2016 07:32 |
|
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.
|
# ? Mar 23, 2016 07:35 |
|
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
|
# ? Mar 23, 2016 07:38 |
|
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"
|
# ? Mar 23, 2016 07:48 |
|
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
|
# ? Mar 23, 2016 08:34 |
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.
|
|
# ? Mar 23, 2016 09:51 |
|
MononcQc posted:Found the guy: https://www.npmjs.com/~jonschlinkert is this a good time to promote my npm module abcdefghijklmnopqrstuvwxyz
|
# ? Mar 23, 2016 10:17 |
|
Illusive gently caress Man posted:o I thought people were advocating declaring literally everything using var i advocate and practice it. what now
|
# ? Mar 23, 2016 11:05 |
|
Illusive gently caress Man posted:IMO explicitly writing types is good and using var/auto is bad, except when the type is redundant like types can be inferred because writing them out is redundant 100% of the time
|
# ? Mar 23, 2016 12:18 |
|
I use var 100% of the time
|
# ? Mar 23, 2016 12:20 |
|
Gul Banana posted:i advocate and practice it. what now no items, fox only, final destination
|
# ? Mar 23, 2016 12:43 |
|
HoboMan posted:ok these is good examples and i see how this could be cool&good. 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
|
# ? Mar 23, 2016 13:02 |
|
Bloody posted:I use var 100% of the time i also mainly because r# told me to back in 2008 and it stuck
|
# ? Mar 23, 2016 13:05 |
|
~Coxy posted:i also lol same
|
# ? Mar 23, 2016 13:07 |
|
r# language utilization opportunity thing is the best learning tool I have ever encountered
|
# ? Mar 23, 2016 13:07 |
|
CRIP EATIN BREAD posted:speaking of npm look at this whiny baby: im currently saving up money to liberate my modules too, op
|
# ? Mar 23, 2016 13:18 |
|
HoboMan posted:but you see copy-paste exists and what about when you're reading it
|
# ? Mar 23, 2016 13:24 |
|
reminder that increasing verbosity does not increase readability
|
# ? Mar 23, 2016 13:25 |
|
|
# ? May 12, 2024 00:05 |
|
Notorious QIG posted:im currently saving up money to liberate my modules too, op lol
|
# ? Mar 23, 2016 13:29 |