[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

> strongly typed fags will defend this

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 35
Thread images: 5

File: gpgc6u4cglyy.jpg (41KB, 600x384px) Image search: [Google]
gpgc6u4cglyy.jpg
41KB, 600x384px
> strongly typed fags will defend this
>>
>>61262342
?????
>>
>>61262342
The curly brace, someone could put it in the code and it would make a ton of errors.
>>
>>61262342
>TypeError: expected type post, not shitpost
>>
>>61262342
What? Stronlgy typed deosn't meen free block syntax
>>
>doesn't compile
>compiler points out the location of the open curly
>>
>>61262342
i get it, i should be motivated to work
i love OP for posting this kind of threads
>>
I don't see what strong/weak typing has to do with rogue curly braces.
>>
>>61262342
Curly braces have nothing to do with type systems.

And most things that would cause a compile error in a statically, strongly typed language would cause a runtime error or bug in a dynamically, weakly typed language, but at runtime instead, which is strictly worse in my opinion.

If you've ever had to work with a >10k line Python codebase, you'll know the pain of "what is this function being called with?" "Why did I get a can't call non-callable object error four hours into the run of the program?" "Why is this being thunked / wrapped in a 0-argument lambda?"
>>
>>61262361
This
>>
>>61262546
>And most things that would cause a compile error in a statically, strongly typed language would cause a runtime error or bug in a dynamically, weakly typed language, but at runtime instead,
a. Learn what weakly typed means, then stop using it wrongly
b. Indentation errors (and other syntax errors) are immediately caught in Python
>>
File: 1418602279341.jpg (125KB, 1024x798px) Image search: [Google]
1418602279341.jpg
125KB, 1024x798px
There is no life
in the void
only
death
>>
>>61262678
quila cuin vai xa duxto
>>
>>61262546
>using lambdas
here's your problem
>>
>>61262423
OP is retarded
>>
File: 1389627451316.png (260KB, 497x458px) Image search: [Google]
1389627451316.png
260KB, 497x458px
>>61262716
>gorgum
>>
>>61262728
Lambdas are awesome though.
>>
>>61262650
Statically typed means the type of a variable is fixed. It may be shadowed by a variable of a different type but the same name, but that's only sugar for introducing a new binding.

Strongly typed means a program will not compile if an operation between variables of two types is not explicitly allowed somewhere, in a manner that can be used by libraries, not just the core language (more or less). For instance, in Python you can add, call, call methods on, etc an instance of any class, and only at runtime will it become an error if that operation is not supported. Similarly, you can call add between a string and an integer in JavaScript, and it will only become a runtime error if the contents of the string isn't valid. But, barring type annotation features in both languages, it is impossible to declare a function that may only be called on a string, and will otherwise result in a compile time error.

You're right that I slightly misspoke, though. I meant "type checking compile error" not just "compile error", since syntax errors can be statically checked for in almost any language (barring eval).
>>
File: void.jpg (184KB, 1000x1000px) Image search: [Google]
void.jpg
184KB, 1000x1000px
>>61262678
>>
>>61262342
>strongly typed
There is no formal hierarchy between type systems.
>>
>>61262857
>Strongly typed means a program will not compile if an operation between variables of two types is not explicitly allowed somewhere
No, it doesn't, you have the Static/Dynamic and Strong/Weak axes a bit muddled. Also Python is strongly typed.
>>
>>61263007
How would you define the terms?

In my experience, people use "strongly typed" mainly to mean "statically checkable type system", and people rarely use statically vs. dynamically typed at all, or use dynamic just to mean "weak", which makes sense because dynamically typed languages are very hard to statically check.

I also believe these are the most useful definitions. If Python is strongly, dynamically typed, and C++ is strongly, statically typed, then I'd argue your definition of "strongly typed" isn't very useful, since the most important distinction is the class of errors that are caught at compile time, versus those that are caught at runtime.
>>
File: 1496665204638.gif (410KB, 154x142px) Image search: [Google]
1496665204638.gif
410KB, 154x142px
>>61262760
>
>>
>>61263101
Dynamic means the type can change at runtime. Weak means the type can change at compile time. For example, C has weak static typing.
>>
>>61263167
>type can change at compile time
I'm not exactly sure what you mean. I agree that C has static thing. In C++, like in C, you can sidestep the type system with a pointer cast, and both languages support a limited set of implicit conversions, between integer types for example (in a manner that cannot be used by libraries for other types). Yet I'd argue both languages are strongly typed, because a large class of errors are prevented by static analysis aka type checking. Ie, in C you can't pass a StructA to a function that takes a StructB, unless you explicitly sidestep the type system. Think is guaranteed by type checking. In contrast, in Python you can pass objects of any type to an arbitrary function, and only at runtime will you discover (or not discover) that you're attempting to use the objects in ways that are not supported for their type (ie, calling a non-callable).
>>
>>61263101
>>61263321
I'm sorry, I don't have the energy to explain it to you succinctly, but I urge you to use the resources available on the web to educate yourself.
>>
Curly has a submachine gun, she could easily take out some shit code.
>>
>>61262397
Funny joke
>>
>>61262342
A thread died for this.
>>
>>61263470
now thats a cop out
>>
>>61262342
What language doesn't demand any sort of code structure?
>>
>>61263666
SATAN APPROVES
>>
>>61264683
php
>>
>>61263518
>She
>>
>>61262342
are you using a compiler from 1995? this is a non-issue. go home, you fuck.
Thread posts: 35
Thread images: 5


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.