Re: [Flashcoders] Faster code?
I'd rather rewrite code any-day then fix someone else's... i'd be willing to wager that i'm saving time too. I comment my code a bit, but i only take the time to do any docs if a client feels very strongly about it. On Dec 21, 2005, at 6:19 PM, JesterXL wrote: I just re-write. Everytime I'm asked to port old code, it's usually in AS1, or AS1 that masquareades as AS2, or is so messed up, it needs to be re-written anyway. Additionally, half of those projects are upgrade from AS1 to AS2 or Flash to Flex. If Flash stops changing, and the code that keeps getting thrown at me actually works for a change and is malleable, then I could see the point of commenting. Currently, nope. - Original Message - From: Judah Frangipane [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: Wednesday, December 21, 2005 6:10 PM Subject: Re: [Flashcoders] Faster code? This happens all too often. As common as this is, it is something you *must* do. Especially if you are the person that has to go back and change stuff at a later date. I dont know how many times I have gone back and looked at my code and I was like, what the (explicitive deleted) was I doing. Now I write code for readability. // bad (IMHO) if (getIsTrue(myTest)) { return (10/2 + 5)/mc._x; } // good var isSomethingTrue = getIsTrue(myTest) if (isSomethingTrue) { var retVal = (10/2 + 5)/mc._x; return retVal; } Trust me dude, I am having to rewrite an asp app in flash remoting asp.net and none of the code is commented. So I have spent 3/4ths of my time trying to interprit another persons code and the other half writing a flash remoting version of it. Readability is more important than speed (IMHO). Either way comment. :) Judah JesterXL wrote: What I want to know is who is paying for #2? Very rarely do I ever get time to comment anything, and even if I did, the code I commented changes the next day, rendering the whole endeavor fruitless. ...not to mention most service work is always a custom job/rewrite anyway. - Original Message - From: Paul BH [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: Wednesday, December 21, 2005 4:49 PM Subject: Re: [Flashcoders] Faster code? I think these are all great, but if I can be the voice of caution for a moment... remember that when you write code, it is for 2 interpreters: 1) the Actionscript VM 2) the person who has to go back and change stuff at a later date, which may or may not be you... Its often very easy to forget number 2 - so, while writing doing things like avoiding function calls may be faster for 1) it can end up making things a lot slower for 2) Also, when you go through your code optimise it, make sure you are efficient with your efforts - you will probably find you can nail down key performance spikes to just a few functions / algorithms... be careful not to optimise to death, and try and measure your gains at each step I'm not saying code shouldnt be optimised at the expense of (human) readability, just that sometimes it gets a little overdone... ta PBH On 12/21/05, Steven Sacks [EMAIL PROTECTED] wrote: the fastest loop through an array is: var len = myArray.length; while( len-- ) { ... } yes, it's faster then for..in. Not always. Sometimes, this loop is faster than a while (i--) for (var i = items.length; --i - (-1); ) { ... } It's ugly, yes, but it is faster than while (i--) depending on how many items you're iterating through. Run some tests if you don't believe me. :) ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Faster code?
Just to those that are reading this thread and wondering if writing neat documented code for clients (and payed for by clients) is an illusion, my 2 cents: we've been working on a project (complete virtual learning city) in flash in which the client didnt really know what he wanted up front, which we tackled using a usecase-development/prototyping approach. The object oriented design was by large thought up up front, the conversion of this design to AS2.0 was done bit by bit, using unit testing etc. All the while the specs where changing and we made this-phase/next-phase choices and did a small impact analysis for most of them. During implementation most of the code was being documented already (during or upfront), not using obvious what-does-this-button-do comments, but WHY-does-this-button-do-what-it-does comments. The internals workings may change, but why-it-does-what-it-does usually doesnt. The client now requested ALL documentation to be delivered as a separate product, most of which is already present and includes functional docs, technical docs, source docs, readers, etc. This product will run for a number of years, currently 4 virtual casestudies have been implemented and 50 more will be required over the next few years (casestudy == adventure game). A number of people are working on this project together, ussually not having a clue what the other one does, they just agree on a common interface for example between client and server (which is documented by examples mostly). Lots of changes will probably be required, but since the code is modular, its clean (99,9%) and well documented, we can analyse what has to be refactored and what doesnt need to be. This is not to start up the discussion again whether or not to document your code, just to tell you that almost all our clients (our company has about 50 ppl and a lot of clients) request a solid design, solid documentation and a copy of the sourcecode. Internally we are all expected to have a high standard and work on increasing this standard even further (for example by reading books such as 'code complete', taking certifications, studying oo development). This is the same for java, php, AS1, AS2, visual basic or c++ developers. Does the way we work slow us down? No. Does the way we work cost us clients? Nope. Does everything need to be documented? No ofcourse not. Is this approach applicable to all types of projects? Nope. Will we hire someone who is fast but does not document his crappy code, again? We surely wont, and we know becoz we review his code after each project. I do think lots of the arguments given here against documenting are just excuses in order not to have to, or a lack of skill in the oo design area. Rewriting and rewriting and rewriting (with or without documentation) should make warnings bells go off in your head, with or without someone paying for it. Can I do the same very cool things all the non-documenting-guru/hackers do? Nah unfortunately not, but thats beside the point ;). When it comes down to it, I agree you have to pragmatic when coding, not everything we do has to have an academic standard, but you shouldn't grab every opportunity to write crappy code with both hands either. Just my 2 cents... H At 08:51 AM 12/23/2005, you wrote: I think it reflects the nature of flash and its history. Not to mention the diverse skillset of its developer-base. A lot of people learned to write code in Flash, and the question of whether they are doing it the right way or not is debatable. In other words, as flash becomes a real software development platform, real development methodologies will become more important. That's really what it comes down to. As you start building longer-term projects and using standardized methodologies, these things start to become more important. I still do the occasional one-off animation or ad, but that's not where I spend the majority of my time these days. ryanm ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Faster code?
I'm so glad I opened such a juicy can of worms just before Christmas ;) I just want to throw one more thing into the mix before I dissappear off to numb my family reunion with hefty doses of alcohol... So, now I think my comments before about, erm comments still stand. I see comments differently to documentation, so I'll just add my tuppence to this and retire to eat drink be merry... I think some (many)? people dont document because they cant be arsed. Why is this the case? We'll, again, I think it comes down to changing requirements, and the fact that I hate having the same information in two places, as at some point one will get out of date... How to manage this, and at the same time make your code easy to understand? This is how we are approaching it / looking to approach it... 1) Documentation of individual methods within classes is done using ASDoc which gets triggered whenever a file gets checked into source control -- your documentataion is generated from your class file, and is *always* up to date with your checked in class file... 2) We are looking into using a thing called FIT (http://fit.c2.com/) What this does is tie in business requirements with unit tests. The business (ie the client) basically write their specifications (or are assisted with it) in a word document. wherever a table is encountered, this is interpreted by FIT as a unit test, and the test builder writes a fixture to accomodate that test... What this means is that you are documenting your business logic in one place (rather than both a specs document and a slew of unit tests) For me, the underlying principle is this -- DONT REPEAT YOURSELF -- it'll save you a whole truckload of hassles down the road... Pxx On 12/23/05, Hans Wichman [EMAIL PROTECTED] wrote: Just to those that are reading this thread and wondering if writing neat documented code for clients (and payed for by clients) is an illusion, my 2 cents: we've been working on a project (complete virtual learning city) in flash in which the client didnt really know what he wanted up front, which we tackled using a usecase-development/prototyping approach. The object oriented design was by large thought up up front, the conversion of this design to AS2.0 was done bit by bit, using unit testing etc. All the while the specs where changing and we made this-phase/next-phase choices and did a small impact analysis for most of them. During implementation most of the code was being documented already (during or upfront), not using obvious what-does-this-button-do comments, but WHY-does-this-button-do-what-it-does comments. The internals workings may change, but why-it-does-what-it-does usually doesnt. The client now requested ALL documentation to be delivered as a separate product, most of which is already present and includes functional docs, technical docs, source docs, readers, etc. This product will run for a number of years, currently 4 virtual casestudies have been implemented and 50 more will be required over the next few years (casestudy == adventure game). A number of people are working on this project together, ussually not having a clue what the other one does, they just agree on a common interface for example between client and server (which is documented by examples mostly). Lots of changes will probably be required, but since the code is modular, its clean (99,9%) and well documented, we can analyse what has to be refactored and what doesnt need to be. This is not to start up the discussion again whether or not to document your code, just to tell you that almost all our clients (our company has about 50 ppl and a lot of clients) request a solid design, solid documentation and a copy of the sourcecode. Internally we are all expected to have a high standard and work on increasing this standard even further (for example by reading books such as 'code complete', taking certifications, studying oo development). This is the same for java, php, AS1, AS2, visual basic or c++ developers. Does the way we work slow us down? No. Does the way we work cost us clients? Nope. Does everything need to be documented? No ofcourse not. Is this approach applicable to all types of projects? Nope. Will we hire someone who is fast but does not document his crappy code, again? We surely wont, and we know becoz we review his code after each project. I do think lots of the arguments given here against documenting are just excuses in order not to have to, or a lack of skill in the oo design area. Rewriting and rewriting and rewriting (with or without documentation) should make warnings bells go off in your head, with or without someone paying for it. Can I do the same very cool things all the non-documenting-guru/hackers do? Nah unfortunately not, but thats beside the point ;). When it comes down to it, I agree you have to pragmatic when coding, not everything we do has to have an academic standard, but you shouldn't grab
Re: [Flashcoders] Faster code?
1. ASDoc just generates comments from your code. If your code comments aren't up to date, neither is your generated asdocs. 2. If you could coerce a client to sign a document saying that business requirements never change... hell dude, I'm hiring you fulltime to work for me! - Original Message - From: Paul BH [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: Friday, December 23, 2005 10:31 AM Subject: Re: [Flashcoders] Faster code? I'm so glad I opened such a juicy can of worms just before Christmas ;) I just want to throw one more thing into the mix before I dissappear off to numb my family reunion with hefty doses of alcohol... So, now I think my comments before about, erm comments still stand. I see comments differently to documentation, so I'll just add my tuppence to this and retire to eat drink be merry... I think some (many)? people dont document because they cant be arsed. Why is this the case? We'll, again, I think it comes down to changing requirements, and the fact that I hate having the same information in two places, as at some point one will get out of date... How to manage this, and at the same time make your code easy to understand? This is how we are approaching it / looking to approach it... 1) Documentation of individual methods within classes is done using ASDoc which gets triggered whenever a file gets checked into source control -- your documentataion is generated from your class file, and is *always* up to date with your checked in class file... 2) We are looking into using a thing called FIT (http://fit.c2.com/) What this does is tie in business requirements with unit tests. The business (ie the client) basically write their specifications (or are assisted with it) in a word document. wherever a table is encountered, this is interpreted by FIT as a unit test, and the test builder writes a fixture to accomodate that test... What this means is that you are documenting your business logic in one place (rather than both a specs document and a slew of unit tests) For me, the underlying principle is this -- DONT REPEAT YOURSELF -- it'll save you a whole truckload of hassles down the road... Pxx On 12/23/05, Hans Wichman [EMAIL PROTECTED] wrote: Just to those that are reading this thread and wondering if writing neat documented code for clients (and payed for by clients) is an illusion, my 2 cents: we've been working on a project (complete virtual learning city) in flash in which the client didnt really know what he wanted up front, which we tackled using a usecase-development/prototyping approach. The object oriented design was by large thought up up front, the conversion of this design to AS2.0 was done bit by bit, using unit testing etc. All the while the specs where changing and we made this-phase/next-phase choices and did a small impact analysis for most of them. During implementation most of the code was being documented already (during or upfront), not using obvious what-does-this-button-do comments, but WHY-does-this-button-do-what-it-does comments. The internals workings may change, but why-it-does-what-it-does usually doesnt. The client now requested ALL documentation to be delivered as a separate product, most of which is already present and includes functional docs, technical docs, source docs, readers, etc. This product will run for a number of years, currently 4 virtual casestudies have been implemented and 50 more will be required over the next few years (casestudy == adventure game). A number of people are working on this project together, ussually not having a clue what the other one does, they just agree on a common interface for example between client and server (which is documented by examples mostly). Lots of changes will probably be required, but since the code is modular, its clean (99,9%) and well documented, we can analyse what has to be refactored and what doesnt need to be. This is not to start up the discussion again whether or not to document your code, just to tell you that almost all our clients (our company has about 50 ppl and a lot of clients) request a solid design, solid documentation and a copy of the sourcecode. Internally we are all expected to have a high standard and work on increasing this standard even further (for example by reading books such as 'code complete', taking certifications, studying oo development). This is the same for java, php, AS1, AS2, visual basic or c++ developers. Does the way we work slow us down? No. Does the way we work cost us clients? Nope. Does everything need to be documented? No ofcourse not. Is this approach applicable to all types of projects? Nope. Will we hire someone who is fast but does not document his crappy code, again? We surely wont, and we know becoz we review his code after each project. I do think lots of the arguments given here against documenting are just excuses in order
Re: [Flashcoders] Faster code?
1) I agree, that's why back to my earlier thing, I rarely comment - what ASDoc does do however is provide a way of displaying things like your method signature in a friendly HTML like manner, with a handy index down the side. When I do comment, it would be to explain some hackery, or something that wasnt obvious - within a function, this wouldnt get picked up, if it was something like a paramenter only being in an allowable range, I would comment that in a way that ASDoc picks up... 2)Hehe if I couldnt do that, it would be nirvana-esque... I never said that this document wouldnt change - the key thing here is to make sure that the change is captured in one place and one place alone... ie - when business changes the specification, this is reflected in my unit tests (as they are one the same document), and thus my test suite know about it straight away... On 12/23/05, JesterXL [EMAIL PROTECTED] wrote: 1. ASDoc just generates comments from your code. If your code comments aren't up to date, neither is your generated asdocs. 2. If you could coerce a client to sign a document saying that business requirements never change... hell dude, I'm hiring you fulltime to work for me! - Original Message - From: Paul BH [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: Friday, December 23, 2005 10:31 AM Subject: Re: [Flashcoders] Faster code? I'm so glad I opened such a juicy can of worms just before Christmas ;) I just want to throw one more thing into the mix before I dissappear off to numb my family reunion with hefty doses of alcohol... So, now I think my comments before about, erm comments still stand. I see comments differently to documentation, so I'll just add my tuppence to this and retire to eat drink be merry... I think some (many)? people dont document because they cant be arsed. Why is this the case? We'll, again, I think it comes down to changing requirements, and the fact that I hate having the same information in two places, as at some point one will get out of date... How to manage this, and at the same time make your code easy to understand? This is how we are approaching it / looking to approach it... 1) Documentation of individual methods within classes is done using ASDoc which gets triggered whenever a file gets checked into source control -- your documentataion is generated from your class file, and is *always* up to date with your checked in class file... 2) We are looking into using a thing called FIT (http://fit.c2.com/) What this does is tie in business requirements with unit tests. The business (ie the client) basically write their specifications (or are assisted with it) in a word document. wherever a table is encountered, this is interpreted by FIT as a unit test, and the test builder writes a fixture to accomodate that test... What this means is that you are documenting your business logic in one place (rather than both a specs document and a slew of unit tests) For me, the underlying principle is this -- DONT REPEAT YOURSELF -- it'll save you a whole truckload of hassles down the road... Pxx On 12/23/05, Hans Wichman [EMAIL PROTECTED] wrote: Just to those that are reading this thread and wondering if writing neat documented code for clients (and payed for by clients) is an illusion, my 2 cents: we've been working on a project (complete virtual learning city) in flash in which the client didnt really know what he wanted up front, which we tackled using a usecase-development/prototyping approach. The object oriented design was by large thought up up front, the conversion of this design to AS2.0 was done bit by bit, using unit testing etc. All the while the specs where changing and we made this-phase/next-phase choices and did a small impact analysis for most of them. During implementation most of the code was being documented already (during or upfront), not using obvious what-does-this-button-do comments, but WHY-does-this-button-do-what-it-does comments. The internals workings may change, but why-it-does-what-it-does usually doesnt. The client now requested ALL documentation to be delivered as a separate product, most of which is already present and includes functional docs, technical docs, source docs, readers, etc. This product will run for a number of years, currently 4 virtual casestudies have been implemented and 50 more will be required over the next few years (casestudy == adventure game). A number of people are working on this project together, ussually not having a clue what the other one does, they just agree on a common interface for example between client and server (which is documented by examples mostly). Lots of changes will probably be required, but since the code is modular, its clean (99,9%) and well documented, we can analyse what has to be refactored and what doesnt need to be. This is not to start
Re: [Flashcoders] Faster code?
Oh yeah definatly. Even though Natural Doc's syntax feels more straightforward, ASDoc definately has the most beautiful output that I've seen to date. - Original Message - From: Paul BH [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: Friday, December 23, 2005 10:53 AM Subject: Re: [Flashcoders] Faster code? 1) I agree, that's why back to my earlier thing, I rarely comment - what ASDoc does do however is provide a way of displaying things like your method signature in a friendly HTML like manner, with a handy index down the side. When I do comment, it would be to explain some hackery, or something that wasnt obvious - within a function, this wouldnt get picked up, if it was something like a paramenter only being in an allowable range, I would comment that in a way that ASDoc picks up... 2)Hehe if I couldnt do that, it would be nirvana-esque... I never said that this document wouldnt change - the key thing here is to make sure that the change is captured in one place and one place alone... ie - when business changes the specification, this is reflected in my unit tests (as they are one the same document), and thus my test suite know about it straight away... On 12/23/05, JesterXL [EMAIL PROTECTED] wrote: 1. ASDoc just generates comments from your code. If your code comments aren't up to date, neither is your generated asdocs. 2. If you could coerce a client to sign a document saying that business requirements never change... hell dude, I'm hiring you fulltime to work for me! - Original Message - From: Paul BH [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: Friday, December 23, 2005 10:31 AM Subject: Re: [Flashcoders] Faster code? I'm so glad I opened such a juicy can of worms just before Christmas ;) I just want to throw one more thing into the mix before I dissappear off to numb my family reunion with hefty doses of alcohol... So, now I think my comments before about, erm comments still stand. I see comments differently to documentation, so I'll just add my tuppence to this and retire to eat drink be merry... I think some (many)? people dont document because they cant be arsed. Why is this the case? We'll, again, I think it comes down to changing requirements, and the fact that I hate having the same information in two places, as at some point one will get out of date... How to manage this, and at the same time make your code easy to understand? This is how we are approaching it / looking to approach it... 1) Documentation of individual methods within classes is done using ASDoc which gets triggered whenever a file gets checked into source control -- your documentataion is generated from your class file, and is *always* up to date with your checked in class file... 2) We are looking into using a thing called FIT (http://fit.c2.com/) What this does is tie in business requirements with unit tests. The business (ie the client) basically write their specifications (or are assisted with it) in a word document. wherever a table is encountered, this is interpreted by FIT as a unit test, and the test builder writes a fixture to accomodate that test... What this means is that you are documenting your business logic in one place (rather than both a specs document and a slew of unit tests) For me, the underlying principle is this -- DONT REPEAT YOURSELF -- it'll save you a whole truckload of hassles down the road... Pxx On 12/23/05, Hans Wichman [EMAIL PROTECTED] wrote: Just to those that are reading this thread and wondering if writing neat documented code for clients (and payed for by clients) is an illusion, my 2 cents: we've been working on a project (complete virtual learning city) in flash in which the client didnt really know what he wanted up front, which we tackled using a usecase-development/prototyping approach. The object oriented design was by large thought up up front, the conversion of this design to AS2.0 was done bit by bit, using unit testing etc. All the while the specs where changing and we made this-phase/next-phase choices and did a small impact analysis for most of them. During implementation most of the code was being documented already (during or upfront), not using obvious what-does-this-button-do comments, but WHY-does-this-button-do-what-it-does comments. The internals workings may change, but why-it-does-what-it-does usually doesnt. The client now requested ALL documentation to be delivered as a separate product, most of which is already present and includes functional docs, technical docs, source docs, readers, etc. This product will run for a number of years, currently 4 virtual casestudies have been implemented and 50 more will be required over the next few years (casestudy == adventure game). A number of people are working on this project together, ussually
RE: [Flashcoders] Faster code?
Where can I get ASDoc? Google seems pretty ignorant of it - at least as a product or software tool. Or is it an internal-only product Adobe uses? Or is it simply a Macromedia standardized HTML format for help content? Jason Merrill | E-Learning Solutions | icfconsulting.com -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of JesterXL Sent: Friday, December 23, 2005 10:56 AM To: Flashcoders mailing list Subject: Re: [Flashcoders] Faster code? Oh yeah definatly. Even though Natural Doc's syntax feels more straightforward, ASDoc definately has the most beautiful output that I've seen to date. - Original Message - From: Paul BH [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: Friday, December 23, 2005 10:53 AM Subject: Re: [Flashcoders] Faster code? 1) I agree, that's why back to my earlier thing, I rarely comment - what ASDoc does do however is provide a way of displaying things like your method signature in a friendly HTML like manner, with a handy index down the side. When I do comment, it would be to explain some hackery, or something that wasnt obvious - within a function, this wouldnt get picked up, if it was something like a paramenter only being in an allowable range, I would comment that in a way that ASDoc picks up... 2)Hehe if I couldnt do that, it would be nirvana-esque... I never said that this document wouldnt change - the key thing here is to make sure that the change is captured in one place and one place alone... ie - when business changes the specification, this is reflected in my unit tests (as they are one the same document), and thus my test suite know about it straight away... On 12/23/05, JesterXL [EMAIL PROTECTED] wrote: 1. ASDoc just generates comments from your code. If your code comments aren't up to date, neither is your generated asdocs. 2. If you could coerce a client to sign a document saying that business requirements never change... hell dude, I'm hiring you fulltime to work for me! - Original Message - From: Paul BH [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: Friday, December 23, 2005 10:31 AM Subject: Re: [Flashcoders] Faster code? I'm so glad I opened such a juicy can of worms just before Christmas ;) I just want to throw one more thing into the mix before I dissappear off to numb my family reunion with hefty doses of alcohol... So, now I think my comments before about, erm comments still stand. I see comments differently to documentation, so I'll just add my tuppence to this and retire to eat drink be merry... I think some (many)? people dont document because they cant be arsed. Why is this the case? We'll, again, I think it comes down to changing requirements, and the fact that I hate having the same information in two places, as at some point one will get out of date... How to manage this, and at the same time make your code easy to understand? This is how we are approaching it / looking to approach it... 1) Documentation of individual methods within classes is done using ASDoc which gets triggered whenever a file gets checked into source control -- your documentataion is generated from your class file, and is *always* up to date with your checked in class file... 2) We are looking into using a thing called FIT (http://fit.c2.com/) What this does is tie in business requirements with unit tests. The business (ie the client) basically write their specifications (or are assisted with it) in a word document. wherever a table is encountered, this is interpreted by FIT as a unit test, and the test builder writes a fixture to accomodate that test... What this means is that you are documenting your business logic in one place (rather than both a specs document and a slew of unit tests) For me, the underlying principle is this -- DONT REPEAT YOURSELF -- it'll save you a whole truckload of hassles down the road... Pxx On 12/23/05, Hans Wichman [EMAIL PROTECTED] wrote: Just to those that are reading this thread and wondering if writing neat documented code for clients (and payed for by clients) is an illusion, my 2 cents: we've been working on a project (complete virtual learning city) in flash in which the client didnt really know what he wanted up front, which we tackled using a usecase-development/prototyping approach. The object oriented design was by large thought up up front, the conversion of this design to AS2.0 was done bit by bit, using unit testing etc. All the while the specs where changing and we made this-phase/next-phase choices and did a small impact analysis for most of them. During implementation most of the code was being documented already (during or upfront), not using obvious what-does-this-button-do comments, but WHY-does-this-button-do-what-it-does comments. The internals workings may
Re: [Flashcoders] Faster code?
this is the tool I meant - visDoc / ASDoc were these once the same? cant remember... Im having a slow day... http://www.visiblearea.com/visdoc/ On 12/23/05, Merrill, Jason [EMAIL PROTECTED] wrote: Where can I get ASDoc? Google seems pretty ignorant of it - at least as a product or software tool. Or is it an internal-only product Adobe uses? Or is it simply a Macromedia standardized HTML format for help content? Jason Merrill | E-Learning Solutions | icfconsulting.com -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of JesterXL Sent: Friday, December 23, 2005 10:56 AM To: Flashcoders mailing list Subject: Re: [Flashcoders] Faster code? Oh yeah definatly. Even though Natural Doc's syntax feels more straightforward, ASDoc definately has the most beautiful output that I've seen to date. - Original Message - From: Paul BH [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: Friday, December 23, 2005 10:53 AM Subject: Re: [Flashcoders] Faster code? 1) I agree, that's why back to my earlier thing, I rarely comment - what ASDoc does do however is provide a way of displaying things like your method signature in a friendly HTML like manner, with a handy index down the side. When I do comment, it would be to explain some hackery, or something that wasnt obvious - within a function, this wouldnt get picked up, if it was something like a paramenter only being in an allowable range, I would comment that in a way that ASDoc picks up... 2)Hehe if I couldnt do that, it would be nirvana-esque... I never said that this document wouldnt change - the key thing here is to make sure that the change is captured in one place and one place alone... ie - when business changes the specification, this is reflected in my unit tests (as they are one the same document), and thus my test suite know about it straight away... On 12/23/05, JesterXL [EMAIL PROTECTED] wrote: 1. ASDoc just generates comments from your code. If your code comments aren't up to date, neither is your generated asdocs. 2. If you could coerce a client to sign a document saying that business requirements never change... hell dude, I'm hiring you fulltime to work for me! - Original Message - From: Paul BH [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: Friday, December 23, 2005 10:31 AM Subject: Re: [Flashcoders] Faster code? I'm so glad I opened such a juicy can of worms just before Christmas ;) I just want to throw one more thing into the mix before I dissappear off to numb my family reunion with hefty doses of alcohol... So, now I think my comments before about, erm comments still stand. I see comments differently to documentation, so I'll just add my tuppence to this and retire to eat drink be merry... I think some (many)? people dont document because they cant be arsed. Why is this the case? We'll, again, I think it comes down to changing requirements, and the fact that I hate having the same information in two places, as at some point one will get out of date... How to manage this, and at the same time make your code easy to understand? This is how we are approaching it / looking to approach it... 1) Documentation of individual methods within classes is done using ASDoc which gets triggered whenever a file gets checked into source control -- your documentataion is generated from your class file, and is *always* up to date with your checked in class file... 2) We are looking into using a thing called FIT (http://fit.c2.com/) What this does is tie in business requirements with unit tests. The business (ie the client) basically write their specifications (or are assisted with it) in a word document. wherever a table is encountered, this is interpreted by FIT as a unit test, and the test builder writes a fixture to accomodate that test... What this means is that you are documenting your business logic in one place (rather than both a specs document and a slew of unit tests) For me, the underlying principle is this -- DONT REPEAT YOURSELF -- it'll save you a whole truckload of hassles down the road... Pxx On 12/23/05, Hans Wichman [EMAIL PROTECTED] wrote: Just to those that are reading this thread and wondering if writing neat documented code for clients (and payed for by clients) is an illusion, my 2 cents: we've been working on a project (complete virtual learning city) in flash in which the client didnt really know what he wanted up front, which we tackled using a usecase-development/prototyping approach. The object oriented design was by large thought up up front, the conversion of this design to AS2.0 was done bit by bit, using unit testing etc. All the while the specs where
RE: [Flashcoders] Faster code?
Thanks. Jason Merrill | E-Learning Solutions | icfconsulting.com -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of Paul BH Sent: Friday, December 23, 2005 11:31 AM To: Flashcoders mailing list Subject: Re: [Flashcoders] Faster code? this is the tool I meant - visDoc / ASDoc were these once the same? cant remember... Im having a slow day... http://www.visiblearea.com/visdoc/ On 12/23/05, Merrill, Jason [EMAIL PROTECTED] wrote: Where can I get ASDoc? Google seems pretty ignorant of it - at least as a product or software tool. Or is it an internal-only product Adobe uses? Or is it simply a Macromedia standardized HTML format for help content? Jason Merrill | E-Learning Solutions | icfconsulting.com -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of JesterXL Sent: Friday, December 23, 2005 10:56 AM To: Flashcoders mailing list Subject: Re: [Flashcoders] Faster code? Oh yeah definatly. Even though Natural Doc's syntax feels more straightforward, ASDoc definately has the most beautiful output that I've seen to date. - Original Message - From: Paul BH [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: Friday, December 23, 2005 10:53 AM Subject: Re: [Flashcoders] Faster code? 1) I agree, that's why back to my earlier thing, I rarely comment - what ASDoc does do however is provide a way of displaying things like your method signature in a friendly HTML like manner, with a handy index down the side. When I do comment, it would be to explain some hackery, or something that wasnt obvious - within a function, this wouldnt get picked up, if it was something like a paramenter only being in an allowable range, I would comment that in a way that ASDoc picks up... 2)Hehe if I couldnt do that, it would be nirvana-esque... I never said that this document wouldnt change - the key thing here is to make sure that the change is captured in one place and one place alone... ie - when business changes the specification, this is reflected in my unit tests (as they are one the same document), and thus my test suite know about it straight away... On 12/23/05, JesterXL [EMAIL PROTECTED] wrote: 1. ASDoc just generates comments from your code. If your code comments aren't up to date, neither is your generated asdocs. 2. If you could coerce a client to sign a document saying that business requirements never change... hell dude, I'm hiring you fulltime to work for me! - Original Message - From: Paul BH [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: Friday, December 23, 2005 10:31 AM Subject: Re: [Flashcoders] Faster code? I'm so glad I opened such a juicy can of worms just before Christmas ;) I just want to throw one more thing into the mix before I dissappear off to numb my family reunion with hefty doses of alcohol... So, now I think my comments before about, erm comments still stand. I see comments differently to documentation, so I'll just add my tuppence to this and retire to eat drink be merry... I think some (many)? people dont document because they cant be arsed. Why is this the case? We'll, again, I think it comes down to changing requirements, and the fact that I hate having the same information in two places, as at some point one will get out of date... How to manage this, and at the same time make your code easy to understand? This is how we are approaching it / looking to approach it... 1) Documentation of individual methods within classes is done using ASDoc which gets triggered whenever a file gets checked into source control -- your documentataion is generated from your class file, and is *always* up to date with your checked in class file... 2) We are looking into using a thing called FIT (http://fit.c2.com/) What this does is tie in business requirements with unit tests. The business (ie the client) basically write their specifications (or are assisted with it) in a word document. wherever a table is encountered, this is interpreted by FIT as a unit test, and the test builder writes a fixture to accomodate that test... What this means is that you are documenting your business logic in one place (rather than both a specs document and a slew of unit tests) For me, the underlying principle is this -- DONT REPEAT YOURSELF -- it'll save you a whole truckload of hassles down the road... Pxx On 12/23/05, Hans Wichman [EMAIL PROTECTED] wrote: Just to those that are reading this thread and wondering if writing neat documented code for clients (and payed for by clients) is an illusion, my 2 cents: we've been working on a project (complete virtual learning city) in flash in which
RE: [Flashcoders] Faster code?
I downloaded the trial, but what's a .dmg file and how do I unpack it in Windows? Couldn't find any info on their site - and double-clicking the file gives me an error - unrecognized file type. Jason Merrill | E-Learning Solutions | icfconsulting.com -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of Merrill, Jason Sent: Friday, December 23, 2005 11:42 AM To: Flashcoders mailing list Subject: RE: [Flashcoders] Faster code? Thanks. Jason Merrill | E-Learning Solutions | icfconsulting.com -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of Paul BH Sent: Friday, December 23, 2005 11:31 AM To: Flashcoders mailing list Subject: Re: [Flashcoders] Faster code? this is the tool I meant - visDoc / ASDoc were these once the same? cant remember... Im having a slow day... http://www.visiblearea.com/visdoc/ On 12/23/05, Merrill, Jason [EMAIL PROTECTED] wrote: Where can I get ASDoc? Google seems pretty ignorant of it - at least as a product or software tool. Or is it an internal-only product Adobe uses? Or is it simply a Macromedia standardized HTML format for help content? Jason Merrill | E-Learning Solutions | icfconsulting.com -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of JesterXL Sent: Friday, December 23, 2005 10:56 AM To: Flashcoders mailing list Subject: Re: [Flashcoders] Faster code? Oh yeah definatly. Even though Natural Doc's syntax feels more straightforward, ASDoc definately has the most beautiful output that I've seen to date. - Original Message - From: Paul BH [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: Friday, December 23, 2005 10:53 AM Subject: Re: [Flashcoders] Faster code? 1) I agree, that's why back to my earlier thing, I rarely comment - what ASDoc does do however is provide a way of displaying things like your method signature in a friendly HTML like manner, with a handy index down the side. When I do comment, it would be to explain some hackery, or something that wasnt obvious - within a function, this wouldnt get picked up, if it was something like a paramenter only being in an allowable range, I would comment that in a way that ASDoc picks up... 2)Hehe if I couldnt do that, it would be nirvana-esque... I never said that this document wouldnt change - the key thing here is to make sure that the change is captured in one place and one place alone... ie - when business changes the specification, this is reflected in my unit tests (as they are one the same document), and thus my test suite know about it straight away... On 12/23/05, JesterXL [EMAIL PROTECTED] wrote: 1. ASDoc just generates comments from your code. If your code comments aren't up to date, neither is your generated asdocs. 2. If you could coerce a client to sign a document saying that business requirements never change... hell dude, I'm hiring you fulltime to work for me! - Original Message - From: Paul BH [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: Friday, December 23, 2005 10:31 AM Subject: Re: [Flashcoders] Faster code? I'm so glad I opened such a juicy can of worms just before Christmas ;) I just want to throw one more thing into the mix before I dissappear off to numb my family reunion with hefty doses of alcohol... So, now I think my comments before about, erm comments still stand. I see comments differently to documentation, so I'll just add my tuppence to this and retire to eat drink be merry... I think some (many)? people dont document because they cant be arsed. Why is this the case? We'll, again, I think it comes down to changing requirements, and the fact that I hate having the same information in two places, as at some point one will get out of date... How to manage this, and at the same time make your code easy to understand? This is how we are approaching it / looking to approach it... 1) Documentation of individual methods within classes is done using ASDoc which gets triggered whenever a file gets checked into source control -- your documentataion is generated from your class file, and is *always* up to date with your checked in class file... 2) We are looking into using a thing called FIT (http://fit.c2.com/) What this does is tie in business requirements with unit tests. The business (ie the client) basically write their specifications (or are assisted with it) in a word document. wherever a table is encountered, this is interpreted by FIT as a unit test, and the test builder writes a fixture to accomodate that test... What this means is that you are documenting your business logic in one place (rather than both a specs document
Re: [Flashcoders] Faster code?
I think its a mac app. Hank On 12/23/05, Merrill, Jason [EMAIL PROTECTED] wrote: I downloaded the trial, but what's a .dmg file and how do I unpack it in Windows? Couldn't find any info on their site - and double-clicking the file gives me an error - unrecognized file type. Jason Merrill | E-Learning Solutions | icfconsulting.com -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of Merrill, Jason Sent: Friday, December 23, 2005 11:42 AM To: Flashcoders mailing list Subject: RE: [Flashcoders] Faster code? Thanks. Jason Merrill | E-Learning Solutions | icfconsulting.com -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of Paul BH Sent: Friday, December 23, 2005 11:31 AM To: Flashcoders mailing list Subject: Re: [Flashcoders] Faster code? this is the tool I meant - visDoc / ASDoc were these once the same? cant remember... Im having a slow day... http://www.visiblearea.com/visdoc/ On 12/23/05, Merrill, Jason [EMAIL PROTECTED] wrote: Where can I get ASDoc? Google seems pretty ignorant of it - at least as a product or software tool. Or is it an internal-only product Adobe uses? Or is it simply a Macromedia standardized HTML format for help content? Jason Merrill | E-Learning Solutions | icfconsulting.com -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of JesterXL Sent: Friday, December 23, 2005 10:56 AM To: Flashcoders mailing list Subject: Re: [Flashcoders] Faster code? Oh yeah definatly. Even though Natural Doc's syntax feels more straightforward, ASDoc definately has the most beautiful output that I've seen to date. - Original Message - From: Paul BH [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: Friday, December 23, 2005 10:53 AM Subject: Re: [Flashcoders] Faster code? 1) I agree, that's why back to my earlier thing, I rarely comment - what ASDoc does do however is provide a way of displaying things like your method signature in a friendly HTML like manner, with a handy index down the side. When I do comment, it would be to explain some hackery, or something that wasnt obvious - within a function, this wouldnt get picked up, if it was something like a paramenter only being in an allowable range, I would comment that in a way that ASDoc picks up... 2)Hehe if I couldnt do that, it would be nirvana-esque... I never said that this document wouldnt change - the key thing here is to make sure that the change is captured in one place and one place alone... ie - when business changes the specification, this is reflected in my unit tests (as they are one the same document), and thus my test suite know about it straight away... On 12/23/05, JesterXL [EMAIL PROTECTED] wrote: 1. ASDoc just generates comments from your code. If your code comments aren't up to date, neither is your generated asdocs. 2. If you could coerce a client to sign a document saying that business requirements never change... hell dude, I'm hiring you fulltime to work for me! - Original Message - From: Paul BH [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: Friday, December 23, 2005 10:31 AM Subject: Re: [Flashcoders] Faster code? I'm so glad I opened such a juicy can of worms just before Christmas ;) I just want to throw one more thing into the mix before I dissappear off to numb my family reunion with hefty doses of alcohol... So, now I think my comments before about, erm comments still stand. I see comments differently to documentation, so I'll just add my tuppence to this and retire to eat drink be merry... I think some (many)? people dont document because they cant be arsed. Why is this the case? We'll, again, I think it comes down to changing requirements, and the fact that I hate having the same information in two places, as at some point one will get out of date... How to manage this, and at the same time make your code easy to understand? This is how we are approaching it / looking to approach it... 1) Documentation of individual methods within classes is done using ASDoc which gets triggered whenever a file gets checked into source control -- your documentataion is generated from your class file, and is *always* up to date with your checked in class file... 2) We are looking into using a thing called FIT (http://fit.c2.com/) What this does is tie in business requirements with unit tests. The business (ie the client) basically write their specifications (or are assisted with it) in a word document
Re: [Flashcoders] Faster code?
ASDoc was not a Mac product, but windows. However, asdocs.com is down, and I no longer have a copy on my comp, so not sure bro. - Original Message - From: Merrill, Jason [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: Friday, December 23, 2005 12:15 PM Subject: RE: [Flashcoders] Faster code? Ah - I guess it is. Says that WAY down the web page - not in the top where it says, download. What's the best one for Windows? Jason Merrill | E-Learning Solutions | icfconsulting.com -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of hank williams Sent: Friday, December 23, 2005 12:02 PM To: Flashcoders mailing list Subject: Re: [Flashcoders] Faster code? I think its a mac app. Hank On 12/23/05, Merrill, Jason [EMAIL PROTECTED] wrote: I downloaded the trial, but what's a .dmg file and how do I unpack it in Windows? Couldn't find any info on their site - and double-clicking the file gives me an error - unrecognized file type. Jason Merrill | E-Learning Solutions | icfconsulting.com -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of Merrill, Jason Sent: Friday, December 23, 2005 11:42 AM To: Flashcoders mailing list Subject: RE: [Flashcoders] Faster code? Thanks. Jason Merrill | E-Learning Solutions | icfconsulting.com -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of Paul BH Sent: Friday, December 23, 2005 11:31 AM To: Flashcoders mailing list Subject: Re: [Flashcoders] Faster code? this is the tool I meant - visDoc / ASDoc were these once the same? cant remember... Im having a slow day... http://www.visiblearea.com/visdoc/ On 12/23/05, Merrill, Jason [EMAIL PROTECTED] wrote: Where can I get ASDoc? Google seems pretty ignorant of it - at least as a product or software tool. Or is it an internal-only product Adobe uses? Or is it simply a Macromedia standardized HTML format for help content? Jason Merrill | E-Learning Solutions | icfconsulting.com -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of JesterXL Sent: Friday, December 23, 2005 10:56 AM To: Flashcoders mailing list Subject: Re: [Flashcoders] Faster code? Oh yeah definatly. Even though Natural Doc's syntax feels more straightforward, ASDoc definately has the most beautiful output that I've seen to date. - Original Message - From: Paul BH [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: Friday, December 23, 2005 10:53 AM Subject: Re: [Flashcoders] Faster code? 1) I agree, that's why back to my earlier thing, I rarely comment - what ASDoc does do however is provide a way of displaying things like your method signature in a friendly HTML like manner, with a handy index down the side. When I do comment, it would be to explain some hackery, or something that wasnt obvious - within a function, this wouldnt get picked up, if it was something like a paramenter only being in an allowable range, I would comment that in a way that ASDoc picks up... 2)Hehe if I couldnt do that, it would be nirvana-esque... I never said that this document wouldnt change - the key thing here is to make sure that the change is captured in one place and one place alone... ie - when business changes the specification, this is reflected in my unit tests (as they are one the same document), and thus my test suite know about it straight away... On 12/23/05, JesterXL [EMAIL PROTECTED] wrote: 1. ASDoc just generates comments from your code. If your code comments aren't up to date, neither is your generated asdocs. 2. If you could coerce a client to sign a document saying that business requirements never change... hell dude, I'm hiring you fulltime to work for me! - Original Message - From: Paul BH [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: Friday, December 23, 2005 10:31 AM Subject: Re: [Flashcoders] Faster code? I'm so glad I opened such a juicy can of worms just before Christmas ;) I just want to throw one more thing into the mix before I dissappear off to numb my family reunion with hefty doses of alcohol... So, now I think my comments before about, erm comments still stand. I see comments differently to documentation, so I'll just add my tuppence to this and retire to eat drink be merry... I think some (many)? people dont document because they cant be arsed. Why is this the case? We'll, again, I think it comes down to changing requirements, and the fact that I hate having the same
RE: [Flashcoders] Faster code?
Nevermind - says it at the top too - I'm ready for the holiday break. Jason Merrill | E-Learning Solutions | icfconsulting.com -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of Merrill, Jason Sent: Friday, December 23, 2005 12:16 PM To: Flashcoders mailing list Subject: RE: [Flashcoders] Faster code? Ah - I guess it is. Says that WAY down the web page - not in the top where it says, download. What's the best one for Windows? Jason Merrill | E-Learning Solutions | icfconsulting.com -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of hank williams Sent: Friday, December 23, 2005 12:02 PM To: Flashcoders mailing list Subject: Re: [Flashcoders] Faster code? I think its a mac app. Hank On 12/23/05, Merrill, Jason [EMAIL PROTECTED] wrote: I downloaded the trial, but what's a .dmg file and how do I unpack it in Windows? Couldn't find any info on their site - and double-clicking the file gives me an error - unrecognized file type. Jason Merrill | E-Learning Solutions | icfconsulting.com -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of Merrill, Jason Sent: Friday, December 23, 2005 11:42 AM To: Flashcoders mailing list Subject: RE: [Flashcoders] Faster code? Thanks. Jason Merrill | E-Learning Solutions | icfconsulting.com -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of Paul BH Sent: Friday, December 23, 2005 11:31 AM To: Flashcoders mailing list Subject: Re: [Flashcoders] Faster code? this is the tool I meant - visDoc / ASDoc were these once the same? cant remember... Im having a slow day... http://www.visiblearea.com/visdoc/ On 12/23/05, Merrill, Jason [EMAIL PROTECTED] wrote: Where can I get ASDoc? Google seems pretty ignorant of it - at least as a product or software tool. Or is it an internal-only product Adobe uses? Or is it simply a Macromedia standardized HTML format for help content? Jason Merrill | E-Learning Solutions | icfconsulting.com -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of JesterXL Sent: Friday, December 23, 2005 10:56 AM To: Flashcoders mailing list Subject: Re: [Flashcoders] Faster code? Oh yeah definatly. Even though Natural Doc's syntax feels more straightforward, ASDoc definately has the most beautiful output that I've seen to date. - Original Message - From: Paul BH [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: Friday, December 23, 2005 10:53 AM Subject: Re: [Flashcoders] Faster code? 1) I agree, that's why back to my earlier thing, I rarely comment - what ASDoc does do however is provide a way of displaying things like your method signature in a friendly HTML like manner, with a handy index down the side. When I do comment, it would be to explain some hackery, or something that wasnt obvious - within a function, this wouldnt get picked up, if it was something like a paramenter only being in an allowable range, I would comment that in a way that ASDoc picks up... 2)Hehe if I couldnt do that, it would be nirvana-esque... I never said that this document wouldnt change - the key thing here is to make sure that the change is captured in one place and one place alone... ie - when business changes the specification, this is reflected in my unit tests (as they are one the same document), and thus my test suite know about it straight away... On 12/23/05, JesterXL [EMAIL PROTECTED] wrote: 1. ASDoc just generates comments from your code. If your code comments aren't up to date, neither is your generated asdocs. 2. If you could coerce a client to sign a document saying that business requirements never change... hell dude, I'm hiring you fulltime to work for me! - Original Message - From: Paul BH [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: Friday, December 23, 2005 10:31 AM Subject: Re: [Flashcoders] Faster code? I'm so glad I opened such a juicy can of worms just before Christmas ;) I just want to throw one more thing into the mix before I dissappear off to numb my family reunion with hefty doses of alcohol... So, now I think my comments before about, erm comments still stand. I see comments differently to documentation, so I'll just add my tuppence to this and retire to eat drink be merry... I think some (many)? people dont document because they cant be arsed. Why is this the case? We'll, again, I think it comes down to changing requirements, and the fact that I
Re: [Flashcoders] Faster code?
I've been very pleased using Eclipse, Doxygen, Eclox, and graphviz all together to both code and generate my documentation (using javadoc styled comments). The documentation generated even shows hierarchical UML. :-D I believe these MAY be cross platform, as I'm pretty sure they're all written in java? eclipse: http://www.eclipse.org/ eclipse actionscript plugin: http://www.eclipse-plugins.info/eclipse/plugin_details.jsp?id=867 eclox, doxygen, graphvix setup for eclipse: http://www.statik1.com/mt-weblog/archives/92.html It's possible, I'm sure, to use doxygen and such without eclipse, but I don't know how. JesterXL wrote: ASDoc was not a Mac product, but windows. However, asdocs.com is down, and I no longer have a copy on my comp, so not sure bro. - Original Message - From: Merrill, Jason [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: Friday, December 23, 2005 12:15 PM Subject: RE: [Flashcoders] Faster code? Ah - I guess it is. Says that WAY down the web page - not in the top where it says, download. What's the best one for Windows? -- Mark Ribau Lead Windows Developer | My Tech Blog http://www.redbugtech.com/blogs/mark.php Redbug Technologies, Inc. http://www.redbugtech.com - www.redbugtech.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Faster code?
Also, As2API works great on Windows. Jim Kremens On 12/23/05, Mark Ribau [EMAIL PROTECTED] wrote: I've been very pleased using Eclipse, Doxygen, Eclox, and graphviz all together to both code and generate my documentation (using javadoc styled comments). The documentation generated even shows hierarchical UML. :-D I believe these MAY be cross platform, as I'm pretty sure they're all written in java? eclipse: http://www.eclipse.org/ eclipse actionscript plugin: http://www.eclipse-plugins.info/eclipse/plugin_details.jsp?id=867 eclox, doxygen, graphvix setup for eclipse: http://www.statik1.com/mt-weblog/archives/92.html It's possible, I'm sure, to use doxygen and such without eclipse, but I don't know how. JesterXL wrote: ASDoc was not a Mac product, but windows. However, asdocs.com is down, and I no longer have a copy on my comp, so not sure bro. - Original Message - From: Merrill, Jason [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: Friday, December 23, 2005 12:15 PM Subject: RE: [Flashcoders] Faster code? Ah - I guess it is. Says that WAY down the web page - not in the top where it says, download. What's the best one for Windows? -- Mark Ribau Lead Windows Developer | My Tech Blog http://www.redbugtech.com/blogs/mark.php Redbug Technologies, Inc. http://www.redbugtech.com - www.redbugtech.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] Faster code?
JesterXL, I can't help but comment on your disdain for commenting/doc-ing. You might be missing the wood for the trees. A disclaimer - What I say next is for those working in teams that are more in number than just you and your cup of coffee :). Commenting/documenting is not for those working with you but for those working after you. The poor sop who is asked to go tweak your code when you are away in the Caribbean doesn't have the guarantee of you, the owner being available to him/her when they need to work on it. Commenting/doc-ing takes a huge amount of time only if it is treated as a separate endeavor to be done after coding. It's not. Make it part of your coding and it will neither be taxing nor take too much time. Forget those who work after you. After implementing numerous complex apps, don't be surprised if you come back to one of your old classes that u were really proud of for the wizardry you had employed in it and then spend a few hours scratching your head wondering what the *^% does this do - and where the hell is that global(bad!) var being set? . Secondly, the requirements + code-base change so much, that documenting is a waste of time, when at any moment you could wax a class, and thus destroy 20 minutes worth of documentation time. Well, honestly I can see this kind of case where you need to 'wax a class' happening only when nobody has bothered to design the app before coding and all coding/classes are being created ad-hoc. If you do indeed design (and design well) and need to polish a whole class off (wax...polish...he he I crack myself up.), it's got to be pretty rare. If your client changes requirements so drastically that u need to kill off whole classes rather than tweak content of a function here, add one there ,remove one here, well...my sympathies. And anyway, like I said if you comment while coding, that effort you mentioned is 5 minutes. Remember you don't have to write stories in your comments- that’s what the design doc describes for you. You just need to leave in almost-cryptic comments that can be understood by another developer who knows his stuff. And anyway if you do take 20 minutes to comment the bloody thing, its better than spending 20 minutes chatting individually with your buddies and explaining it to them. As to your last question, your are apparently in one of the few companies that do those pratices, and apparently believes they work. -Yeah. That’s how we know don't we now? You do something - and then you know it really works... To comment on stuff that came before this note, efficiency/performance of code has nothing to do commenting or documenting of code and one doesn't need to come in at the expense of the other. You can have cryptic code that is super-efficient that is explained by a 5-10 word comment just before it that explains what it does. Don’t mix the two up. Function level and class level commenting is more important when u r dealing with big teams/big projects that want quality and more importantly quality on time and quality that is maintainable. You don't want to have to keep discussing and explaining your code again and again to everybody who needs to tweak it do you? And to come back to the guy who comes after you, you gotta make his life a little easier. Your note seems to draw from what you have been doing so far rather than thinking about what you need to be doing to make it better. you know, I am used to living in my very messy room and think it’s the way it should be - until I can't find that Playboy which is lying around somewhere and my mom is about to visit. As to your last question, your are apparently in one of the few companies that do those pratices, and apparently believes they work. That’s how you know pal. You do it, then you know. Well, what-ever you choose to do, may it be profitable :). Rakesh -Original Message- From: JesterXL [mailto:[EMAIL PROTECTED] Sent: Thursday, December 22, 2005 6:40 AM To: Flashcoders mailing list Subject: Re: [Flashcoders] Faster code? Re-read your email. Only recently have I been on bigger projects. Even so, I'm usually the main developer for a given code-base, and others are on other projects, so no ones ever looking at the code next to me. Secondly, the requirements + code-base change so much, that documenting is a waste of time, when at any moment you could wax a class, and thus destroy 20 minutes worth of documentation time. On the 2 projects I was one where I worked with a team of developers, we were in constant contact, either in person or over AIM, and neither had problems reading eachothers code that was comment-less. We were using ARP, so it helped communication; when I updated a command, he knew where to look, and vice-versa. Admittingly, the little commenting we did have, which we couldn't live without was at the top of the file for Views; it merely reported where the app the View was and what it represented since we had
Re: [Flashcoders] Faster code?
If you change that function, do you re-write all of your documentation? Nope,. just add a modified comment and, if necessary, a brief description of how it was changed. Usually I write the comments before I write (or modify) the function or class, which is a great way to to write cleaner code. A lot of times I'll find myself halfway through the comment and realize that there is a better way to implement it, or a way to do without it completely. It gives you a kind of a last chance to state out loud what the function or class is for, and that's a good time to do a reality check and make sure you're not writing code that will have to be rewritten a few days later. Secondly, the requirements + code-base change so much, that documenting is a waste of time, when at any moment you could wax a class, and thus destroy 20 minutes worth of documentation time. Well, it doesn't take 20 minutes to write the comments I pasted into the previous email, it takes a minute or two. Even if you type slow and don't know hot to cut and paste the borders, it shouldn't take but a few minutes. The thing that scares me is the idea of spending the time writing whole classes that will get tossed a day or two later, *that* seems like a waste of time. Not only have you written a whole class that's getting tossed, but you've likely instantiated it in other classes, and now you have to go change all of those implementations as well. To me, that just sounds like poor planning. Believe me, I have requirements change constantly, but with good planning and design, I reduce the number of places where those changes have to take place to a minimum. I have classes I touch every day as layout and design changes get tossed back and forth, but I also have classes I haven't had to touch for months because of good abstraction, good planning, and clear documentation that explains how those (often very) abstract classes work and can be implemented and manipulated. And the main argument for documentation becomes very clear when you inherit a large project and have to make changes to a bunch of garbled code. I inherited two large projects when I started my current job, and they had no documentation, no comments at all, and no real organization. I wasted many hours untangling obscure references, breaking down what were ostensibly optimizations but didn't actually help performance, and figuring out just what the heck the previous developer was thinking when he wrote that crap. The way my code is written now, I can have our Java or C# developers review my code and with a few questions about Flash-specific APIs they can see exactly what is going on without even knowing ActionScript, just by being familiar with ECMA-based languages. Back to the OPs question about optimization. The main thing with optimization is that it should be done as needed. You can't optimize code while you write it, it is impossible by defenition. Optimization == improved performance, and if the code has never run, it can't possibly be improved, only written. A good rule of thumb is to use the clearest syntax possible first, then unit test to identify potential bottlenecks, and optimize as needed. If an optimization doesn't give you a noticable performance gain at runtime, what is its purpose? If you just enjoy writing cryptic and difficult to scan code, go for it, have fun. Personally, I like to write code that makes my job easier. ryanm ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] Faster code?
Hehe, you don't Jesse too well. I can't imagine him slowing down for anything, especially writing comments. Consider that he probably gets more done in a day than most of us and he still takes the time to answer many threads on Flashcoders. I don't write comments either. I just write good, clean, easy to understand code. I don't over complicate things with classes that extend classes that extend classes because I'm not coding for job security, I'm coding to get it done and make it easy to come back to later. Besides, like Jesse, I could probably rewrite a bunch of code myself much faster than trying to dig through somebody else's code even if it is commented. The fact of the matter is, if I'm being hired to work on a project that somebody else coded, they probably quit or were fired and won't be working on the project ever again. I mean, I'd rather write my own code that I understand than every time I sit down to work on the app have to dig through somebody else's mess. And we're talking about messes here. We're not talking about good code. I can understand good code without comments. This is Actionscript, not C. -Steven -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Rakesh Sent: Thursday, December 22, 2005 3:13 AM To: flashcoders@chattyfig.figleaf.com Subject: [Flashcoders] Faster code? JesterXL, I can't help but comment on your disdain for commenting/doc-ing. You might be missing the wood for the trees. A disclaimer - What I say next is for those working in teams that are more in number than just you and your cup of coffee :). Commenting/documenting is not for those working with you but for those working after you. The poor sop who is asked to go tweak your code when you are away in the Caribbean doesn't have the guarantee of you, the owner being available to him/her when they need to work on it. Commenting/doc-ing takes a huge amount of time only if it is treated as a separate endeavor to be done after coding. It's not. Make it part of your coding and it will neither be taxing nor take too much time. Forget those who work after you. After implementing numerous complex apps, don't be surprised if you come back to one of your old classes that u were really proud of for the wizardry you had employed in it and then spend a few hours scratching your head wondering what the *^% does this do - and where the hell is that global(bad!) var being set? . Secondly, the requirements + code-base change so much, that documenting is a waste of time, when at any moment you could wax a class, and thus destroy 20 minutes worth of documentation time. Well, honestly I can see this kind of case where you need to 'wax a class' happening only when nobody has bothered to design the app before coding and all coding/classes are being created ad-hoc. If you do indeed design (and design well) and need to polish a whole class off (wax...polish...he he I crack myself up.), it's got to be pretty rare. If your client changes requirements so drastically that u need to kill off whole classes rather than tweak content of a function here, add one there ,remove one here, well...my sympathies. And anyway, like I said if you comment while coding, that effort you mentioned is 5 minutes. Remember you don't have to write stories in your comments- that's what the design doc describes for you. You just need to leave in almost-cryptic comments that can be understood by another developer who knows his stuff. And anyway if you do take 20 minutes to comment the bloody thing, its better than spending 20 minutes chatting individually with your buddies and explaining it to them. As to your last question, your are apparently in one of the few companies that do those pratices, and apparently believes they work. -Yeah. That's how we know don't we now? You do something - and then you know it really works... To comment on stuff that came before this note, efficiency/performance of code has nothing to do commenting or documenting of code and one doesn't need to come in at the expense of the other. You can have cryptic code that is super-efficient that is explained by a 5-10 word comment just before it that explains what it does. Don't mix the two up. Function level and class level commenting is more important when u r dealing with big teams/big projects that want quality and more importantly quality on time and quality that is maintainable. You don't want to have to keep discussing and explaining your code again and again to everybody who needs to tweak it do you? And to come back to the guy who comes after you, you gotta make his life a little easier. Your note seems to draw from what you have been doing so far rather than thinking about what you need to be doing to make it better. you know, I am used to living in my very messy room and think it's the way it should be - until I can't find
RE: [Flashcoders] Faster code?
Very well said Paul. Couldn't agree more - mind you this is coming from a guy who still writes crappy code. :) Jason Merrill | E-Learning Solutions | icfconsulting.com -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of Paul BH Sent: Thursday, December 22, 2005 2:07 PM To: Flashcoders mailing list Subject: Re: [Flashcoders] Faster code? Just to offer you guys a different take on this - It seems that my post was encouraging extensive commenting of code. Actually, you will find barely any comments in my code. I find that comments very often get out of date as specifications change, what in essence you are doing is repeating information (in code in comments) - and inevitably somewhere along the line one gets out of sync with the other. I dont claim to write the fastest executing code in the world, but I do strive to make it both human machine readible. This comes down to being very clear about what your functions are called, and breaking down your work into pretty granular pieces - more than make would expect. For example - lets say I have an if statement which checks some stuff: //check mouse is in bounds if(_xmouserightEdge _xmouseleftEdge _ymousetopEdge _ymousebottomEdge){ ... } I am likely to refactor something like this to: if(mouseInBounds()){ ... } private function mouseInBounds():Boolean{ return _xmouserightEdge _xmouseleftEdge _ymousetopEdge _ymousebottomEdge } This way I can notify other people who will be looking at the code what my intention was. I use comments to notify when something was done in a hackish way, of there is a known bug in the code, or something else that may give a new pair of eyes a huh? moment... Back to my point about optimization - I can imagine some of you guys are reading this and thinking that this will slow down the app too much. Well, as Ryan mentioned in his post - write the clearest code first *then* and only then, if it is too slow, identify where the bottlenecks are and concentrate on them... *Stands down off soap-box* PBH ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders NOTICE: This message is for the designated recipient only and may contain privileged or confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of this e-mail by you is prohibited. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Faster code?
everyone writes crappy code ;) we all just need to try and make it less crappy.. On 12/22/05, Merrill, Jason [EMAIL PROTECTED] wrote: Very well said Paul. Couldn't agree more - mind you this is coming from a guy who still writes crappy code. :) Jason Merrill | E-Learning Solutions | icfconsulting.com -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of Paul BH Sent: Thursday, December 22, 2005 2:07 PM To: Flashcoders mailing list Subject: Re: [Flashcoders] Faster code? Just to offer you guys a different take on this - It seems that my post was encouraging extensive commenting of code. Actually, you will find barely any comments in my code. I find that comments very often get out of date as specifications change, what in essence you are doing is repeating information (in code in comments) - and inevitably somewhere along the line one gets out of sync with the other. I dont claim to write the fastest executing code in the world, but I do strive to make it both human machine readible. This comes down to being very clear about what your functions are called, and breaking down your work into pretty granular pieces - more than make would expect. For example - lets say I have an if statement which checks some stuff: //check mouse is in bounds if(_xmouserightEdge _xmouseleftEdge _ymousetopEdge _ymousebottomEdge){ ... } I am likely to refactor something like this to: if(mouseInBounds()){ ... } private function mouseInBounds():Boolean{ return _xmouserightEdge _xmouseleftEdge _ymousetopEdge _ymousebottomEdge } This way I can notify other people who will be looking at the code what my intention was. I use comments to notify when something was done in a hackish way, of there is a known bug in the code, or something else that may give a new pair of eyes a huh? moment... Back to my point about optimization - I can imagine some of you guys are reading this and thinking that this will slow down the app too much. Well, as Ryan mentioned in his post - write the clearest code first *then* and only then, if it is too slow, identify where the bottlenecks are and concentrate on them... *Stands down off soap-box* PBH ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders NOTICE: This message is for the designated recipient only and may contain privileged or confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of this e-mail by you is prohibited. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Faster code?
I know why you do it and I agree it should be done within reason. My point is, I've found an extremely small percentage of my client base who cares about it and understands why you take to the time to do it. When I go, Hey, I found this neat new documenting app! and they reply, We have more important things to do, like getting all of this code working you can see where I'm coming from, 1 person, or many. The ah-hoc comes from scope creep lack of a clear vision, not from developer planning. I could plan things to a T, only to have a client change their mind, and pay for that change, rendering my planning useless. I don't lose sleep cause I'm getting paid for it. I can't really hold a position, however, as I've yet to work on a project where we weren't so focused on the end result of getting deadlines met and stuff up and working vs. worrying about tomorrow. When I do, I'll revisit this thread. - Original Message - From: Rakesh [EMAIL PROTECTED] To: flashcoders@chattyfig.figleaf.com Sent: Thursday, December 22, 2005 6:12 AM Subject: [Flashcoders] Faster code? JesterXL, I can't help but comment on your disdain for commenting/doc-ing. You might be missing the wood for the trees. A disclaimer - What I say next is for those working in teams that are more in number than just you and your cup of coffee :). Commenting/documenting is not for those working with you but for those working after you. The poor sop who is asked to go tweak your code when you are away in the Caribbean doesn't have the guarantee of you, the owner being available to him/her when they need to work on it. Commenting/doc-ing takes a huge amount of time only if it is treated as a separate endeavor to be done after coding. It's not. Make it part of your coding and it will neither be taxing nor take too much time. Forget those who work after you. After implementing numerous complex apps, don't be surprised if you come back to one of your old classes that u were really proud of for the wizardry you had employed in it and then spend a few hours scratching your head wondering what the *^% does this do - and where the hell is that global(bad!) var being set? . Secondly, the requirements + code-base change so much, that documenting is a waste of time, when at any moment you could wax a class, and thus destroy 20 minutes worth of documentation time. Well, honestly I can see this kind of case where you need to 'wax a class' happening only when nobody has bothered to design the app before coding and all coding/classes are being created ad-hoc. If you do indeed design (and design well) and need to polish a whole class off (wax...polish...he he I crack myself up.), it's got to be pretty rare. If your client changes requirements so drastically that u need to kill off whole classes rather than tweak content of a function here, add one there ,remove one here, well...my sympathies. And anyway, like I said if you comment while coding, that effort you mentioned is 5 minutes. Remember you don't have to write stories in your comments- that’s what the design doc describes for you. You just need to leave in almost-cryptic comments that can be understood by another developer who knows his stuff. And anyway if you do take 20 minutes to comment the bloody thing, its better than spending 20 minutes chatting individually with your buddies and explaining it to them. As to your last question, your are apparently in one of the few companies that do those pratices, and apparently believes they work. -Yeah. That’s how we know don't we now? You do something - and then you know it really works... To comment on stuff that came before this note, efficiency/performance of code has nothing to do commenting or documenting of code and one doesn't need to come in at the expense of the other. You can have cryptic code that is super-efficient that is explained by a 5-10 word comment just before it that explains what it does. Don’t mix the two up. Function level and class level commenting is more important when u r dealing with big teams/big projects that want quality and more importantly quality on time and quality that is maintainable. You don't want to have to keep discussing and explaining your code again and again to everybody who needs to tweak it do you? And to come back to the guy who comes after you, you gotta make his life a little easier. Your note seems to draw from what you have been doing so far rather than thinking about what you need to be doing to make it better. you know, I am used to living in my very messy room and think it’s the way it should be - until I can't find that Playboy which is lying around somewhere and my mom is about to visit. As to your last question, your are apparently in one of the few companies that do those pratices, and apparently believes they work. That’s how you know pal. You do it, then you know. Well, what-ever you choose to do, may it be profitable :). Rakesh -Original Message- From: JesterXL
RE: [Flashcoders] Faster code?
I'm sure at places like Microsoft, etc. where you have many people working on the same project, which will eventually be upgraded to new versions, possibly by a mostly new team, in a coding language that doesn't receive major revisions every year or so, then yes it makes sense. The reason Jesse is right is because customers want to use Flash because it's quick and easy to develop and deploy compared to C/C++. It's the reason Director was so popular in its day, as well. The longevity of Flash code is also dubious. I mean, C/C++ pretty much stay the same. Each new version of AS adds all kinds of new syntax, class structure, methods, etc. Actionscript is far too malleable to have any real shelf life. I mean, if I'm put to work on a Flash 5 app, I'm just going to rewrite it from scratch in AS2 F7 without regard for any kind of commenting that exists, no matter how robust. A C++ application from 5 years ago is more like a C++ app today than a Flash app from 5 years ago is to a Flash app today. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Faster code?
I comment because I'm a total hack. The comments are for me, in case I need to revisit the code, like, next week. :D It also helps me see what I'm doing, and sometimes improvements are more apparent after commenting. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Faster code?
Jesse's comments about how his code is basically disposable (my word) is interesting. I think it reflects the nature of flash and its history. For example I am working on a fairly complex project. I have been working on it for more than a year. It has lots of pieces that interact. And what happens is that I get one piece working. Then it has to interact with another piece that I get working, so I have to go back and fix the first piece. And so on. This also relates to ongoing desires to improve the performance of code and to add features. But what is interesting to me is every time I go back to a piece of code I have to relearn it. I do try to comment, and each time I go back, my comments get better because I see what I needed to comment the last time I was in the code. Basically, when I go back into an unfamiliar block of code, I find myself often refactoring. It helps me to re-understand the code but it also it has this funny effect of improving the quality of code. And each time I do this I add or edit the documentation. Of course I am writing primarily business logic and algorithms, not screen display/UI code which is probably more disposable. And I think this is my point. This issue really does depend not only on the size of the project but the type of code it is. The closer you are to the edge of the application, the less important documentation is. Flash and even flex have typically been more UI code than business logic which is often on the server. The more business logic that ends up on the client, the more durable and less disposable the client code will need to be. In other words, as flash becomes a real software development platform, real development methodologies will become more important. Regards Hank On 12/22/05, ryanm [EMAIL PROTECTED] wrote: Very well said Paul. Couldn't agree more - mind you this is coming from a guy who still writes crappy code. :) Don't get the wrong idea, I still write my share of crappy, last minute, hacked-together code. But I do try to at least drop a comment in there to explain why it's so ugly. ;-) ryanm ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Faster code?
The ah-hoc comes from scope creep lack of a clear vision, not from developer planning. I could plan things to a T, only to have a client change their mind, and pay for that change, rendering my planning useless.. I don't lose sleep cause I'm getting paid for it. You know that youl live in my hell, right? ;-) Seriously, I've quit jobs because of that kind of crap. It drives me insane to write all that code and then have to toss it a few days later when the requirements change drastically. It didn't used to bother me, but now that I know it doesn't have to be that way, I just can't go back. ryanm ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Faster code?
The longevity of Flash code is also dubious. I mean, C/C++ pretty much stay the same. Each new version of AS adds all kinds of new syntax, class structure, methods, etc. Actionscript is far too malleable to have any real shelf life. It is pretty much the stated goal of Macromedia to put an end to that, though. The end goal is ECMA-4 compliance, which means that from here forward, ActionScript should change at about the same rate as C# or Java, and with those languages companies and developers count on classes being reusable with only minor revisions. ryanm ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Faster code?
I think it reflects the nature of flash and its history. Not to mention the diverse skillset of its developer-base. A lot of people learned to write code in Flash, and the question of whether they are doing it the right way or not is debatable. In other words, as flash becomes a real software development platform, real development methodologies will become more important. That's really what it comes down to. As you start building longer-term projects and using standardized methodologies, these things start to become more important. I still do the occasional one-off animation or ad, but that's not where I spend the majority of my time these days. ryanm ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Faster code?
I've yet to get a death threat from some poor sod to who had to maintain my code... but, to be on the safe side, I always keep my glock loaded. I've come pretty close to issuing several of those death threats. ;-) ryanm ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] Faster code?
Anyone know of good optimizations to make to code so that it'll run faster in Flash? If you're bored, check out what we're doing with flash at www.mapwing.com. -- Mark Ribau Lead Windows Developer | My Tech Blog http://www.redbugtech.com/blogs/mark.php Redbug Technologies, Inc. http://www.redbugtech.com - www.redbugtech.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] Faster code?
Beware thy micro-optimisations, for thy bring thee doom pain and misery -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Mark Ribau Sent: 21 December 2005 16:16 To: 'Flashcoders mailing list' Subject: [Flashcoders] Faster code? Anyone know of good optimizations to make to code so that it'll run faster in Flash? If you're bored, check out what we're doing with flash at www.mapwing.com. -- Mark Ribau Lead Windows Developer | My Tech Blog http://www.redbugtech.com/blogs/mark.php Redbug Technologies, Inc. http://www.redbugtech.com - www.redbugtech.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Faster code?
Your trying to optimize Myst? - Original Message - From: Mark Ribau [EMAIL PROTECTED] To: 'Flashcoders mailing list' flashcoders@chattyfig.figleaf.com Sent: Wednesday, December 21, 2005 11:16 AM Subject: [Flashcoders] Faster code? Anyone know of good optimizations to make to code so that it'll run faster in Flash? If you're bored, check out what we're doing with flash at www.mapwing.com. -- Mark Ribau Lead Windows Developer | My Tech Blog http://www.redbugtech.com/blogs/mark.php Redbug Technologies, Inc. http://www.redbugtech.com - www.redbugtech.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] Faster code?
lol that's what I was thinking of looking at that site, couldn't put a name to it tho... good spot Jessie. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of JesterXL Sent: 21 December 2005 16:38 To: Flashcoders mailing list Subject: Re: [Flashcoders] Faster code? Your trying to optimize Myst? - Original Message - From: Mark Ribau [EMAIL PROTECTED] To: 'Flashcoders mailing list' flashcoders@chattyfig.figleaf.com Sent: Wednesday, December 21, 2005 11:16 AM Subject: [Flashcoders] Faster code? Anyone know of good optimizations to make to code so that it'll run faster in Flash? If you're bored, check out what we're doing with flash at www.mapwing.com. -- Mark Ribau Lead Windows Developer | My Tech Blog http://www.redbugtech.com/blogs/mark.php Redbug Technologies, Inc. http://www.redbugtech.com - www.redbugtech.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Faster code?
lol. Indeed. :-) Good job at recognizing some of the inspiration behind the interface. The goal is more to create a system for making easy virtual tours of either real locations or fantasy worlds. Got any thoughts/suggestions? JesterXL wrote: Your trying to optimize Myst? - Original Message - From: Mark Ribau [EMAIL PROTECTED] To: 'Flashcoders mailing list' flashcoders@chattyfig.figleaf.com Sent: Wednesday, December 21, 2005 11:16 AM Subject: [Flashcoders] Faster code? Anyone know of good optimizations to make to code so that it'll run faster in Flash? If you're bored, check out what we're doing with flash at www.mapwing.com. -- Mark Ribau Lead Windows Developer | My Tech Blog http://www.redbugtech.com/blogs/mark.php Redbug Technologies, Inc. http://www.redbugtech.com - www.redbugtech.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Faster code?
Dude, no, she runs great, looks hot, and makes me want to fill up the dots like you made dots on the map in Legend of Zelda. What part don't you like? - Original Message - From: Mark Ribau [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: Wednesday, December 21, 2005 11:53 AM Subject: Re: [Flashcoders] Faster code? lol. Indeed. :-) Good job at recognizing some of the inspiration behind the interface. The goal is more to create a system for making easy virtual tours of either real locations or fantasy worlds. Got any thoughts/suggestions? JesterXL wrote: Your trying to optimize Myst? - Original Message - From: Mark Ribau [EMAIL PROTECTED] To: 'Flashcoders mailing list' flashcoders@chattyfig.figleaf.com Sent: Wednesday, December 21, 2005 11:16 AM Subject: [Flashcoders] Faster code? Anyone know of good optimizations to make to code so that it'll run faster in Flash? If you're bored, check out what we're doing with flash at www.mapwing.com. -- Mark Ribau Lead Windows Developer | My Tech Blog http://www.redbugtech.com/blogs/mark.php Redbug Technologies, Inc. http://www.redbugtech.com - www.redbugtech.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Faster code?
On 12/21/05, Mark Ribau [EMAIL PROTECTED] wrote: Anyone know of good optimizations to make to code so that it'll run faster in Flash? functions: avoid, if at all possible. methods of intrinsic classes are ok (e.g. Math.round()), but calling an AS function is very slow. if you have to use functions, try to make them methods of some object to force the compiler to use function2. i don't know what it depends on, but i've found that declaring a function on its own sometimes results in the normal function bytecode, which means there are only four registers, so you rely on getVariable/setVariable which is slower then registers (and with function2 you have 256 of them). the fastest loop through an array is: var len = myArray.length; while( len-- ) { ... } yes, it's faster then for..in. it's been a while since i've tested it, but - is *slightly* faster than +. use local vars. this is probably the most important one, apart from avoiding functions. accessing an array is *not* faster than accessing an object. instead of var foo = Math.floor( bar ); use var foo = bar|0; of course, what will bring you the most in performance is to improve your algorithms and data structures. wait for AS3. hth, mark -- http://snafoo.org/ jabber: [EMAIL PROTECTED] ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Faster code?
Well, there's no specific place right now. I'm in the process of rewriting the whole code base. Right now, everything is an a instance of Object (or an array) with properties (or named indexes) sitting on _root, and lots of global functions and such. I'm making it more object oriented by making components and using classes. I don't know what you mean about the dots in LoZ. I can't remember that. JesterXL wrote: Dude, no, she runs great, looks hot, and makes me want to fill up the dots like you made dots on the map in Legend of Zelda. What part don't you like? - Original Message - From: Mark Ribau [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: Wednesday, December 21, 2005 11:53 AM Subject: Re: [Flashcoders] Faster code? lol. Indeed. :-) Good job at recognizing some of the inspiration behind the interface. The goal is more to create a system for making easy virtual tours of either real locations or fantasy worlds. Got any thoughts/suggestions? JesterXL wrote: Your trying to optimize Myst? - Original Message - From: Mark Ribau [EMAIL PROTECTED] To: 'Flashcoders mailing list' flashcoders@chattyfig.figleaf.com Sent: Wednesday, December 21, 2005 11:16 AM Subject: [Flashcoders] Faster code? Anyone know of good optimizations to make to code so that it'll run faster in Flash? If you're bored, check out what we're doing with flash at www.mapwing.com. -- Mark Ribau Lead Windows Developer | My Tech Blog http://www.redbugtech.com/blogs/mark.php Redbug Technologies, Inc. http://www.redbugtech.com - www.redbugtech.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Faster code?
Making it more OOP will slow it down, lol! In Legend of Zelda, when you would go from room to room in a dungeon, it'd actually cut out holes in this map showing you what rooms you've been to. Yours actually fills in existing dots. Yours is a better concept, because while you're exploring, it's still nice to know where you can go. - Original Message - From: Mark Ribau [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: Wednesday, December 21, 2005 1:25 PM Subject: Re: [Flashcoders] Faster code? Well, there's no specific place right now. I'm in the process of rewriting the whole code base. Right now, everything is an a instance of Object (or an array) with properties (or named indexes) sitting on _root, and lots of global functions and such. I'm making it more object oriented by making components and using classes. I don't know what you mean about the dots in LoZ. I can't remember that. JesterXL wrote: Dude, no, she runs great, looks hot, and makes me want to fill up the dots like you made dots on the map in Legend of Zelda. What part don't you like? - Original Message - From: Mark Ribau [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: Wednesday, December 21, 2005 11:53 AM Subject: Re: [Flashcoders] Faster code? lol. Indeed. :-) Good job at recognizing some of the inspiration behind the interface. The goal is more to create a system for making easy virtual tours of either real locations or fantasy worlds. Got any thoughts/suggestions? JesterXL wrote: Your trying to optimize Myst? - Original Message - From: Mark Ribau [EMAIL PROTECTED] To: 'Flashcoders mailing list' flashcoders@chattyfig.figleaf.com Sent: Wednesday, December 21, 2005 11:16 AM Subject: [Flashcoders] Faster code? Anyone know of good optimizations to make to code so that it'll run faster in Flash? If you're bored, check out what we're doing with flash at www.mapwing.com. -- Mark Ribau Lead Windows Developer | My Tech Blog http://www.redbugtech.com/blogs/mark.php Redbug Technologies, Inc. http://www.redbugtech.com - www.redbugtech.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Faster code?
We're going to add to the flash program that the red points will turn orange if you've been there (so that it works just like the standalone windows or mac program). Shame about the slow down though. Hopefully it doesn't too much!! At least as time goes on, we have to worry less about older computers. :-P JesterXL wrote: Making it more OOP will slow it down, lol! In Legend of Zelda, when you would go from room to room in a dungeon, it'd actually cut out holes in this map showing you what rooms you've been to. Yours actually fills in existing dots. Yours is a better concept, because while you're exploring, it's still nice to know where you can go. - Original Message - From: Mark Ribau [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: Wednesday, December 21, 2005 1:25 PM Subject: Re: [Flashcoders] Faster code? Well, there's no specific place right now. I'm in the process of rewriting the whole code base. Right now, everything is an a instance of Object (or an array) with properties (or named indexes) sitting on _root, and lots of global functions and such. I'm making it more object oriented by making components and using classes. I don't know what you mean about the dots in LoZ. I can't remember that. JesterXL wrote: Dude, no, she runs great, looks hot, and makes me want to fill up the dots like you made dots on the map in Legend of Zelda. What part don't you like? - Original Message - From: Mark Ribau [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: Wednesday, December 21, 2005 11:53 AM Subject: Re: [Flashcoders] Faster code? lol. Indeed. :-) Good job at recognizing some of the inspiration behind the interface. The goal is more to create a system for making easy virtual tours of either real locations or fantasy worlds. Got any thoughts/suggestions? JesterXL wrote: Your trying to optimize Myst? - Original Message - From: Mark Ribau [EMAIL PROTECTED] To: 'Flashcoders mailing list' flashcoders@chattyfig.figleaf.com Sent: Wednesday, December 21, 2005 11:16 AM Subject: [Flashcoders] Faster code? Anyone know of good optimizations to make to code so that it'll run faster in Flash? If you're bored, check out what we're doing with flash at www.mapwing.com. -- Mark Ribau Lead Windows Developer | My Tech Blog http://www.redbugtech.com/blogs/mark.php Redbug Technologies, Inc. http://www.redbugtech.com - www.redbugtech.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Faster code?
It similar to this site : http://www.pere-lachaise.com/perelachaise.php?lang=en A+ Mark Ribau wrote: Well, there's no specific place right now. I'm in the process of rewriting the whole code base. Right now, everything is an a instance of Object (or an array) with properties (or named indexes) sitting on _root, and lots of global functions and such. I'm making it more object oriented by making components and using classes. I don't know what you mean about the dots in LoZ. I can't remember that. JesterXL wrote: Dude, no, she runs great, looks hot, and makes me want to fill up the dots like you made dots on the map in Legend of Zelda. What part don't you like? - Original Message - From: Mark Ribau [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: Wednesday, December 21, 2005 11:53 AM Subject: Re: [Flashcoders] Faster code? lol. Indeed. :-) Good job at recognizing some of the inspiration behind the interface. The goal is more to create a system for making easy virtual tours of either real locations or fantasy worlds. Got any thoughts/suggestions? JesterXL wrote: Your trying to optimize Myst? - Original Message - From: Mark Ribau [EMAIL PROTECTED] To: 'Flashcoders mailing list' flashcoders@chattyfig.figleaf.com Sent: Wednesday, December 21, 2005 11:16 AM Subject: [Flashcoders] Faster code? Anyone know of good optimizations to make to code so that it'll run faster in Flash? If you're bored, check out what we're doing with flash at www.mapwing.com. -- === Éric Thibault Programmeur analyste Réseau de valorisation de l'enseignement Université Laval, pavillon Félix-Antoine Savard Québec, Canada Tel.: 656-2131 poste 18015 Courriel : [EMAIL PROTECTED] === Avis relatif à la confidentialité / Notice of Confidentiality / Advertencia de confidencialidad http://www.rec.ulaval.ca/lce/securite/confidentialite.htm ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Faster code?
That's very cool. Do you know if the tour is dynamic? I.E. you don't have to create a whole new template and work only in Flash in order for it to make a tour? Our software creates a project file, which any of our viewers (windows, os x, or flash) can natively just open and view. I went to the Artifica website, but it was in French. Éric Thibault wrote: It similar to this site : http://www.pere-lachaise.com/perelachaise.php?lang=en A+ Mark Ribau wrote: Well, there's no specific place right now. I'm in the process of rewriting the whole code base. Right now, everything is an a instance of Object (or an array) with properties (or named indexes) sitting on _root, and lots of global functions and such. I'm making it more object oriented by making components and using classes. I don't know what you mean about the dots in LoZ. I can't remember that. JesterXL wrote: Dude, no, she runs great, looks hot, and makes me want to fill up the dots like you made dots on the map in Legend of Zelda. What part don't you like? - Original Message - From: Mark Ribau [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: Wednesday, December 21, 2005 11:53 AM Subject: Re: [Flashcoders] Faster code? lol. Indeed. :-) Good job at recognizing some of the inspiration behind the interface. The goal is more to create a system for making easy virtual tours of either real locations or fantasy worlds. Got any thoughts/suggestions? JesterXL wrote: Your trying to optimize Myst? - Original Message - From: Mark Ribau [EMAIL PROTECTED] To: 'Flashcoders mailing list' flashcoders@chattyfig.figleaf.com Sent: Wednesday, December 21, 2005 11:16 AM Subject: [Flashcoders] Faster code? Anyone know of good optimizations to make to code so that it'll run faster in Flash? If you're bored, check out what we're doing with flash at www.mapwing.com. -- Mark Ribau Lead Windows Developer | My Tech Blog http://www.redbugtech.com/blogs/mark.php Redbug Technologies, Inc. http://www.redbugtech.com - www.redbugtech.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] Faster code?
the fastest loop through an array is: var len = myArray.length; while( len-- ) { ... } yes, it's faster then for..in. Not always. Sometimes, this loop is faster than a while (i--) for (var i = items.length; --i - (-1); ) { ... } It's ugly, yes, but it is faster than while (i--) depending on how many items you're iterating through. Run some tests if you don't believe me. :) ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Faster code?
I think these are all great, but if I can be the voice of caution for a moment... remember that when you write code, it is for 2 interpreters: 1) the Actionscript VM 2) the person who has to go back and change stuff at a later date, which may or may not be you... Its often very easy to forget number 2 - so, while writing doing things like avoiding function calls may be faster for 1) it can end up making things a lot slower for 2) Also, when you go through your code optimise it, make sure you are efficient with your efforts - you will probably find you can nail down key performance spikes to just a few functions / algorithms... be careful not to optimise to death, and try and measure your gains at each step I'm not saying code shouldnt be optimised at the expense of (human) readability, just that sometimes it gets a little overdone... ta PBH On 12/21/05, Steven Sacks [EMAIL PROTECTED] wrote: the fastest loop through an array is: var len = myArray.length; while( len-- ) { ... } yes, it's faster then for..in. Not always. Sometimes, this loop is faster than a while (i--) for (var i = items.length; --i - (-1); ) { ... } It's ugly, yes, but it is faster than while (i--) depending on how many items you're iterating through. Run some tests if you don't believe me. :) ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Faster code?
What I want to know is who is paying for #2? Very rarely do I ever get time to comment anything, and even if I did, the code I commented changes the next day, rendering the whole endeavor fruitless. ...not to mention most service work is always a custom job/rewrite anyway. - Original Message - From: Paul BH [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: Wednesday, December 21, 2005 4:49 PM Subject: Re: [Flashcoders] Faster code? I think these are all great, but if I can be the voice of caution for a moment... remember that when you write code, it is for 2 interpreters: 1) the Actionscript VM 2) the person who has to go back and change stuff at a later date, which may or may not be you... Its often very easy to forget number 2 - so, while writing doing things like avoiding function calls may be faster for 1) it can end up making things a lot slower for 2) Also, when you go through your code optimise it, make sure you are efficient with your efforts - you will probably find you can nail down key performance spikes to just a few functions / algorithms... be careful not to optimise to death, and try and measure your gains at each step I'm not saying code shouldnt be optimised at the expense of (human) readability, just that sometimes it gets a little overdone... ta PBH On 12/21/05, Steven Sacks [EMAIL PROTECTED] wrote: the fastest loop through an array is: var len = myArray.length; while( len-- ) { ... } yes, it's faster then for..in. Not always. Sometimes, this loop is faster than a while (i--) for (var i = items.length; --i - (-1); ) { ... } It's ugly, yes, but it is faster than while (i--) depending on how many items you're iterating through. Run some tests if you don't believe me. :) ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Faster code?
Anyone know of good optimizations to make to code so that it'll run faster in Flash? What specific problems are you trying to overcome with these optimizations? Optimizing before the code is completely written isn't optimization, it's simply obfuscation. To optimize something implies that there is an inefficiency you are trying to overcome. If the whole app is just slow, you should spend some time identifying which parts are slow and why, and then you can be much more focused in your optimizations. Randomly replacing chunks of your code with optimized code is likely to do no more than confuse you and *maybe* save you a few milliseconds. On the other hand, if you know exactly which loop or function is slow, there may be a number of things you can do to save tenths of seconds instead. Also, fairly often it is the approach that is inefficient, not the code itself. Fixing your specific inefficiencies may require some refactoring, but you won't know that until you identify and isolate the problem. The goal of optimization isn't to eek out every cycle you can, but rather to make your specific application run as well as it can, and often that means changing the way you approach the problem. Changing your code to use optimized loops or whatever may gain you hundredths of a second, but changing your approach can save you several seconds in one fell swoop. ryanm ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Faster code?
This happens all too often. As common as this is, it is something you *must* do. Especially if you are the person that has to go back and change stuff at a later date. I dont know how many times I have gone back and looked at my code and I was like, what the (explicitive deleted) was I doing. Now I write code for readability. // bad (IMHO) if (getIsTrue(myTest)) { return (10/2 + 5)/mc._x; } // good var isSomethingTrue = getIsTrue(myTest) if (isSomethingTrue) { var retVal = (10/2 + 5)/mc._x; return retVal; } Trust me dude, I am having to rewrite an asp app in flash remoting asp.net and none of the code is commented. So I have spent 3/4ths of my time trying to interprit another persons code and the other half writing a flash remoting version of it. Readability is more important than speed (IMHO). Either way comment. :) Judah JesterXL wrote: What I want to know is who is paying for #2? Very rarely do I ever get time to comment anything, and even if I did, the code I commented changes the next day, rendering the whole endeavor fruitless. ...not to mention most service work is always a custom job/rewrite anyway. - Original Message - From: Paul BH [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: Wednesday, December 21, 2005 4:49 PM Subject: Re: [Flashcoders] Faster code? I think these are all great, but if I can be the voice of caution for a moment... remember that when you write code, it is for 2 interpreters: 1) the Actionscript VM 2) the person who has to go back and change stuff at a later date, which may or may not be you... Its often very easy to forget number 2 - so, while writing doing things like avoiding function calls may be faster for 1) it can end up making things a lot slower for 2) Also, when you go through your code optimise it, make sure you are efficient with your efforts - you will probably find you can nail down key performance spikes to just a few functions / algorithms... be careful not to optimise to death, and try and measure your gains at each step I'm not saying code shouldnt be optimised at the expense of (human) readability, just that sometimes it gets a little overdone... ta PBH On 12/21/05, Steven Sacks [EMAIL PROTECTED] wrote: the fastest loop through an array is: var len = myArray.length; while( len-- ) { ... } yes, it's faster then for..in. Not always. Sometimes, this loop is faster than a while (i--) for (var i = items.length; --i - (-1); ) { ... } It's ugly, yes, but it is faster than while (i--) depending on how many items you're iterating through. Run some tests if you don't believe me. :) ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] Faster code?
Your // bad block looks ok to me. The only reasons I can think of to store the value first before using it is if you need it more than once or if the method/function name isn't clear, you can make it more so by the the name of the valiable you use for the returned value. Ade -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Judah Frangipane Sent: 21 December 2005 23:10 To: Flashcoders mailing list Subject: Re: [Flashcoders] Faster code? This happens all too often. As common as this is, it is something you *must* do. Especially if you are the person that has to go back and change stuff at a later date. I dont know how many times I have gone back and looked at my code and I was like, what the (explicitive deleted) was I doing. Now I write code for readability. // bad (IMHO) if (getIsTrue(myTest)) { return (10/2 + 5)/mc._x; } // good var isSomethingTrue = getIsTrue(myTest) if (isSomethingTrue) { var retVal = (10/2 + 5)/mc._x; return retVal; } Trust me dude, I am having to rewrite an asp app in flash remoting asp.net and none of the code is commented. So I have spent 3/4ths of my time trying to interprit another persons code and the other half writing a flash remoting version of it. Readability is more important than speed (IMHO). Either way comment. :) Judah JesterXL wrote: What I want to know is who is paying for #2? Very rarely do I ever get time to comment anything, and even if I did, the code I commented changes the next day, rendering the whole endeavor fruitless. ...not to mention most service work is always a custom job/rewrite anyway. - Original Message - From: Paul BH [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: Wednesday, December 21, 2005 4:49 PM Subject: Re: [Flashcoders] Faster code? I think these are all great, but if I can be the voice of caution for a moment... remember that when you write code, it is for 2 interpreters: 1) the Actionscript VM 2) the person who has to go back and change stuff at a later date, which may or may not be you... Its often very easy to forget number 2 - so, while writing doing things like avoiding function calls may be faster for 1) it can end up making things a lot slower for 2) Also, when you go through your code optimise it, make sure you are efficient with your efforts - you will probably find you can nail down key performance spikes to just a few functions / algorithms... be careful not to optimise to death, and try and measure your gains at each step I'm not saying code shouldnt be optimised at the expense of (human) readability, just that sometimes it gets a little overdone... ta PBH ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Faster code?
I just re-write. Everytime I'm asked to port old code, it's usually in AS1, or AS1 that masquareades as AS2, or is so messed up, it needs to be re-written anyway. Additionally, half of those projects are upgrade from AS1 to AS2 or Flash to Flex. If Flash stops changing, and the code that keeps getting thrown at me actually works for a change and is malleable, then I could see the point of commenting. Currently, nope. - Original Message - From: Judah Frangipane [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: Wednesday, December 21, 2005 6:10 PM Subject: Re: [Flashcoders] Faster code? This happens all too often. As common as this is, it is something you *must* do. Especially if you are the person that has to go back and change stuff at a later date. I dont know how many times I have gone back and looked at my code and I was like, what the (explicitive deleted) was I doing. Now I write code for readability. // bad (IMHO) if (getIsTrue(myTest)) { return (10/2 + 5)/mc._x; } // good var isSomethingTrue = getIsTrue(myTest) if (isSomethingTrue) { var retVal = (10/2 + 5)/mc._x; return retVal; } Trust me dude, I am having to rewrite an asp app in flash remoting asp.net and none of the code is commented. So I have spent 3/4ths of my time trying to interprit another persons code and the other half writing a flash remoting version of it. Readability is more important than speed (IMHO). Either way comment. :) Judah JesterXL wrote: What I want to know is who is paying for #2? Very rarely do I ever get time to comment anything, and even if I did, the code I commented changes the next day, rendering the whole endeavor fruitless. ...not to mention most service work is always a custom job/rewrite anyway. - Original Message - From: Paul BH [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: Wednesday, December 21, 2005 4:49 PM Subject: Re: [Flashcoders] Faster code? I think these are all great, but if I can be the voice of caution for a moment... remember that when you write code, it is for 2 interpreters: 1) the Actionscript VM 2) the person who has to go back and change stuff at a later date, which may or may not be you... Its often very easy to forget number 2 - so, while writing doing things like avoiding function calls may be faster for 1) it can end up making things a lot slower for 2) Also, when you go through your code optimise it, make sure you are efficient with your efforts - you will probably find you can nail down key performance spikes to just a few functions / algorithms... be careful not to optimise to death, and try and measure your gains at each step I'm not saying code shouldnt be optimised at the expense of (human) readability, just that sometimes it gets a little overdone... ta PBH On 12/21/05, Steven Sacks [EMAIL PROTECTED] wrote: the fastest loop through an array is: var len = myArray.length; while( len-- ) { ... } yes, it's faster then for..in. Not always. Sometimes, this loop is faster than a while (i--) for (var i = items.length; --i - (-1); ) { ... } It's ugly, yes, but it is faster than while (i--) depending on how many items you're iterating through. Run some tests if you don't believe me. :) ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Faster code?
If you change that function, do you re-write all of your documentation? - Original Message - From: ryanm [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: Wednesday, December 21, 2005 6:09 PM Subject: Re: [Flashcoders] Faster code? What I want to know is who is paying for #2? Very rarely do I ever get time to comment anything, and even if I did, the code I commented changes the next day, rendering the whole endeavor fruitless. ...not to mention most service work is always a custom job/rewrite anyway. Wow... that sucks. I hope they're small projects. Without good a reusable (and well-commented) code base, most of the larger projects I work on wouldn't even be possible. I have, at minimum, at least something like the following before every method (or sometimes groups of methods) in my classes: (spacing is jacked, but forms a box in the Flash IDE) // // // ## Function: ShowMessage ## // // ## Parameters:## // // ## Message msg## // // #### // // ## This function determines how to display a message object. It ## // // ## accepts a single message object as a parameter and returns nothing.## // // #### // // ## Not all messages are displayed, certain types of system messages ## // // ## are used to close connections, accept or decline private chats,## // // ## etc, and may or may not display any text to the user on receipt. ## // // // I guess it really depends on the types of projects you are doing. But if there is even a chance that I'll have to come back and edit a class later, I leave myself comments next to *any* optimization so that I know when and why I put it there. At my current job, there are actually new entries in my comments, like this: // ## Modified:Ryan Mattes 12/20/05 Reviewed:Abraham Saldana 12/21/05 ## // Any code that goes into production has to follow a code standard, be reviewed by my peers, and have a record of when and why I went in and changed it. The upside being that if something breaks, everyone knows who broke it and when, making it very easy to find and fix, and if someone new comes in, they can easily figure out what the code does and how to use it (they're actually crosstraining some C# devs by having them read my source). What I want to know is who pays people to write code by the seat of their pants anymore, and why would you want to? ryanm ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Faster code?
Re-read your email. Only recently have I been on bigger projects. Even so, I'm usually the main developer for a given code-base, and others are on other projects, so no ones ever looking at the code next to me. Secondly, the requirements + code-base change so much, that documenting is a waste of time, when at any moment you could wax a class, and thus destroy 20 minutes worth of documentation time. On the 2 projects I was one where I worked with a team of developers, we were in constant contact, either in person or over AIM, and neither had problems reading eachothers code that was comment-less. We were using ARP, so it helped communication; when I updated a command, he knew where to look, and vice-versa. Admittingly, the little commenting we did have, which we couldn't live without was at the top of the file for Views; it merely reported where the app the View was and what it represented since we had a lot of forms. That was it, though, and I felt things went just fine. Hanging on the Flex list, apparently my projects, even the big ones, are to the scope level that others are, although, the more I use Flex, the more it feels like. The arguments we have over ViewHelpers in Cairngorm, for example, clearly illustrate the differences. If you have an insane amount of Views with a lot of developers working on the project with no guarentee they'll ever be in communication, I can clearly see the need for commenting, at least in the ViewHelper (class that implements functions of the View without you the developer having to know anything about the View). Same for Delegates that handle a lot of business logic and data-mangling coming from the back-end. So, I guess I've just never been on those types of projects. I swear it's felt like it in some of them, but it always felt manageable to me, no matter how many Views/Commands we had. ARP or Cairngorm always helped me and my team, and scope creep was more easily managed. As to your last question, your are apparently in one of the few companies that do those pratices, and apparently believes they work. - Original Message - From: ryanm [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: Wednesday, December 21, 2005 6:09 PM Subject: Re: [Flashcoders] Faster code? What I want to know is who is paying for #2? Very rarely do I ever get time to comment anything, and even if I did, the code I commented changes the next day, rendering the whole endeavor fruitless. ...not to mention most service work is always a custom job/rewrite anyway. Wow... that sucks. I hope they're small projects. Without good a reusable (and well-commented) code base, most of the larger projects I work on wouldn't even be possible. I have, at minimum, at least something like the following before every method (or sometimes groups of methods) in my classes: (spacing is jacked, but forms a box in the Flash IDE) // // // ## Function: ShowMessage ## // // ## Parameters:## // // ## Message msg## // // #### // // ## This function determines how to display a message object. It ## // // ## accepts a single message object as a parameter and returns nothing.## // // #### // // ## Not all messages are displayed, certain types of system messages ## // // ## are used to close connections, accept or decline private chats,## // // ## etc, and may or may not display any text to the user on receipt. ## // // // I guess it really depends on the types of projects you are doing. But if there is even a chance that I'll have to come back and edit a class later, I leave myself comments next to *any* optimization so that I know when and why I put it there. At my current job, there are actually new entries in my comments, like this: // ## Modified:Ryan Mattes 12/20/05 Reviewed:Abraham Saldana 12/21/05 ## // Any code that goes into production has to follow a code standard, be reviewed by my peers, and have a record of when and why I went in and changed it. The upside being that if something breaks, everyone knows who broke it and when, making it very easy to find and fix, and if someone new comes in, they can easily figure out what the code does and how to use it (they're actually crosstraining some C# devs by having them read my source). What I want to know is who pays people to write code by the seat of their pants anymore, and why would you want to? ryanm ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http