My thought process upon seeing this: "Python, huh? Seems like typos in uncommon branches of the code would cause it to randomly fail at runtime, losing your work!" "Now evmar, don't be such a internet nay-sayer, plenty of people write reliable Python code. You just need tests and... yep, there's a tests directory right there in the repository." "Let's take a look. ...there's only one test!?" It looks pretty neat othe…
Pure Python Vim clone
21–30 of 85 posts
Re: Pure Python Vim clone
#22Earlier quoted context omitted.
I am, right now, or at least two minutes ago before I started reading HN, refactoring big chunks of _my_ text editor, WordGrinder. It's a almost-pure-Lua word processor. In the process I have been writing unit tests. Previously the program didn't have any, which was really dumb. It was dumb because, in the three days I've spent doing this, I have found (and fixed) so, _so_ many bugs. And now I have a decent set of te…
Types. They Will Save You Tests™ :-)
Re: Pure Python Vim clone
#23Re: Pure Python Vim clone
#24Tried it on OS X. Everything blinks - as in blink-tag blinks. Not sure what's going on with that...
Re: Pure Python Vim clone
#25Re: Pure Python Vim clone
#26Earlier quoted context omitted.
Types. They Will Save You Tests™ :-)
Types don't tell you if the behavior is correct or not.
Re: Pure Python Vim clone
#27Re: Pure Python Vim clone
#28Earlier quoted context omitted.
Types will create a false sense of security...
Can you elaborate?
Compiles, runs, fails if i is out of bounds. Which means that you need to test the code that you write, and that even if you have 100% line coverage (or branch coverage or MC/DC coverage or...), it doesn't mean i won't get the wrong value.
People who claim that "once my C++/Haskell/Agda/whatever program compiles, I know it probably has no bugs" thus tempt others to mention "a false sense of security." (Agda might be going further than anyone else with proving that i cannot be out of bounds, AFAIK... though a generally undecidable problem will remain generally undecidable.)
Re: Pure Python Vim clone
#29Q: Why Python? A: The only alternative would be Haskell, but I still have to learn that. Wow, that would be interesting.
Hi, I once tried that, but I ran into problems with lazyness. In particular my data structure was rather simple (famous gap data structure), but editing "large" files (>1000LOC) became rather unpleasant (too big input-feedback latency). However I managed to build a _very_ basic proof-of-concept editor (no dependencies) in just a few hundreds lines of code which I could explain, but until now I was too shy to share it…
"Gets the job done in just a few hundred lines of easily-explained code" is a terrific standard to meet.
"Magic abstract Haskell-fu" cannot improve such a program very much.