How do you code?
When I sit down to code I usually have a pretty clear idea of how I want the program/function to work when I finish it. But I don’t just jump into it. What I normally do is start out the basics, using set variables. I then complete all the basic features, such as having the proper returns come out, or the proper fields update.
I will then make the script dynamic. Such as read all the incoming information from a database, or XML doc and that it is returning the information again to the proper place.
And then I put the polish onto the pieces such as tweaking equations, removing little bugs, making it look pretty, etc etc.
So how do you generally go about writing a script? Do you jump in with all the advance features from the start or do you do it slowly like me? Or do you have another way?
Ben said,
August 13, 2007 at 4:13 pm
I don’t really know how to describe it, but I don’t think I have as much planning as you. I work out in my head how I want the script to work, and then I dive in. Usually if I think it will be buggy, I work a bit in layers like you describe – put in the basic layer, make sure that works, put in the next layer, make sure that works, etc. But it’s not as structured of a process as you seem to describe.
Cameron said,
August 13, 2007 at 4:17 pm
I code in .NET, which is an object oriented language, so I usually need to layout the basic structure of my object model before I write any code. Methods/functions get added as needed to objects and object get refactored throughout the process based on what I thought would happen or work and what actually does happen and work.
bardicknowledge said,
August 14, 2007 at 2:44 pm
lol. I think I take things so slowly in steps like that because of my lack of experience. I have only really been doing serious coding for 6 months now.
Before that I did little things, but nothing scale I do stuff now.
Another question for ya’s. Do you try to build your script / objects as independently as possible from the script? I have been trying to script my scripts/functions/objects etc to be their now little world and then I all need to pretty much to afterwards is drag and drop.
How do you code? « Kenneth Godwin’s Weblog said,
August 19, 2007 at 4:00 pm
[...] 19th, 2007 In response to Bardic’s “How do you code?” , I’d say poorly. =) I’ve never been very good at organized, methodical action. However, [...]
Cameron said,
August 20, 2007 at 3:15 am
I abstract things for re-use as needed. I have re-usable libraries for database connectivity, I wrote some server controls I sue in my games for rendering stat bars, etc. and I made them generic enough for re-use and am re-using them.
As for other game objects/functions, just depends, I typically write in a modular fashion anyway. Long gone are the days when I would write a 1200 line function.
xalthorn said,
September 6, 2007 at 9:42 pm
I tend to throw concept code together to prove individual aspects of the bigger program. Once I know they work as expected, I break them into reusable functions and fit them into an overarching shell.