Hacker News new | comments | show | ask | jobs | submit login

Out of curiosity, did you ever spend much time reading the code of the various frameworks on offer? Especially since you have the experience of building everything from scratch, I think you could have the same level of understanding of any frameworks you put together by browsing the code.

In Rails land at least, a lot of relatively inexperienced developers tend to have trouble when they can't google for the thing they want to implement or find it in the docs. I find that if I open up the source in roughly the area in which I need to implement something, a hook point is provided at about the right level of abstraction. Your mileage with other frameworks/environments may vary.




I jump into the Rails (or other Ruby libraries) source for understanding quite often. This is good advice, but for folks coming from static languages it's really a challenge to figure out how to find stuff. I've resorted to running it all under a debugger and setting breakpoints, just so I can find out which monkey-patch (or non-namespaced, duplicate class) is being called.


2 things in particular I use:

* Bundle comes with a `bundle open <gemname>` command that opens up the gems source code in whatever your shells $EDITOR is set to. I use this at least three or four times a day.

* Pry (an IRB alternative) will tell you the file + line of the definition of the method you'd be running if you ran `show-source some_object.some_method`. You can also `ls` and `cd` your way around ruby modules/objects which has been invaluable.


If you use Pry's `edit-method some_object.some_method`[1] you can actually open the method in an editor and it'll even fast forward the cursor to the first line of the method.

[1] https://github.com/pry/pry/wiki/Editor-integration#wiki-Edit...


Definitely check out Pry (http://pry.github.com). It's designed specifically for your use case... Just start Pry, load the gems you want, and then navigate to the method/class you want to know about using Pry's `ls` and `cd` commands. Once you find what you want, either use `show-source` to view the source directly in Pry, or use `edit-method` to open it in an editor.


Beyond a point, mastery over a particular framework comes only when you look at the actual code. Just fire up a debugger with a breakpoint set in the problem area. Figure out what happens and understand why your code is breaking. Rinse and repeat for ninja level in your framework of choice.




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact

Search: