|
just yesterday i fixed a bug in code with 100% path coverage which would have been prevented by rust's type system, but which even having fixed it i had no idea how i could possibly write a test which would trigger it
|
# ? Apr 11, 2015 23:07 |
|
|
# ? May 18, 2024 09:08 |
|
Symbolic Butt posted:I'm not even idealizing one supposed kind of "good testing suite" like those silver bullets. I'm saying that by mere virtue of having a testing suite at all already makes static type checking redundant. you're an imbecile
|
# ? Apr 11, 2015 23:28 |
|
i hate developing without a static type system. not for "program correctness" but just so i remember what the hell i'm doing. Fart SelectButt(List<Butt> butts) isn't complete documentation or anything but it gives great cognitive handholds. i worked in python a bit and always felt like i was in a fog.
|
# ? Apr 11, 2015 23:28 |
|
Symbolic Butt posted:don't gimmickshame please Not really though. Static typing helps guide new development to ensure that all API expectations are adhered to. It allows for efficient test suites that can throw generative test cases at the wall, using shared value generators. It can guard against faulty assumptions about type working its way into the codebase, including the tests themselves, which can make it easier to onboard new developers safely. I don't completely disagree that unit tests can replace a lot of static typing's benefits, however just like you can emulate almost any language feature in JavaScript because its very permissive, that doesn't mean it'll properly replace it -- especially in terms of the amount of assumptions you'll have to manually check. This amount matters because humans have cognitive limits, and without some guarantees in the system details are more than likely to be missed in initial implementation, testing or code reviews.
|
# ? Apr 11, 2015 23:30 |
|
Plorkyeran posted:just yesterday i fixed a bug in code with 100% path coverage which would have been prevented by rust's type system, but which even having fixed it i had no idea how i could possibly write a test which would trigger it I don't know how I feel about type inference, it's cool I guess and it's not the kind of "trivial static type checking" that I'm dissing itt GrumpyDoctor posted:i hate developing without a static type system. not for "program correctness" but just so i remember what the hell i'm doing. Fart SelectButt(List<Butt> butts) isn't complete documentation or anything but it gives great cognitive handholds. i worked in python a bit and always felt like i was in a fog. for me it's like I don't care if butts is a list or whatever, it's just a thing that I'm taking butt objects from. duck typing birch eventually I'll go back and decide the appropriate data structures and fix up the api for what I really need, and this is where I feel like dynamic typing has an advantage: static typing forces you to deal with a whole chain of type bureaucracy that doesn't matter most of the development time. and maybe it'll never matter anyway :whoa: I know web development is a circus full of clowns but in this context full of fast changing apis it makes sense that dynamic typing is more prevalent Maluco Marinero posted:Static typing helps guide new development to ensure that all API expectations are adhered to. this is a good argument and it's great to discredit the whole "api design guided by tdd thing" style that's so popular with ruby programmers rip tdd thing, killed by static typing
|
# ? Apr 12, 2015 00:19 |
|
Symbolic Butt posted:rip tdd thing, killed by static typing type driven development
|
# ? Apr 12, 2015 00:25 |
|
b0lt posted:type driven development this is basically how i do it
|
# ? Apr 12, 2015 00:30 |
|
Symbolic Butt posted:for me it's like I don't care if butts is a list or whatever, it's just a thing that I'm taking butt objects from. duck typing birch you're looking at this as though you're writing that method. I'm calling that method and I want to know what to pass it. what do you suggest, reading the code every time? just giving it whatever and hoping the test suite catches any resulting bugs? praying that the comments correctly document everything and are up to date? a type signature tells me some of what I need to know in a trustworthy way. it's not perfect or infallible but it's good and useful. Symbolic Butt posted:eventually I'll go back and decide the appropriate data structures and fix up the api for what I really need, and this is where I feel like dynamic typing has an advantage I guess static typing has fewer advantages if you're the only person working on something and you can just gently caress around with the api on a whim!
|
# ? Apr 12, 2015 00:49 |
|
Soricidus posted:me, I'll carry on using all the crutches available to deal with the imperfect world I have to live in, where static typing remains useful my dev philosophy. write the simplest code possible so an idiot (myself) isn't as likely to gently caress up later
|
# ? Apr 12, 2015 00:53 |
|
Symbolic Butt posted:this is a good argument and it's great to discredit the whole "api design guided by tdd thing" style that's so popular with ruby programmers even in ruby land tdd was never that real (in the being used sense) of a thing. tbh it's always struck me as an ideal imagined up by people who have never had a single deadline to meet
|
# ? Apr 12, 2015 00:54 |
|
sorry grandpa, web development's just too fast for your type system.
|
# ? Apr 12, 2015 00:56 |
|
static typing is for autists who literally want to create errors in their program where none would exist otherwise. types are a silly idea for 99% of applications cause it rarely matters how the computer stores a value internally.
|
# ? Apr 12, 2015 01:17 |
|
storage specification is the least important part of a type system
|
# ? Apr 12, 2015 01:20 |
|
Tiny Bug Child posted:static typing is for autists who literally want to create errors in their program where none would exist otherwise. types are a silly idea for 99% of applications cause it rarely matters how the computer stores a value internally. lol
|
# ? Apr 12, 2015 01:21 |
|
when did this become the new terrible programmers thread static typing haters
|
# ? Apr 12, 2015 01:24 |
|
dynamic typing is great for single developer tiny scripts that you will only ever run once
|
# ? Apr 12, 2015 01:31 |
|
MononcQc posted:Does it have inference? Erlang's got an optional type system too, and it gets rather well used around even on codebases that don't annotate anything. The type declarations can be used in documentation, analysis, tests (as quickcheck/PropEr generators). In practice the language remains dynamic, but you get to find type errors that would otherwise show themselves at runtime before then. yes, common lisp usually has type inference. i.e. if you use the strongly typed primitives anywhere, sbcl does an ok job of optimization everywhere that touches a value that's known to have a type. (but nobody uses those types, so it's moot)
|
# ? Apr 12, 2015 02:15 |
|
comedyblissoption posted:how long until a dynamically typed codebase invents its own system of ad hoc type documentation through comments or hungarian notation or statically typed transpiler this exists already there are at least a dozen type systems for ruby, implemented via hacky faux-annotations or a nasty dsl or docstrings none of them matter because optional typing devolves to no typing. it is human nature
|
# ? Apr 12, 2015 02:18 |
|
Notorious b.s.d. posted:yes, common lisp usually has type inference. i.e. if you use the strongly typed primitives anywhere, sbcl does an ok job of optimization everywhere that touches a value that's known to have a type. does it do inference over non-primitive types?
|
# ? Apr 12, 2015 02:18 |
bobbilljim posted:dynamic typing is great for single developer tiny scripts that you will only ever run once IMO this is the only thing languages like python should be used for Plorkyeran posted:just yesterday i fixed a bug in code with 100% path coverage which would have been prevented by rust's type system, but which even having fixed it i had no idea how i could possibly write a test which would trigger it This sounds pretty interesting--can you share any more details?
|
|
# ? Apr 12, 2015 02:18 |
|
do not engage type stymie
|
# ? Apr 12, 2015 02:19 |
|
Subjunctive posted:does it do inference over non-primitive types? depends what you mean by "inference" common lisp has a optional static type system for primitives -- strings, numbers, arrays and vectors of same. this poo poo gets optimized pretty well, since performance was the point of having this stuff in the standard. common lisp also has a real, useful type system that can express useful ideas, in the form of CLOS. clos is a library for CL, much like moose is a library for perl implementing a real type system. does it count as "inference" for non-CLOS code to seamlessly interoperate with legacy dynamic code and not raise compiler errors?
|
# ? Apr 12, 2015 02:27 |
|
VikingofRock posted:IMO this is the only thing languages like python should be used for good languages are equally effective for your one-off scripts and your multi-year software projects i unironically write scripts in scala. it supports shebang notation and everything a friend of a friend does all his one-off sysadmin scripts in ocaml. he works in one of the world's only ocaml shops, so it makes a lot of sense in his context. why use a second language for scripting if your first one will do ?
|
# ? Apr 12, 2015 02:28 |
Notorious b.s.d. posted:good languages are equally effective for your one-off scripts and your multi-year software projects I didn't mean to imply that good langs shouldn't be used for short scripts. I actually started semi-seriously learning haskell after I saw someone in this thread post some of their haskell CJ scripts.
|
|
# ? Apr 12, 2015 02:32 |
|
VikingofRock posted:This sounds pretty interesting--can you share any more details? it wasn't actually all that interesting; just some very slightly incorrect code for passing values between threads that was incorrect in a way that rust's borrow checker would have caught which resulted in data races on a value never used for control flow
|
# ? Apr 12, 2015 02:39 |
|
Notorious b.s.d. posted:a friend of a friend does all his one-off sysadmin scripts in ocaml. he works in one of the world's only ocaml shops, so it makes a lot of sense in his context. why use a second language for scripting if your first one will do ? one-off scripts tend to involve mostly calling other programs and munging strings, and most of the languages i would consider using for Real Programs are kinda bad at both of those
|
# ? Apr 12, 2015 02:41 |
|
Symbolic Butt posted:I don't know how I feel about type inference, it's cool I guess and it's not the kind of "trivial static type checking" that I'm dissing itt Symbolic Butt posted:for me it's like I don't care if butts is a list or whatever, it's just a thing that I'm taking butt objects from. duck typing birch
|
# ? Apr 12, 2015 02:47 |
|
come on guys it's not like problems have ever happened because a value of the wrong type was passed to a function.
|
# ? Apr 12, 2015 03:18 |
|
Notorious b.s.d. posted:good languages are equally effective for your one-off scripts and your multi-year software projects
|
# ? Apr 12, 2015 03:19 |
|
Plorkyeran posted:i didn't mention type inference? oh, I just assumed that was the magic shenanigan that rust did to detect that error, I mean it has to be something more sophisticated than regular static type checking Plorkyeran posted:would it blow your mind if i told you that's how i often write c++? templates are duck typed but with compile time checking of if the thing looks like a duck rather than runtime not really, I mean, I've seen some game developer once doing some kind of pseudo-duck typing on C++ but it looked gross and way too smart for his own good... so if it's not like that then it'd blow my mind sure I guess?
|
# ? Apr 12, 2015 03:25 |
|
rrrrrrrrrrrt posted:when did this become the new terrible programmers thread so I can stay because I don't even hate static typing, it's you guys that are racist against dynamic typing
|
# ? Apr 12, 2015 03:26 |
|
Notorious b.s.d. posted:this exists already I'm more referring to what's the tipping point people have to usually reach in complexity/code size before they realize they need to add typing, realizing that lack of static typing is a bad idea
|
# ? Apr 12, 2015 03:37 |
|
fleshweasel posted:come on guys it's not like problems have ever happened because a value of the wrong type was passed to a function. real programmers never dereference a null
|
# ? Apr 12, 2015 03:39 |
|
semi-serious q: what does having a static type system 'cost' you?? like I seriously don't get why you would prefer the alternatives
|
# ? Apr 12, 2015 03:43 |
|
comedyblissoption posted:it really sounds like static typing is for holding the hands of dumb babby programmers who make novice mistakes like this anyone who has inherited a decent 6.5 figure + loc ruby codebase doesn't care who made the mistakes and just wants typing
|
# ? Apr 12, 2015 03:43 |
|
Soricidus posted:you're looking at this as though you're writing that method. I'm calling that method and I want to know what to pass it. what do you suggest, reading the code every time? just giving it whatever and hoping the test suite catches any resulting bugs? praying that the comments correctly document everything and are up to date? I'll concede that in a setting where people never document their functions, having the type signatures is better than nothing. Soricidus posted:I guess static typing has fewer advantages if you're the only person working on something and you can just gently caress around with the api on a whim! I didn't mean that, jesus guys it's like public api design is the only thing that matters in programming Symbolic Butt fucked around with this message at 03:53 on Apr 12, 2015 |
# ? Apr 12, 2015 03:47 |
|
Ploft-shell crab posted:semi-serious q: what does having a static type system 'cost' you?? like I seriously don't get why you would prefer the alternatives I'm bad at posting so here's a paper by professor tbc: https://courses.cs.washington.edu/courses/cse590n/10au/hanenberg-oopsla2010.pdf
|
# ? Apr 12, 2015 03:50 |
|
Symbolic Butt posted:I'm bad at posting so here's a paper by professor tbc: https://courses.cs.washington.edu/courses/cse590n/10au/hanenberg-oopsla2010.pdf quote:Even though the experiment seems to suggest that static typing has no positive impact on development time it must not be forgotten that the experiment has some special conditions: the experiment was a one-developer experiment.
|
# ? Apr 12, 2015 04:00 |
|
Symbolic Butt posted:I'm bad at posting so here's a paper by professor tbc: https://courses.cs.washington.edu/courses/cse590n/10au/hanenberg-oopsla2010.pdf other findings that an experiment using 45 hours of student coding into a write-only project would have found: documentation doesn't help comments are worthless testing is worthless there's no point to using source control it's totally meaningless
|
# ? Apr 12, 2015 04:01 |
|
|
# ? May 18, 2024 09:08 |
|
Brain Candy posted:it's totally meaningless this but everything
|
# ? Apr 12, 2015 04:03 |