News for hackers. Stuff that matters.

Ask HN: Anyone ever come back _to_ strongly typed languages?

I'm originally a C# developer, back in 2005.

I moved to Rails a long time ago, and recently (4 years ago) moved to Elixir.

With dotnet core, I gave it a shot and it was pretty refreshing and comforting to have the safety of types in my language again.

Has anyone here moved back to a typed language successfully? I'm seriously flirting with C# dotnet core.

( 12 comments | 10 points | on HN )
Re:Ask HN: Anyone ever come back _to_ strongly typed languages? by SamReidHughes on Friday September 20, 2019 @11:42PM (#21033351)
I've found TS a huge win over JS.

The only reason people didn't use statically typed languages in some of the recent past was because they sucked.

Part of the reason is, it's a lot easier to play with handy ergonomic features with a dynamically typed language (especially if you don't know the right stuff). So dynamically typed languages took a lead for a while.

Re:Ask HN: Anyone ever come back _to_ strongly typed languages? by cpursley on Saturday September 21, 2019 @01:06PM (#21036484)
With your C# and Elixir functional programming backgrounds, you may want to check out F#:

- https://fsharp.org/about/index.html

- https://fsharpforfunandprofit.com/why-use-fsharp/

Re:Ask HN: Anyone ever come back _to_ strongly typed languages? by BWStearns on Sunday September 22, 2019 @02:13PM (#21042903)
Went from Python to Haskell. About to head back to Python for new work, but I will miss the hell out of the type system. Yeah the ecosystem isn't quite up to snuff in Haskell but man does it cut down on bugs. Hopefully the QoL libraries continue to evolve and eventually it becomes a no-brainer.
Re:Ask HN: Anyone ever come back _to_ strongly typed languages? by valand on Saturday September 21, 2019 @12:11AM (#21033460)
Do you mean statically typed? People often mistake static typing for strong typing and vice versa.

https://en.m.wikipedia.org/wiki/Strong_and_weak_typing

As for static typing, I moved to TS from JS and will never go back for big projects.

Re:Ask HN: Anyone ever come back _to_ strongly typed languages? by Nicksil on Sunday September 22, 2019 @04:04AM (#21040225)
Re:Ask HN: Anyone ever come back _to_ strongly typed languages? by karterk on Friday September 20, 2019 @10:45PM (#21033167)
raises hands

Most of my early carrier involved PHP, JavaScript and Python. I started appreciating type systems only when I began working on larger code bases. Types might slow you down initially but I personally find it very comforting to have that extra safety once the codebase crosses a certain size.

Most of the bad rep that statically typed languages get are from a bygone era that involved a lot of typing. That has changed a lot now. With better IDEs and languages with implicit type inference, it's a lot less verbose these days.

I have been writing a search engine in C++ (https://github.com/typesense/typesense/) and even C++ with the auto keyword and Clion IDE is no longer as verbose. And type safety has saved so many potential bugs.

However, for web development though, there are far less options. I hope more dynamically typed languages allow optional types in future. That's where the world is heading towards.

Re:Ask HN: Anyone ever come back _to_ strongly typed languages? by srijanshetty on Saturday September 21, 2019 @06:59AM (#21034593)
I think developers all over are converging on the idea that we need type safety. Python has typing now, TS is JS with typing (pardon me for the oversimplification), and golang which is taking the world by a storm is a statically typed language.

Also, ease of typing has come a long way today with Type Inference in most languages with C++ leading the way with auto keyword and Java implementing local type inference.

Looks like we're Going back to the Future with static typing.

Re:Ask HN: Anyone ever come back _to_ strongly typed languages? by tcbasche on Sunday September 22, 2019 @06:18PM (#21044343)
Python doesn't _really_ have typing though. It's more a method of documentation really (right now, anyway)

edit: to clarify, I wouldn't say the type hints put Python in the realm of a statically typed lang (how could it ..) but it's a step in the right direction.

Re:Ask HN: Anyone ever come back _to_ strongly typed languages? by TheThickOfIt on Saturday September 21, 2019 @06:32AM (#21034527)
I personally prefer strongly typed languages for almost everything except the most basic of scripts. In my opinion it's very little overhead and helps me keep track of what I'm working with.
Re:Ask HN: Anyone ever come back _to_ strongly typed languages? by imhoguy on Saturday September 21, 2019 @11:56AM (#21036057)
Python and Ruby are dynamic and strongly typed. Possibly you meant static typing.
Re:Ask HN: Anyone ever come back _to_ strongly typed languages? by verdverm on Friday September 20, 2019 @11:03PM (#21033215)
Not so much back, but use both daily. Mainly Golang, JS/TS,prefer typed languages bfor production, dynamic for early work.
Re:Ask HN: Anyone ever come back _to_ strongly typed languages? by UK-Al05 on Saturday September 21, 2019 @10:56AM (#21035717)
I never left