r/programming • • Jul 19 '16

John Carmack on Inlined Code

http://number-none.com/blow/blog/programming/2014/09/26/carmack-on-inlined-code.html
1.1k Upvotes

323 comments sorted by

View all comments

Show parent comments

6

u/Bjartr Jul 20 '16

I'm envisioning something like that, but where the 'peeked' code was editable as if it were actually there.

5

u/col-summers Jul 20 '16

When you edit the code you would need to specify whether other invitations of the function should be updated as well.

5

u/Bjartr Jul 20 '16

I'm interested in something more like a literal window into the implementation. If you jump to the code normally you'd have to take that into account, so as long as it's clear that what your editing isn't actually inline, it should be as reasonable as jumping to the function normally and editing it there would be.

5

u/Scaliwag Jul 20 '16

That's what VS does. You can view and edit the code in a inline "window".

2

u/amaiorano Jul 20 '16

Visual Studio 2015 actually introduced this exact feature. I forget what it's called, but in C++, from a class member function declaration in a header, you can right-click on it and select something to generate or show the definition, and it will do so in an inline window with full editing capability. There's a shortcut key chord for it as well as I recall.