Page 1 of 4
Code walkthroughs
Posted: Fri Aug 17, 2012 10:27 am
by Santos
Learning from other people's code is neat!
I think it would be cool to make code easier and less intimidating to read and understand by writing some "code walkthroughs", which walk the reader through some nifty code, exploring how problems were solved, explaining how the code works, giving the necessary information to understand it, et cetera!
The HTML (except for Proxy) was generated by
Locco.
Re: Code walkthroughs
Posted: Fri Aug 17, 2012 3:25 pm
by Roland_Yonaba
Holy - .
That's an impressive work...
Stickied, I'll read it after, then i'll provide some feedback.
Re: Code walkthroughs
Posted: Fri Aug 17, 2012 6:23 pm
by josefnpat
This is awesome.
I also like the changes you made.
Feel free to make a pull request. I'll accept it right away.
Re: Code walkthroughs
Posted: Fri Aug 17, 2012 9:17 pm
by Roland_Yonaba
Just read the whole thing.
And I must say, well done, Santos!
Actually, Josef's code was very clean (hence easy to figure out!).
I didn't know about that tool. That's a brilliant idea, by the way.
I may have missed it in the
Projects And Demos section.
@Santos: Maybe you will write next some other code walktroughs (would be amazing!). So, why not edit the your OP, insert a bulletlist of all of them and keep it updated ?
Re: Code walkthroughs
Posted: Mon Aug 20, 2012 6:31 pm
by josefnpat
Roland_Yonaba wrote:Just read the whole thing.
And I must say, well done, Santos!
Actually, Josef's code was very clean (hence easy to figure out!).
I didn't know about that tool. That's a brilliant idea, by the way.
I may have missed it in the
Projects And Demos section. :ultrahappy:
@Santos: Maybe you will write next some other code walktroughs (would be amazing!). So, why not edit the your OP, insert a bulletlist of all of them and keep it updated ?
I'm glad people like it. The code imo was never clean or stable enough to really justify a thread, so I never opened one.
Re: Code walkthroughs
Posted: Tue Aug 21, 2012 5:47 am
by Santos
I'm happy you two like it!
inifile.lua by bartbes has been added!
Re: Code walkthroughs
Posted: Tue Aug 21, 2012 6:05 am
by Roland_Yonaba
That's brilliant!
Some glitches, by the way. On the right side of the page, there's a weird statement to delete... just before
function inifile.save(name, t).
love.graphics.rectangle(mode, x, y, width, height)
And after that, there is a little mistake with a patten matching string.
String methods can be used on literal strings if the strings are within parentheses.
In this case, ("[s]\n"):format(section) is equivalent to string.format("[s]\m", section).
Must be replaced by:
String methods can be used on literal strings if the strings are within parentheses.
In this case, ("[%s]\n"):format(section) is equivalent to string.format("[%s]\n", section).
Once again, good job!
That could be very interesting lecures for those starting both Lua/Löve, cause there are so many things to learn from this.
Re: Code walkthroughs
Posted: Tue Aug 21, 2012 6:52 am
by Larsii30
wow this is amazing.
Really helpful and a good way to explain people like me how things work.
Good job!
Re: Code walkthroughs
Posted: Tue Aug 21, 2012 9:28 am
by Santos
Thanks so much Roland, both places have been fixed.
And thanks Larsii30, I'm glad that you like it, feel free to let me know if anything doesn't make sense or could have been explained better, or any other suggestions or critiques you have!
Re: Code walkthroughs
Posted: Tue Aug 21, 2012 9:41 am
by bartbes
That was awesome! And while I'm at it, I might as well thank you for using inifile.lua for such a great tutorial, so thanks!
One minor detail though, your
requires are wrong, you forgot to remove the extension
.