9

Potentially hot take : If you're making a video course on a tool that supports multiple languages you should show examples in a language with explicit typing whenever possible.
Weakly typed and implicitly typed languages make it harder to know what the results of a particular statement are and therefore what you can do with them.

Comments
  • 0
    Not exactly sure what the problem is but most of the properly typed languages are using type inference as best practice which would look similar to your mentioned "weakly typed" languages.
  • 1
    The reason I was careful to not say "strongly typed languages" was specifically to exclude languages with extensive use of type inference. Explicit typing communicates more information to a reader that is unfamiliar with a tool or library and so should be preferred when crafting code samples for an entry level (for the tool) class. Obviously there are caveats (when aren't there?) but it seems like a good rule of thumb to me.
  • 0
    @boostedanimal I have mixed feelings about this. On the one hand, I can see your point: Beginners might benefit from explicit type annotations.
    On the other hand, it might be counterproductive to introduce them to explicit type annotations as it might look like it’s a good idea to use them in general.

    Is it actually necessary to know the types in your context?
  • 1
    @boostedanimal nevermind, I’ve read your last post one more time and realized that my question doesn’t make sense.

    For me it’s just awkward because I can’t think of a good example where I would prefer a language which uses explicit type annotations. Especially when it comes to teaching and beginners.
  • 1
    So I think there's still a little bit of clarification needed. I was saying new to a particular tool rather than new to programming.

    I'll give the example that inspired the rant, maybe that will clarify the situation (or maybe it will earn me a down vote :). I was taking a course on Apache Spark and all of the examples were in Scala. Now maybe that's typical for a project using Spark but given that the instructor defined all of the resources first, then began querying them (putting the results into untyped vars, alternating between DataFrames and Datasets) it was hard to tell which he was working with at any given moment. Maybe it was intentional as Spark keeps the methods consistent between these types(and he wanted to make that clear), but it made me feel like I had to rewind constantly just to be certain (eventually I just pulled up the documentation and would check the method availability there).
  • 0
    @boostedanimal scala! Good lord! I certainly wasn’t expecting this one 😅
Add Comment