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
Arcsech
Aug 5, 2008

Tiny Bug Child posted:

whoa this is literally the first valid argument in favor of static typing i've ever seen. that said i guess it's up to you but i personally don't think improved autocompletion is worth the programming equivalent of having someone follow you around all day and yell at you whenever you end a sentence with a preposition

to torture the metaphor, if sometimes when i ended a sentence with a preposition it caused whoever i was talking to to have a seizure or give their wallet to a stranger i would def have somebody yell at me for it so i would stop doing that

Adbot
ADBOT LOVES YOU

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

hi im drunk and programming & computer suck real bad and if youre going to program as a hobby at least use haskell or something. thanks for reading. bye

Nomnom Cookie
Aug 30, 2009



MeramJert posted:

hi im drunk and programming & computer suck real bad and if youre going to program as a hobby at least use haskell or something. thanks for reading. bye

you don't even eat human hair why would i listen to you

Shaggar
Apr 26, 2006
the only people who should use Haskell is simon peyton jones

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

Shaggar posted:

the only people who should use Haskell is simon peyton jones

and me. i use haskell. but programming isn't my job so it doesn't matter

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

also frp and elm own

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

Tiny Bug Child posted:

whoa this is literally the first valid argument in favor of static typing i've ever seen. that said i guess it's up to you but i personally don't think improved autocompletion is worth the programming equivalent of having someone follow you around all day and yell at you whenever you end a sentence with a preposition

more valuable than autocomplete imo is "go to decl/impl/docs". with good analysis tools and consistent coding style you can get a lot of that, but usually not all. also, refactoring is a lot safer with static types, because it provides a simple form of whole-program analysis of usage. changing a type signature when making semantic changes can save a lot of grief.

i roll dynamic wherever i can, but i do miss static types when working with 3rd-party libraries. they're a pretty good form of unavoidable documentation.

declared types don't have to be static, though, in that objects can change their traits at runtime even if a given variable is labeled or inferred as a given type. late-loading mixins or expandos or whatever can be really helpful in managing incidental state, though they can also be footguns.

Arcsech
Aug 5, 2008

MeramJert posted:

also frp and elm own

qft

prefect
Sep 11, 2001

No one, Woodhouse.
No one.




Dead Man’s Band

MeramJert posted:

also frp and elm own

i liked pine better than elm

coffeetable
Feb 5, 2006

TELL ME AGAIN HOW GREAT BRITAIN WOULD BE IF IT WAS RULED BY THE MERCILESS JACKBOOT OF PRINCE CHARLES

YES I DO TALK TO PLANTS ACTUALLY

AlsoD posted:

i bought that C++ book you were recommending, for a "primer" it's a loving tome jesus christ. not sure I'm ever going to have time to go through it

don't be too intimidated - the book goes fairly slow and provides examples the whole way through, so if you're familiar with a C-like you should be able to progress through it much quicker than it's weight suggests. on the other hand, it only dips its toes in the STL and doesn't mention Boost at all, so there's even more reading to look forward to when you're done w/ that!

e: also lmao comin straight from haskell you're gonna have a fukkin aneurysm

coffeetable fucked around with this message at 17:42 on Apr 30, 2014

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

prefect posted:

i liked pine better than elm

whats pine? or is this a bad joke

coffeetable
Feb 5, 2006

TELL ME AGAIN HOW GREAT BRITAIN WOULD BE IF IT WAS RULED BY THE MERCILESS JACKBOOT OF PRINCE CHARLES

YES I DO TALK TO PLANTS ACTUALLY

Arcsech posted:

to torture the metaphor, if sometimes when i ended a sentence with a preposition it caused whoever i was talking to to have a seizure or give their wallet to a stranger i would def have somebody yell at me for it so i would stop doing that

stealing this

suffix
Jul 27, 2013

Wheeee!

ultramiraculous posted:

great unit tests

:lol: like those things even go together

yeah you really should have 100% test coverage on large p-lang projects. that's it, that's the whole trick.

luckily even the worst p-lang mock utils i've used are tons better than anything i've found for java. it's not like writing tests in p-langs is hard.

AlsoD posted:

with regards to JewKiller 3000's specific complaint:

one area where static types directly make programming easier is w.r.t auto-completion. Since it's known at compile time if a certain object implements Runnable or Collection or whatever then there's only so many methods you can call from that object and so the IDE can give them in a list. Correct me if I'm wrong, but I don't think that can be done from python for example. Sure you can autocomplete names from the list of identifiers in the project + standard library or whatever but it's not the same.

funnily enough this works great for J-langs, Agda and Idris but not Haskell itself :(

jetbrains pycharm is actually pretty good

gonadic io
Feb 16, 2011

>>=

coffeetable posted:

e: also lmao comin straight from haskell you're gonna have a fukkin aneurysm

hey i've been paid to write java before and I even wrote some today! i mean it did nothing but remind me how much i hate it but whatever

Sapozhnik
Jan 2, 2005

Nap Ghost
i have enough trouble finding/convincing gophers to help me write poo poo in java instead of loving php+mysql (:shrek:) so getting a dev team together around a Haskell project just isn't going to happen. besides there's a lot of binary manipulation involved

(this being the reason why i chose the programming language with no unsigned types whatsoever ofc :suicide:)

double sulk
Jul 2, 2010

AlsoD posted:

i bought that C++ book you were recommending, for a "primer" it's a loving tome jesus christ. not sure I'm ever going to have time to go through it

primer plus? if that one then yeah it's like 1200 pages

MononcQc
May 29, 2007

While static typing helps, if you think the biggest challenge in scaling a software project is in rooting out type errors, you have been lucky to work with competent teams and managers, haven't worked in larger teams, or are just churning out hobby projects.

I can't believe static types would be more important there than health of team dynamics, having direction, quality of communication and channels, and so on, which will often have the power to kill a project before it even gets started or announce its death before any technical issue will.

gonadic io
Feb 16, 2011

>>=
this is absolutely true. with large projects, type systems are the least of your worries i completely agree.

however that's not to say that language choice is entirely irrelevant to how your project will work out. in fact i'd say that the bigger the project, the more important it is to be able to refactor more easily for example.

i guess my point is that yes, healthy team dynamics are way more important than having static types. if you have a team of expert python programmers that love the language then you shouldn't switch to a different language just for the static types, that'd be a disaster.

however if you have a reasonably free choice of language then you might as well pick the better tool, even if it ultimately has less of an impact on the project than the people working on it.

Shaggar
Apr 26, 2006

MononcQc posted:

While static typing helps, if you think the biggest challenge in scaling a software project is in rooting out type errors, you have been lucky to work with competent teams and managers, haven't worked in larger teams, or are just churning out hobby projects.

I can't believe static types would be more important there than health of team dynamics, having direction, quality of communication and channels, and so on, which will often have the power to kill a project before it even gets started or announce its death before any technical issue will.

acceptance of dynamic typing is one sign of a dysfunctional team.

compuserved
Mar 20, 2006

Nap Ghost

holy poo poo thanks for reminding me that gopher was a thing

Tiny Bug Child
Sep 11, 2004

Avoid Symmetry, Allow Complexity, Introduce Terror

AlsoD posted:

however if you have a reasonably free choice of language then you might as well pick the better tool,

wait i thought you were in favor of static typing.

gonadic io
Feb 16, 2011

>>=

Tiny Bug Child posted:

wait i thought you were in favor of static typing.

:classiclol:

gonadic io
Feb 16, 2011

>>=
hey tbc if you never make type errors, why do you hate static typing? surely you'd just never even notice that it was there as long as Int + Float works

Blotto Skorzany
Nov 7, 2008

He's a PSoC, loose and runnin'
came the whisper from each lip
And he's here to do some business with
the bad ADC on his chip
bad ADC on his chiiiiip
prepositions are the best things to end your sentences with. it's similarly fine to cheerfully split infinitives aplenty. both of these forms are attested from the old english period through middle english and early modern english and continue on in english today. the rules of classical latin grammar are not the rules of every other language's grammar :mad:

Tiny Bug Child
Sep 11, 2004

Avoid Symmetry, Allow Complexity, Introduce Terror

AlsoD posted:

hey tbc if you never make type errors, why do you hate static typing? surely you'd just never even notice that it was there as long as Int + Float works

last time i wrote java it didn't work. it has literally been years so i don't remember what it said but it was "uncaught loss of precision" or something stupid like that. but int + float is only one case. what about int + string, or string + float, or bool == string?

the point is that the computer should not check these things at all, because "types" are an implementation detail that should be hidden from the user (the programmer) unless you're working on real low level poo poo where performance is a concern. yeah sure you gotta fiddle with bits to do a device driver or embedded stuff but nobody writing yet another business logic CRUD app should have to think about types

coffeetable
Feb 5, 2006

TELL ME AGAIN HOW GREAT BRITAIN WOULD BE IF IT WAS RULED BY THE MERCILESS JACKBOOT OF PRINCE CHARLES

YES I DO TALK TO PLANTS ACTUALLY

so do you just never make mistakes or do you cloak your code in a million tests

MononcQc
May 29, 2007

AlsoD posted:

this is absolutely true. with large projects, type systems are the least of your worries i completely agree.

however that's not to say that language choice is entirely irrelevant to how your project will work out. in fact i'd say that the bigger the project, the more important it is to be able to refactor more easily for example.

i guess my point is that yes, healthy team dynamics are way more important than having static types. if you have a team of expert python programmers that love the language then you shouldn't switch to a different language just for the static types, that'd be a disaster.

however if you have a reasonably free choice of language then you might as well pick the better tool, even if it ultimately has less of an impact on the project than the people working on it.

Right, that's a sensible argument. Ultimately the language argument can be beaten or modified due to:

  • libraries available and maturity
  • language paradigm and problem domain
  • how much logic actually goes into the software vs. database, for example
  • hardware / environment you will run on
  • guarantees you need to provide and constraints you need to deal with
  • etc.

Static typing is only one of the factors that guides tool choice. Forth isn't really a typed language, but it may run entirely fine in environments where you can actually note what every register is doing as you go, for example.

I think we all have that tendency to generalize the type of work we individually do to the rest of the industry, but it's useful to remember that the context different types of developers evolve in is extremely different from person to person.

Shaggar posted:

acceptance of dynamic typing is one sign of a dysfunctional team.

This but with Shaggar

Tiny Bug Child
Sep 11, 2004

Avoid Symmetry, Allow Complexity, Introduce Terror

coffeetable posted:

so do you just never make mistakes or do you cloak your code in a million tests

i will ask again: what loving mistakes are you people making that are caught by static typing? cause no, apparently i don't ever make those mistakes. i make plenty of mistakes but i can't remember the last one that would have been prevented if php had static typing.

gonadic io
Feb 16, 2011

>>=
my fun day with java today:

Java code:
String[] arrStrings = ...
List<String> strings = Arrays.asList(arrStrings); // works fine

int[] arrInts = ...
List<int>     ints = Arrays.asList(arrInts); // doesn't compile, can't have primitives in generics
List<Integer> ints = Arrays.asList(arrInts); // doesn't compile, can't autobox an array
List<int[]>   ints = Arrays.asList(arrInts); // compiles, is a list of one element which is the array
now i have to actually write a loop like it's 1995, jesus christ

gonadic io fucked around with this message at 19:30 on Apr 30, 2014

gonadic io
Feb 16, 2011

>>=

Tiny Bug Child posted:

i will ask again: what loving mistakes are you people making that are caught by static typing? cause no, apparently i don't ever make those mistakes. i make plenty of mistakes but i can't remember the last one that would have been prevented if php had static typing.

next time i do some programming i will record my errors and post a log here. then we'll all laugh at me for being stupid like every other programmer

Arcsech
Aug 5, 2008

Tiny Bug Child posted:

the point is that the computer should not check these things at all, because "types" are an implementation detail that should be hidden from the user (the programmer) unless you're working on real low level poo poo where performance is a concern. yeah sure you gotta fiddle with bits to do a device driver or embedded stuff but nobody writing yet another business logic CRUD app should have to think about types

this is a clear signal that you have only ever used languages like java or c where the type system is effectively useless and does primarily reflect implementation details

in languages with better type systems like haskell or idris the type system doesn't have anything to do with implementation details and is instead a way to test and document your code and your flow of data and have it enforced by the compiler. the use case of strong static typing is more to allow you to specify that inputData is UnsafeText and needs to be converted to EscapedText before you feed it into another function and keeps some idiot (most likely future you) from stupidly passing an input string into an sql query or something without realizing it

erroring on int + string is more of a consequence of designing for that behavior, not the reason for designing that behavior

Bloody
Mar 3, 2013

Tiny Bug Child posted:

last time i wrote java it didn't work. it has literally been years so i don't remember what it said but it was "uncaught loss of precision" or something stupid like that. but int + float is only one case. what about int + string, or string + float, or bool == string?

the point is that the computer should not check these things at all, because "types" are an implementation detail that should be hidden from the user (the programmer) unless you're working on real low level poo poo where performance is a concern. yeah sure you gotta fiddle with bits to do a device driver or embedded stuff but nobody writing yet another business logic CRUD app should have to think about types

if you do most of those comparisons you deserve to lose your programmer license. they're literally meaningless operations. any system that doesnt vomit is a broken system.

HORATIO HORNBLOWER
Sep 21, 2002

no ambition,
no talent,
no chance

AlsoD posted:

my fun day with java today:

Java code:
String[] arrStrings = ...
List<String> strings = Arrays.asList(arrStrings); // works fine

int[] arrInts = ...
List<int>     ints = Arrays.asList(arrInts); // doesn't compile, can't have primitives in generics
List<Integer> ints = Arrays.asList(arrInts); // doesn't compile, can't autobox an array
List<int[]>   ints = Arrays.asList(arrInts); // compiles, is a list of one element which is the array

now i have to actually write a loop like it's 1995, jesus christ

why not just make arrInts an Integer[]? :confused:

gonadic io
Feb 16, 2011

>>=

HORATIO HORNBLOWER posted:

why not just make arrInts an Integer[]? :confused:

i didn't choose the api, it's pretty poo poo for other reasons too

or if there's a handy function that does exactly this, please tell me

Tiny Bug Child
Sep 11, 2004

Avoid Symmetry, Allow Complexity, Introduce Terror

Bloody posted:

if you do most of those comparisons you deserve to lose your programmer license. they're literally meaningless operations. any system that doesnt vomit is a broken system.

thanks forums poster Bloody, this is the exact kind of pedantic garbage that programmers are known for. i should have known that

"2" + 2

is literally meaningless. no human, let alone a computer, could possibly glean what the intent of that operation is. it's literally without meaning. those are two entirely dissimilar things on either side of that operator. recognizing that they are both numbers and treating them as such would be an absurd conclusion with no rational basis. despite the fact that you could show that equation to a grade school student and reasonably expect to get a correct answer, there is no way for a machine to interpret it because it is

literally

meaningless

Blotto Skorzany
Nov 7, 2008

He's a PSoC, loose and runnin'
came the whisper from each lip
And he's here to do some business with
the bad ADC on his chip
bad ADC on his chiiiiip

Tiny Bug Child posted:

i will ask again: what loving mistakes are you people making that are caught by static typing?

xQueueSend(&msg, datalog_task_handle, 10 / portTICK_RATE_MS);




note the second argument - i said datalog_task_handle when i meant datalog_queue_handle. if the type system doesn't catch this you spend Quite A While trying to figure out why the datalog task is never getting any of the messages sent to it despite the calls to xQueueSend always succeeding

Zombywuf
Mar 29, 2008

Tiny Bug Child posted:

i will ask again: what loving mistakes are you people making that are caught by static typing? cause no, apparently i don't ever make those mistakes. i make plenty of mistakes but i can't remember the last one that would have been prevented if php had static typing.

code:
foo.do_thing_with_buts(butts)

Bloody
Mar 3, 2013

Tiny Bug Child posted:

thanks forums poster Bloody, this is the exact kind of pedantic garbage that programmers are known for. i should have known that

"2" + 2

is literally meaningless. no human, let alone a computer, could possibly glean what the intent of that operation is. it's literally without meaning. those are two entirely dissimilar things on either side of that operator. recognizing that they are both numbers and treating them as such would be an absurd conclusion with no rational basis. despite the fact that you could show that equation to a grade school student and reasonably expect to get a correct answer, there is no way for a machine to interpret it because it is

literally

meaningless

well its not literally meaningless, the correct answer just happens to be 52, which is probably not what a baby php "programmer" would expect. thus, a typical response of the language will be to either ask "hey when you said "2" + 2 what did you really mean to do" rather than just do whatever it wants to do

Shaggar
Apr 26, 2006

AlsoD posted:

my fun day with java today:

Java code:
String[] arrStrings = ...
List<String> strings = Arrays.asList(arrStrings); // works fine

int[] arrInts = ...
List<int>     ints = Arrays.asList(arrInts); // doesn't compile, can't have primitives in generics
List<Integer> ints = Arrays.asList(arrInts); // doesn't compile, can't autobox an array
List<int[]>   ints = Arrays.asList(arrInts); // compiles, is a list of one element which is the array
now i have to actually write a loop like it's 1995, jesus christ

IEnumerable is one of my fav things in c#

Adbot
ADBOT LOVES YOU

Malcolm XML
Aug 8, 2009

I always knew it would end like this.

Tiny Bug Child posted:

thanks forums poster Bloody, this is the exact kind of pedantic garbage that programmers are known for. i should have known that

"2" + 2

is literally meaningless. no human, let alone a computer, could possibly glean what the intent of that operation is. it's literally without meaning. those are two entirely dissimilar things on either side of that operator. recognizing that they are both numbers and treating them as such would be an absurd conclusion with no rational basis. despite the fact that you could show that equation to a grade school student and reasonably expect to get a correct answer, there is no way for a machine to interpret it because it is

literally

meaningless

is that supposed to yield "22" or 4 b/c the only way to consistently do it is make u state it every time so either "2" ++ (show 2) or (read "2") + 2

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