If JS is typed by retards, what retards type about retards typing in JS? Did i broke the type system by typing about retards that type about retards typing in JS?
>>30 I used to think like that too. In fact everyone in the programming language theory used to think like that too. The only explaination is that type researchers are capable of mindcontrolling and brainwashing with their Hurry-Cowardcorrespondence
“Dynamic” languages can take more space (and allow more errors) in describing the overall filter, but it’s a conceptual space more easily traversed by folks who really don’t need to think much about their programs and who follow an operational model
In other words, "dynamic" typing is for coders who dun wanna tink too much about deir shitcode. Somehow I'm not surprised.
Name:
Anonymous2015-04-25 14:07
>>36 and while you sit there wanking to your code purity, I'll be getting shit done
>>37 Static typing is what helps get shit done, not the "I'll let the compiler ignore all the type errors so they blow up at runtime at an undefined point in the future" shit-language.
debugger invoked on a SIMPLE-TYPE-ERROR in thread ...
That, my friend, is a type error. In a unityped languge Common Lisp. And no matter how "dynamic" a language is, it will still be vulnerable to type errors, because not every value supports all possible operations.
Name:
Anonymous2015-04-25 15:53
>>35 It's a real thing, my fella /prog/rider! The Hurry-Cowardcorrespondence, that is. Whether you are aware of it or not, it's controlling your mind.
Name:
Anonymous2015-04-25 16:02
>>41 But why would you do something like that in an actual program? It doesn't make any sense.
Name:
Anonymous2015-04-25 16:10
>>43 Because you can't keep the types of everything in your head, especially if the project is big, or you're refactoring stuff.
For example, once I wrote a function where I mapped another function over a list. Then some time later I decided that this mapping action should be moved to another function lower on the call graph, but I forgot to delete the first occurence. So I was doing a perfectly type-correct map on a list, except I was doing it in twice on different levels in the call graph! A unityped language would've let this slide, and it would explode at runtime, when the execution would've gone down that particular codepath. But with Haskell, I knew of this error before the code was even recompiled, let alone run.
Name:
Anonymous2015-04-25 16:14
>>43 Let's say you have the function foo and the function bar. Is it possible to call foo(bar("anus"))? Or maybe it's possible to call bar(foo("anus"))? They could be totally incompatible, though. But with a non-unityped language, you can know that without looking at their implementations, and without running your code, hell - without even compiling anything. With a "dynamic" craplanguage, on the other hand, you're like a blind man crawling aroung on your knees.
I didn't think I would post seriously in such a /g/-ridden thread, but please refer to On understanding types, data abstraction, and polymorphism[Cardelli, Wegner 85] for a lighter-than-TAPL but thorough treatment on types and why we need them.
Name:
Anonymous2015-04-25 17:33
A type may be viewed as a set of clothes (or a suit of armor) that protects an underlying untyped representation from arbitrary or unintended use. It provides a protective covering that hides the underlying representation and constrains the way objects may interact with other objects. In an untyped system untyped objects are naked in that the underlying representation is exposed for all to see. Violating the type system involves removing the protective set of clothing and operating directly on the naked representation.
Violate my naked anus.
Name:
Anonymous2015-04-25 17:54
>>47 Queers like you will be the first to die on the day of the rope.
Name:
Anonymous2015-04-25 18:03
>>47 Very smooth reading, and at the same time informative and precise without being overly technical. Thanks.
Name:
Anonymous2015-04-25 18:14
Does /prog/ think dynamic typing has its place on some specific applications? I, for one, wouldn't use a statically typed scripting language.
Name:
Anonymous2015-04-25 18:21
>>50 It has its place below 1000 LOC, yeah. Though multi-typed languages can be used there just as well if they're interpreted.
when they try to change the entire language a project is in the second they can't immediately think of how to implement something in the language the project is already in.
Name:
Anonymous2015-05-04 18:38
when they use noob languages instead of something much more appropriate because they "don't want to make it hard for beginners to contribute"
>>71 It's not a meme. He wouldn't ask who you were quoting if you had used the feature correctly.
Name:
Anonymous2015-05-05 19:09
A friend of mine, a well known computer scientist, once said that any properly designed programming language does not need macros. I tend to agree strongly with that sentiments. Macros are hacks.
>>77 People say stuff like that, and then they go on to make parser generators, xml reader writers, coder generators, when they could have leveraged it all from the language itself.
it's less about single words/phrases, more about patterns: - blanket statements that either treat something (e.g. OOP, type safety, unit testing) like a silver bullet or condemn some features (e.g. goto, global variables, constructors) to hell - this indicates a cargo cult approach and blindly repeating of programmer memes instead of actually thinking for yourself and trying to evaluate why those things are considered good/bad and why they are/aren't appropriate in solving your problems; this is the most common with enterprise and web developers but it's not like others are immune (see: functional purity zealots banging their heads against the wall to design pure video games, pure networking and pure device drivers, not realizing that the lack of state makes those particular things counter-intuitive and inelegant) - excessive focus on design patterns and avoidance of basic language features because they're not 'robust' enough - those things might be useful in some cases but if every single thing they do requires complex layers of abstraction and indirection, maybe the language they chose simply isn't the right tool for the job - complaints about the repetitive nature or programming - if you keep doing the same shit over and over again, you're doing something wrong; either you can't use the language well enough or you're both using a boilerplate-heavy langage (e.g. java, seeples) and are unable to automate your work; automation is seriously underrated, it allows you to be more productive than co-workers while shitposting on /prog developing your own interesting projects - securityfag bonus #1 - conflating encapsulation with security - where does this meme even come from? - securityfag bonus #2 - insisting on broken crypto because it's not yet epxloitable in practice - it's not yet exploitable in practice but it will be soon, attacks are not getting worse with time
Name:
Anonymous2016-12-07 12:50
type safety
Indeed, it is not a silver bullet. It is however a golden bullet.
goto is not necessary but may be useful for low-level optimization, e.g. in kernel code. global variables are useful for stateful programs with a global state - you can put everything in scopes but it will still function like global variables.
>>86 goto considered convenient for handling error cases in a single code path within one function
Name:
Anonymous2016-12-08 14:50
>>87 Then stop using your computer as a giant state machine!
Name:
Anonymous2016-12-08 14:59
>>87 global state considered helpful for when the problem is best modelled with a state machine. emulation is an obvious example - you could write a purely functional CPU (after all you don't need state to have TC) but you'd just be designing something labyrinthine and inefficient which offers no advantages over just having state.
mfw the functional programmer imperatively writes his haskell files to the global state that is his hard disk
(^:
Name:
Anonymous2016-12-08 22:04
>>87,89-91 Any kind of system has "global state". "Global state" means the state of the whole system.
If the CPU only generates heat and doesn't do any other communication, it still has global state.
I don't think something without global state can possibly exist. Try to describe it. If you can describe it, it has global state.
Name:
Anonymous2016-12-08 23:29
I only eat kosher
Name:
Anonymous2016-12-09 0:23
>>92 slippery slope, soon you could say the evil act of writing to a file is part of global state too, because you may delete it eventually so it's akin to RAM.
you could write a purely functional CPU (after all you don't need state to have TC) but you'd just be designing something labyrinthine and inefficient which offers no advantages over just having state.
A purely functional CPU could solve the halting problem.
Name:
Anonymous2016-12-09 8:17
>>92 statelesness is an abstraction, although it's often a useful one
>>114 three line handlers by themselves are not enterprise but they're a bit of a red flag. kinda like classes which are just wrappers and layers of indirection around other classes - they add up over time until most of the code basically does nothing.