←back to thread

255 points rd07 | 1 comments | | HN request time: 0s | source
Show context
bunderbunder ◴[] No.41300249[source]
Not criticism, just thinking out loud:

This editor claims to be lightweight, citing that it uses 30MB of RAM. But I assume that's without any extensions loaded.

Back in the day, though, one joke about Emacs was that it's an acronym for Eight Megabytes All Continuously Swapping. This was meant to highlight Emacs's reputation for bloat. Right now when I run Emacs it's using a lot more than 30, let alone eight. I'm pretty sure most of that is all the modes I have installed for every language I might ever use, regardless of whether I'm actually using it right now.

About 15 years back Visual Studio had a reputation for bloat, but my experience was that it was actually quite lightweight and snappy, especially compared to Eclipse and IntelliJ. Until you install ReSharper, which transformed it into 50 tons of molasses.

At work, Visual Studio Code currently consumes about 1GB of RAM and takes 5+ minutes to start up. On my personal computer, a 2013 MacBook, it uses more like 50MB and starts darn near instantaneously. But they're very different beasts; on my MacBook I've got it configured to only load the plugins I need for each project. At work we've got a whole dang Devcontainer that includes configuration to load I-don't-know-how-many extensions, basically anything anyone on the team has ever wanted. The devcontainer extension makes you put the list of extensions to load into a file that needs to be checked into source control. So the only way for someone to get this tool they want is to make everyone else get it, too. All to sling a relatively modest volume of Python code.

And of course if I try to opt out of all of that I make my life even harder. Trying to get by without that pile of crap is just spitting in the wind. Run-time requirements aren't documented; they're shoved into an undocumented and ever-growing list of Bash commands in the Dockerfile. Coding standards aren't documented or managed with something straightforward like Git hooks; they're enforced through a plugin and its configuration.

I do remember when vscode was lightweight. It happened to be a time when not many plugins were available. That put a hard limit on just how much bloat you could accomplish. But, of course, as soon as it got popular people started creating plugins for darn near everything.

Perhaps the problem isn't the editors. Perhaps it's us.

replies(7): >>41300316 #>>41300393 #>>41300417 #>>41301052 #>>41301309 #>>41302289 #>>41303801 #
kerkeslager ◴[] No.41301052[source]
> Perhaps the problem isn't the editors. Perhaps it's us.

For coming up on a decade I've used Vim with a minimal .vimrc and no plugins. The only time I deviate from this is when I am writing in an s-expression based language. I would probably deviate from this to write Java or C#, but I haven't written either in a while.

There are upsides and downsides. The biggest upside is simply that I haven't spent ANY time learning new editors or new editor features; I'll occasionally learn about a feature of Vim that I didn't know existed, but that's very oriented toward solving immediate problems, because it tends to happen when I run into something that feels like there's probably an easier way to do it, and I'll do a quick internet search. I think a lot of devs spend a lot of time learning tools with the sense that the time spent will be paid back by time savings from using the tools, but the reality is way more hit-and-miss, and I think a lot of people could benefit from being more selective in what they spend their learning time on.

The thing that Vim completely misses is being able to jump to the appropriate file where a class/function is defined. This is more of a tradeoff than IDE folks recognize: when I was using PyCharm/IntelliJ/ReSharper, I found that being able to jump around easily would hide the fact that my projects were growing in size and complexity. The tooling makes this less painful up front, but eventually, you still feel the pain, because eventually there's some bug that cascades through a bunch of files, and you still have to reason about all of them. Finding definitions isn't the core issue with having a lot of definitions, reasoning about how they interact is the core issue, and the IDE tooling doesn't solve that. Being in Vim and having to deal with my project's file structure directly and explicitly means I feel the pain of complexity earlier, when it's easier to fix.

If I'm being honest, I'm not sure that the tradeoffs comes out in Vim's favor here. I don't think we get to have a conclusive answer because there's simply nobody who uses both vanilla Vim and the best IDEs at a high enough level to have an informed opinion about which is better. I'd say I am close because I have used both extensively, but my IDE knowledge is outdated by about a decade.

But, I've said before and I'll say again that entering text into files isn't usually the limiting factor of software development speed. If I'm mentoring a new programmer I'd rather see them learn TDD and/or how to leverage type systems and write code in Notepad, than see them write untested, unchecked code in The Best IDE/Editor Ever. Of course, there's no reason to go to those extremes.

replies(3): >>41301222 #>>41302972 #>>41347242 #
bunderbunder ◴[] No.41301222[source]
Your 3rd and last paragraphs reminded me of a feature I really like about F#: all source files in an assembly have an explicit, sequential compilation order. And you can only have references to things that had been defined earlier, either in the current file or in a file that comes earlier in the compilation order.

It makes learning and navigating a new codebase much easier. So much so that it doesn't really require IDE tooling the way it does with most mainstream languages. It's harder to get lost when you always know which way is up. Consciously thinking about whether you're doing top-down or bottom-up design also flows naturally from this, for the same reason, and that seems to encourage more thoughtful, readable code design.

Is it more work? Up-front, yes, absolutely. In the long run, though? By the time I finished my first year of CS education I had already been exposed to many many examples of cases where greedy algorithms consistently produce sub-optimal results. Perhaps they aren't teaching people about that in school anymore.

replies(2): >>41301369 #>>41302887 #
msteffen ◴[] No.41301369[source]
Wait, does F# not support mutual recursion? Can one not write eg a recursive descent parser?
replies(2): >>41301547 #>>41301582 #
Iwan-Zotow ◴[] No.41301547[source]
No, this is about single pass compiler, which makes it fast but all references to use in current file to be defined earlier
replies(2): >>41301650 #>>41301750 #
kerkeslager ◴[] No.41301650[source]
Single pass compilation can support backreferences, i.e. referencing a symbol and then defining it later, efficiently with a technique called "backpatching". All single-pass compilers I know of use backpatching for computing jumps--I'm not even aware of any other way to compute jumps. For symbols, the implementation of backpatching is a bit more complex, but it's a pretty well-known solution and I don't think it would be a significant barrier for any competent compiler developer. That is to say, if they've chosen to not support backreferences, it's not because it's hard to do in a single-pass compiler.

EDIT: The wonderful book Crafting Interpreters has an implementation of backpatching jumps to implement loops. Before anyone says "this is an interpreter, not a compiler", be aware that most modern interpreters contain a compiler. https://craftinginterpreters.com/jumping-back-and-forth.html

replies(1): >>41329410 #
1. Iwan-Zotow ◴[] No.41329410[source]
Sure, we could do some craft to work around single pass limitations, but that was Don Syme decision from long time ago, and F# folks are faithful to it.

Actually liked language a lot, thought it could replace Python as top level AI/ML tool