7 ms·
Letters: A tiny debugging library for Ruby
- nagnatron 14y agoDidn't check the code out but it looks like p is something like: obj.tap { |x| puts x }
- djacobs 14y agoThat's the base case. It takes arguments, too, and if you give it a block, it prints out the result of the block called in the receiver's scope.
- ans 14y agoyou registered a domain for this - a couple lines of code?
- becojo 14y agoWhy not? And it's 332 lines by the way.
- ans 14y agomost of that cruft
- instakill 14y agoYou spent 30 seconds of your life for this - a pointless comment?
- ans 14y agoworthless postings should be pointed out, i believe, so that we can have quality links on the front page. this sugar coating which seems to be so popular with the hacker news community these days is not helping anyone.
- VeejayRampay 14y agoHah, gratuitous negativity, doesn't it make the world a better place?? :D
- jimrhoskins 14y agoThis looks pretty cool. At first I had the reaction that it was too simple. I didn't have patience to watch the video, so I just read the homepage. I think you should at least mention the other "letters" included in the library on the front page. It goes in depth into 'p', which makes it seem like it's all there is. Maybe name some of the other letters, and link to the API docs. Each individual piece seems pretty small and easy enough to implement, but the package as a whole seems more valuable, having all these little tools in one place. Nice work
- djacobs 14y agoThis is great feedback, thanks. I updated the docs.
- deleted 14y ago[deleted]
- FuzzyDunlop 14y agoIt looks interesting, but the screencast needs to be a bit more concise, and aimed at people who would actually use this. I made it through the first 5 minutes and gave up, because I wanted to see what the library did. I didn't want a tutorial seemingly aimed at absolute beginners, who in my mind wouldn't give two hoots about improved debugging at that stage. Had there been a shorter overview of the cool things you could do, I might have got a better impression.
- deleted 14y ago[deleted]
- egonschiele 14y agoRead the API. I had the same problem and skimmed through the API in 2 minutes.
- danso 14y agoThis is great. It's sad to say but there are coders (like me) who will write our own half-assed muck in order to half-assedly follow good procedure...or even worse, just skip procedure all together. So any well-implemented, graceful simplication can be more valuable than the library and its seemingly few lines of code at face value. Thank you for putting this together and I hope you keep improving it
- mef 14y agoWhat am I missing? I looked over the API and tried to skim through the video (10 minutes in and still no demonstration of anything in the API), but I couldn't figure out why any of the Letters functions would be preferable to just jumping into a debugger session. Anyone care to explain?
- djacobs 14y agoLetters is an abstraction layer over the ways many people detect problems with code in the real world. (I see these patterns re-emerge every day.) A debugger is part of the solution. Easy profiling and object diffing are another. Detecting how vulnerable you are to XSS attacks is yet another. When you have the power to do this inline without breaking your code apart, I think you gain productivity. In other words, these patterns are not something we should have to spend brainpower on. I probably should not have put the screencast on the front page -- it's actually about rationale and not about code examples. You can find concrete examples at http://lettersrb.com/api http://lettersrb.com/api
- waxjar 14y agoThis is great! I think I'll start using this, I'm tired of putting prettyprint statements everywhere :P
- Suan 14y agoThe problem this is trying to solve is an annoying one - so much so that I just wrote something similar a couple of weeks ago: https://github.com/suan/quick-debug https://github.com/suan/quick-debug Letters seems like a better way to do it though.
- tyok 14y agoNice, but for quick debugging I usually use pry: https://github.com/pry/pry https://github.com/pry/pry