Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I opine that typeless languages are best for short programs, because one can understand 100% of the program. Typed languages are a way to manage the complexity of a larger program.

For a related example, the BASIC programming language is great for programs that fit in 24 lines (which is how many lines a glass tty displayed).



There's clearly a cost-benefit tradeoff on the spectrum of static typing. We aren't all using Coq. OTOH, the burden of "basic" static typing is very low at this point given the successes we've seen with type inference. [0]

It seems like all of the dynamically typed programming languages are pursuing (optional/gradual) static typing systems, and we've mostly moved on past "pure" dynamically typed PLs at this point. It's more about how-much and what-kind of static typing. And perhaps this depends upon your domain (e.g. Rust and its focus on memory safety while eschewing GC, which necessitates lifetime annotations).

0) I don't think type inference is a panacea. For example, it's not super helpful when you have a complex type system inferring crazy types for you, and you're stuck debugging them when the inferrer has failed.


BASIC variables are typed. BASIC was also originally designed for printing terminals, so there was no 24 line limit.

Modern BASICs are suitable for writing larger programs.

Also seen today on HN:

"I Miss Visual Basic" https://news.ycombinator.com/item?id=43988853

"The history and legacy of Visual Basic" https://news.ycombinator.com/item?id=43949855


The BASIC I used was BASIC-10 on the PDP-10 in the 70's. It wasn't much improved over the original.

The 24 line thing was a limitation of the glass tty, not BASIC.


Having functions that fit on one screen is still a good idea I think.

My point was that printing, teletype-style terminals don't have an intrinsic vertical space limit like video display terminals (and eventually the printouts can get quite long).

But now that I think about it, perhaps the designers of BASIC might have been thinking of making it easy for a beginner to spend an afternoon or two learning how to write something comparable to a short FORTRAN program that might fit on a small deck of 80 column (72 with sequence number) punched cards.


I agree, my rule of thumb is > 1k LoC is best built with statically typed languages. For 20 line programs that I don't plan to maintain for a long time, I'd hardly ever reach for Rust over Python.


Yeah, there's no reason at all for a borrow checker for 20 lines of code, unless one is experimenting with the borrow checker.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: