Najdorf
2005.08.12, 06:11 PM
I started to write a ragdoll editor and for the first time in my life I'm feeling I wrote good code, as good as possible (for me), and it was all easy and fast (amazingly).
I got my bad programming habits from TNT basic, where you just used globals for everything and simply tidied (spelling?) things up a bit wrapping up stuff in procedures (so I could at least use local variables inside procedures).
I never understood how to write decent code in C. Well, maybe I did in theory, but it looked simply a huge effort. It looked as you always had to pass in every function tons and tons of stuff. And just how sucky are those -> ? So I just sticked to the "TNTbasic" approach, knowing my code sucked but at least I could write it fast.
I finally grasped o-o programming (I think) with blitzmax, when I forced my self to use lists of objects, and writing functions which always passed inside pointers to objects. And that important functions should have a "dedicated" object so you can pass in only that object (or few) and not many. (So then you can also use it as a method). I think functions are a good criterion to make objects. And once you have good objects using pointers is sooo powerful and easy. It's really an amazing jump from using "just variables", mind blowing to feel the power.
It's amazing how using some language or another, some feauture or other changes your point of view.
I got my bad programming habits from TNT basic, where you just used globals for everything and simply tidied (spelling?) things up a bit wrapping up stuff in procedures (so I could at least use local variables inside procedures).
I never understood how to write decent code in C. Well, maybe I did in theory, but it looked simply a huge effort. It looked as you always had to pass in every function tons and tons of stuff. And just how sucky are those -> ? So I just sticked to the "TNTbasic" approach, knowing my code sucked but at least I could write it fast.
I finally grasped o-o programming (I think) with blitzmax, when I forced my self to use lists of objects, and writing functions which always passed inside pointers to objects. And that important functions should have a "dedicated" object so you can pass in only that object (or few) and not many. (So then you can also use it as a method). I think functions are a good criterion to make objects. And once you have good objects using pointers is sooo powerful and easy. It's really an amazing jump from using "just variables", mind blowing to feel the power.
It's amazing how using some language or another, some feauture or other changes your point of view.