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

> My favourite feature, however is being able to use labels instead of line numbers.

I guess that's less of a feature and more of a necessity? Actually, this was one of the questions on my mind when I started reading the article. If you remember how those old BASIC dialects worked, you basically decided the line numbers for each line by yourself. The common strategy was to increment by 10, then you had some space to insert additional lines if needed without having to renumber everything (including the destinations of GOTOs and GOSUBs). Subroutines got line numbers in the 1000+ range so they didn't interfere with your main program (example here: https://www.c64-wiki.com/wiki/GOSUB). Of course this system would be extremely confusing in an IDE that shows the actual line numbers of the source code by default.



From a nostalgia viewpoint, adding labels feels a bit "impure". You might as well want to introduce other syntactic sugar, but at some point, you're no longer writing C64 BASIC.

But what if you had an IDE with convenient/native editing support for BASIC line numbers? It could auto-number on pressing enter, and it could have refactoring/renumbering support so that you can't miss a GOTO somewhere. But you'd always see and edit plain BASIC code. It feels like that might be fun.


That would be possible actually, but it would probably require support from the IDE for letting language plugins filter which lines are shown in the editor (which I don't think VS Code supports currently). Then the line numbers shown in the editor's gutter would be the line numbers defined in your code, and if you typed a new line starting with a line number, it could insert it at the location specified by the line number.




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

Search: