I haven't worked on Atom or Electron apps (although it's on my todo list), but does the Chromium debugger not work inside them?
How I fixed a bug in Atom
21–30 of 189 posts
Re: How I fixed a bug in Atom
#22Could be avoided if the editor had a full AST of the code instead of using regular expressions to try to make sense of it.
You could make an editor that only allows valid programs but that opens up a lot of UI problems, it was tried many times and it never took off in practice.
Re: How I fixed a bug in Atom
#23Re: How I fixed a bug in Atom
#24Having said that, probably few people would explicitly opt in to using such a plugin unless it's bundled by default to some linter.
Re: How I fixed a bug in Atom
#25"How I fixed a bug in Atom that affected almost no one, and then spent quite a lot of time writing an article about it, then wrote a title that attempted to give me more credit than I deserved" .. which is his main pass time if you see his other posts, rather than spending his effort on fixing bugs that actually affect a lot of people. I am sorry but I don't really appreciate it and have trouble getting over the misr…
Re: How I fixed a bug in Atom
#26I got to the bottom and couldn't believe that the solution chosen was to modify the regexp instead of use a for loop. He did such a great job explaining that the code is really just trying to count the number of parentheses or braces to see if they're imbalanced, that it felt the next step was "so I wrote a really simple set of loops that is fast enough on short strings and way less crazy otherwise".
Same here. Also, I don't use Atom, but looking at the expression I'm pretty sure it fails to account for strings with parentheses. The way the matching is done, it looks like it will happily count: func("some call :)") as extra closing paren. (regex101 agrees)
Re: How I fixed a bug in Atom
#27First of all, this is why people should stop adding stupid features to regular expressions. A sane regular expression implementation has no pathological cases. DFA generation can be done in O(n^2) from memory (in the absolute worst case O(n) is average), and matching can't be worse than O(m) or similar (n is the size of the regex and m the size of the string). When you add features like back references and recursive…
Re: How I fixed a bug in Atom
#28"How I fixed a bug in Atom that affected almost no one, and then spent quite a lot of time writing an article about it, then wrote a title that attempted to give me more credit than I deserved" .. which is his main pass time if you see his other posts, rather than spending his effort on fixing bugs that actually affect a lot of people. I am sorry but I don't really appreciate it and have trouble getting over the misr…
Also, I think you're being rather rude.
Nobody forces you to read whatever the OP posts, much less dig up the history to see if you agree with how he chooses to spend his time or not.
Re: How I fixed a bug in Atom
#29First of all, this is why people should stop adding stupid features to regular expressions. A sane regular expression implementation has no pathological cases. DFA generation can be done in O(n^2) from memory (in the absolute worst case O(n) is average), and matching can't be worse than O(m) or similar (n is the size of the regex and m the size of the string). When you add features like back references and recursive…
I don't always want to spend insane amounts of time writing full AST parsers. Sometimes it is a lot easier to write a simple, hacky, throwaway regex. It's a bit much to claim that backtracking regular expressions, a very useful tool sometimes, should never ever be used and everybody should waste loads of time writing careful code even in situations where it isn't required. The problem is not the tool. The problem is…
Re: How I fixed a bug in Atom
#30"How I fixed a bug in Atom that affected almost no one, and then spent quite a lot of time writing an article about it, then wrote a title that attempted to give me more credit than I deserved" .. which is his main pass time if you see his other posts, rather than spending his effort on fixing bugs that actually affect a lot of people. I am sorry but I don't really appreciate it and have trouble getting over the misr…
Well I do, and I found the article fascinating, so I'm glad your opinion isn't the only one that matters on Hacker News.