|
fart simpson posted:with static typeing you can encode temperature not as a float, but put the F, C, or K scale or whatever right in the type you're dead motherfucker
|
# ? Aug 13, 2016 06:37 |
|
|
# ? May 10, 2024 18:25 |
|
Symbolic Butt posted:it's just a shallow tradeoff, as worthy as the choice of tabs vs spaces horse poo poo
|
# ? Aug 13, 2016 06:38 |
|
jony neuemonic posted:i know this is a whole page back but it blows me away every time someone argues that you don't need static typing if you just write more unit tests. what blows me away is how java doesn't have unsigneds
|
# ? Aug 13, 2016 06:38 |
|
Weekend Bridges posted:what blows me away is how java doesn't have unsigneds it was explicitly designed this way. the language authors thought programmers would be too retarded to get the signed/unsigned arithmetic correct. they're right, but it's still kinda poo poo i agree
|
# ? Aug 13, 2016 06:40 |
|
JewKiller 3000 posted:sorry mister butt but you haven't won anything and you're not going to because you're not on the winning side. the point is that static typing ALLOWS YOU TO EXPRESS AT COMPILE-TIME whether or not the validity has been checked, and so you can COMPLETELY ELIMINATE THE POSSIBLE EXISTENCE of code that requires validation running on a non-validated object. and your validation code can be, as you say, anything at all. this does not conflict one bit with the usefulness of static typing for your use case of "did i validate the thing", if anything you are just reinforcing the argument for static typing oh I didn't claim I won the argument against my strawman on the compile-time vs runtime front. I feel like there's an interesting point in the "4 hours to run" case that someone mentioned itt I was claiming victory over the fact that static type checking is a shallow way of proving correctness of your code. Everyone says it's actually important but then backpedals through some other orthogonal subject. anyway this is the tradeoff for me, static type checking helps with those extreme cases I guess, it helps the compiler to make more performant machine code etc. but to me, against the cognitive overhead (even if it's small) and lack of expressiveness (a bit overrated sure) those advantages doesn't pay off.
|
# ? Aug 13, 2016 06:52 |
|
also I'm legit sorry for ruining another page with my posts itt lol
|
# ? Aug 13, 2016 06:54 |
Symbolic Butt posted:also I'm legit sorry for ruining another page with my posts itt lol dont sign
|
|
# ? Aug 13, 2016 06:54 |
|
i really like when i fat finger a variable name in python and the program just keeps running and returns garbage values like nothing ever happened
|
# ? Aug 13, 2016 06:55 |
|
ok everyone go play the java spring game and post your favorite results. enough of this static typing touchbutt
|
# ? Aug 13, 2016 06:59 |
|
Symbolic Butt posted:but to me, against the cognitive overhead (even if it's small) and lack of expressiveness (a bit overrated sure) those advantages doesn't pay off. see, this is where i have a different perspective; it takes way less cognitive power for me to program in a statically typed language than it does to program in a dynamic one. i guess it's a person-by-person thing
|
# ? Aug 13, 2016 07:00 |
|
Symbolic Butt posted:but to me, against the cognitive overhead (even if it's small) and lack of expressiveness (a bit overrated sure) those advantages doesn't pay off. i can't really respond to this without understanding more about what you mean by these terms. does cognitive overhead mean you have to think about what types your values have? because even in the most dynamic language ever, you need to do this, or you have no idea what code you can write to use those values. do you just not want to explicitly have to write those types down all the time? in that case the answer is type inference. what does lack of expressiveness mean? are you particularly attached to writing programs like "heheheh lemme just concatenate these two user input strings, treat the result as a variable name, and evaluate it in my current environment"? in that case you should stop that
|
# ? Aug 13, 2016 07:06 |
|
Shaman Linavi posted:i really like when i fat finger a variable name in python and the program just keeps running and returns garbage values like nothing ever happened a post by someone who actually never used python even php raises a NOTICE for undefined variables unless you mean you typoed into some other defined variable? but uh... LeftistMuslimObama posted:enough of this static typing touchbutt alright alright
|
# ? Aug 13, 2016 07:07 |
|
as a person who write in mumps every day, i think static typing is good. because i wish i had it. i cant even declare constants ffs.
|
# ? Aug 13, 2016 07:07 |
|
Symbolic Butt posted:a post by someone who actually never used python a simple assignment will exhibit that behavior. have YOU ever used python?
|
# ? Aug 13, 2016 07:08 |
|
JewKiller 3000 posted:a simple assignment will exhibit that behavior. have YOU ever used python? code:
|
# ? Aug 13, 2016 07:16 |
|
JewKiller 3000 posted:i can't really respond to this without understanding more about what you mean by these terms. does cognitive overhead mean you have to think about what types your values have? because even in the most dynamic language ever, you need to do this, or you have no idea what code you can write to use those values. do you just not want to explicitly have to write those types down all the time? in that case the answer is type inference. what does lack of expressiveness mean? are you particularly attached to writing programs like "heheheh lemme just concatenate these two user input strings, treat the result as a variable name, and evaluate it in my current environment"? in that case you should stop that i used to not think too much about the types of my values beforehand and also i thought stuff like weird runtime metaprogramming stuff was cool back when i used python a lot. i only changed my mind when i started using haskell more
|
# ? Aug 13, 2016 07:16 |
|
code:
|
# ? Aug 13, 2016 07:28 |
|
Oh look at all the terrible opinions itt
|
# ? Aug 13, 2016 07:32 |
|
its simply impossible to prevent that kind of error
|
# ? Aug 13, 2016 07:31 |
|
Shaman Linavi posted:
lol I swear I never thought of that it's one of those syntax quirks that it's just wired in my brain for so long Symbolic Butt fucked around with this message at 07:34 on Aug 13, 2016 |
# ? Aug 13, 2016 07:32 |
|
Mr Dog posted:lol Java logging is such a fuckshow. then me: "our logging level is set to info, so i don't see these debug-level messages i have been putting in this class, how do i configure the logging level" the answer is "gently caress you, spend a day trying to figure out which of the above things is the concrete implementation and then another day trying to figure out where the hell are you supposed to put the configuration file" then we update our dependencies to new versions and make the project structure flatter. then you get to do it again because some magical thing inside the application autoconfigures the logging depending on what it can find in the classpath
|
# ? Aug 13, 2016 07:40 |
|
fart simpson posted:its simply impossible to prevent that kind of error to be fair that problem has nothing to do with dynamic typing at all there's plenty of dynamic languages that DON'T make the utterly retarded choice of using the exact same syntax for declaration and assignment and in principle a static language could totally do that, though i don't know of any that actually does. visual basic has an optional compiler flag to disable explicit declarations, but i have it on good authority you are legally allowed to murder anybody who turns that on
|
# ? Aug 13, 2016 08:16 |
|
HoboMan posted:Terrible Programmers: what font do you personally prefer to code in?
|
# ? Aug 13, 2016 08:39 |
|
|
# ? Aug 13, 2016 09:02 |
|
Soricidus posted:the most appropriate font for your code is probably comic sans, op annual reminder that one of my coworkers does this unironically (at about size 16pt typeface too)
|
# ? Aug 13, 2016 09:06 |
I like point-free style as long as you don't go too gung ho with it
|
|
# ? Aug 13, 2016 09:21 |
|
wait a minute, you can't fool me, this is just comic sans
|
# ? Aug 13, 2016 09:59 |
|
NihilCredo posted:to be fair that problem has nothing to do with dynamic typing at all yes! verifying for variable usage/declaration/reuse and their scope is entirely distinct from type checking. Unless you're using dynamic scoping, you could very well validate that stuff while compiling to whatever intermediary format the dynamic language may use, or through a linting phase with little trouble.
|
# ? Aug 13, 2016 12:35 |
|
fart simpson posted:with static typeing you can encode temperature not as a float, but put the F, C, or K scale or whatever right in the type realtalk f# does this and it's useful as all hell
|
# ? Aug 13, 2016 12:49 |
|
Symbolic Butt posted:heck the way some C# programmers write so many interfaces seems to me that deep down they're lusting for some sweet duck typing people write one-concrete interfaces only because that's how you unit test in C# I agree it's a flaw but not the way you think it is
|
# ? Aug 13, 2016 13:06 |
|
VikingofRock posted:I like point-free style as long as you don't go too gung ho with it same here, in fact I actually stop short of point-free and just write code that's basically pointless
|
# ? Aug 13, 2016 14:57 |
|
VikingofRock posted:I like point-free style as long as you don't go too gung ho with it guess what I use these utility functions for code:
|
# ? Aug 13, 2016 15:16 |
|
Luigi Thirty posted:i downloaded that 68k emulator/debugger easy68k to play with. it includes all kinds of simulated peripherals, serial connection, file i/o, even TCP and UDP networking. i decided i wanted to try clearing the 7-segment LEDs subq already sets the flags if you're operating on a data register, so no need for the cmp #0. you could also remove both subq+cmp and replace the branch with dbne d0,CLEARLCD. auto inc/dec owns. that's why i like the 6809 Sweevo fucked around with this message at 16:09 on Aug 13, 2016 |
# ? Aug 13, 2016 15:56 |
|
ive never done a spring and i got 1/10 on that quiz
|
# ? Aug 13, 2016 16:21 |
|
Symbolic Butt posted:I was claiming victory over the fact that static type checking is a shallow way of proving correctness of your code. Everyone says it's actually important but then backpedals through some other orthogonal subject. it's as shallow or as deep as you want it to be. it's certainly possible to make the type system worthless, and just cast everything to Object the minute you get it. that's an option open to you. you can't fix stupid. in the average case, static typing is a tool that even total numbskulls can use to avoid thousands of lovely edge cases without any special effort in extreme cases, you can literally prove the correctness of a program before executing it
|
# ? Aug 13, 2016 16:22 |
|
Luigi Thirty posted:i downloaded that 68k emulator/debugger easy68k to play with. it includes all kinds of simulated peripherals, serial connection, file i/o, even TCP and UDP networking. i decided i wanted to try clearing the 7-segment LEDs i take it you have never used pdp-11 asm aside from the type system itself, every feature of C is a pdp-11 asm feature. arrays, indexing, pre/post- inc/dec, pointers, pointers to pointers, a managed stack, etc
|
# ? Aug 13, 2016 16:23 |
|
jony neuemonic posted:i know this is a whole page back but it blows me away every time someone argues that you don't need static typing if you just write more unit tests. maybe we're talking past around 'need' though
|
# ? Aug 13, 2016 17:26 |
|
JawnV6 posted:now im wondering if this type system has enough gearing to check int Adder(int, int) is actually an adder without deigning to actually run the stupid function with an argument or two you can totally design a system that can statically prove that a given function is in fact an addition of some kind. (which is to say, it's commutative and associative, and it has an identity element. floating-point need not apply.)
|
# ? Aug 13, 2016 17:41 |
|
Notorious b.s.d. posted:i take it you have never used pdp-11 asm i have never owned a pdp-11 or used a pdp-11 emulator no Sweevo posted:subq already sets the flags if you're operating on a data register, so no need for the cmp #0. you could also remove both subq+cmp and replace the branch with dbne d0,CLEARLCD. http://pastebin.com/k5anYEmm this poo poo is bananas you can explicitly set the data width in nearly every instruction! you can push/pop a range of registers onto the stack pointer in one instruction! holy poop this is way better than the x86 nightmare Luigi Thirty fucked around with this message at 17:51 on Aug 13, 2016 |
# ? Aug 13, 2016 17:47 |
|
|
# ? May 10, 2024 18:25 |
|
Jabor posted:you can totally design a system that can statically prove that a given function is in fact an addition of some kind. i'm sorta curious how you can have something that involved & clever about your specifics that is less code than a unit test or two, and if you're making a library you're probably writing an example client anyway, but yeah anyone who lowers themself to write a unit test is some kind of neaderthal coder barely worthy of derision
|
# ? Aug 13, 2016 18:23 |