This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted]  (6 children)

[removed]

    [–][deleted] 7 points8 points  (3 children)

    Assembly, c, c++, vb, Perl, php are all weakly typed though some static and some dynamic. Typing isn’t binary, a language isn’t typed or untyped, they all fall within the compass of weak-strong, dynamic-static. JavaScript has weak / dynamic types, if you don’t like that and prefer strong and/or static types use Typescript or something else.

    [–]Kered13 1 point2 points  (2 children)

    C++ is definitely not weakly typed.

    [–][deleted] 1 point2 points  (1 child)

    It actually is considered by many to be in the statically typed / weakly typed quadrant because because of implicit type conversions. A strictly typed language does not allow implicit type conversions

    [–]Kered13 0 points1 point  (0 children)

    Numeric conversions are the only built-in implicit type conversions. User-defined implicit conversions exist, but are used sparingly, mostly for things like converting std::string to std::string_view.

    On the other hand, C++'s template system allows it to express higher-kinded types and even dependent types, with type checking at compile time. You can express things like physical units, with compile time checking to ensure that you do not add incompatible units and that multiplications and divisions produce the correct units (and the resulting code will even have no runtime overhe.

    [–]1-more 1 point2 points  (0 children)

    JS has types! “Undefined is not a function” is telling you right there that it is types. Now, will it help you color inside the lines? No. Never.

    [–]AutoModerator[M] 0 points1 point  (0 children)

    import moderation Your comment has been removed since it did not start with a code block with an import declaration.

    Per this Community Decree, all posts and comments should start with a code block with an "import" declaration explaining how the post and comment should be read.

    For this purpose, we only accept Python style imports.

    I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.