Forums

ForumsProgramming Forum

Good Programming Technique 101

Posted Oct 29, '08 at 1:10pm

MikeRLee

MikeRLee

11 posts

If I could I would edit that post as one of the paragraphs made no sense so here it is in English.

I will also disagree on saying that AS is purely OO. Just looking at some source code and you can see that it is also largely event-driven. OOP does not necessarily mean efficiency and ease of use. All programs are compiled into machine language - the code relies only on the compiler, the machine its running on and the programmers skill, to run quickly and smoothly. OOP isn't the answer to everything and you should always be open to other paradigms when it is needed.

 

Posted Nov 5, '08 at 12:50pm

LonLonRanch

LonLonRanch

178 posts

That's a good point Mike, I too wouldn't necessarily say that Actionscript is completely OOP, although (expecially with AS 3.0) it is headed in the right direction. And yes, OOP may not be best always, but it certainly has had history of good result in terms of good programming technique.

 

Posted Nov 7, '08 at 2:35pm

MikeRLee

MikeRLee

11 posts

In certain areas OOP has had a good history, mainly because it has become a craze which has pushed a lot of development into it. While this may be good for Flash, which I assume is prodominately used for animation and games, it is not so good for others. Functional, logical, procedural, generic and metaprogramming are still very important (procedural is a necessity even with OOP currently).
In fact, I just thought of a very good thought about OOP. It is almost dependant on procedural programming. A class isn't a class without methods, its a structure.
For a language to become completely object-orientated, everything from If statements to boolean operations need to be encapsulated in classes but you can see how ridiculous this is. Basically, even if AS ever becomes COMPLETELY object-orientated, it will have shot itself in the foot as it will have become tedious to create a new IfManager object and then ask it to run this method in this class if one value is {insert operation} than the other. This highlights that OOP will not nor ever work efficiently on its own.
After all that though, I agree it can bring out good results but I believe that that is also due to the amount of education that is spent on it. It is drilled into new programmers now to use it constantly and, as you will know, there are awful OO programs out there that could do with a bit of, lets say maintenance.
That was a bit of a ramble but what I mean to say is, and this is good advice so if you read anything, read this.
Find a paradigm that works for you. If concrete factory design patterns work for you, use them. If you prefer to split your programs into functions that each do a specific process, do that. Don't use a coding practise that does not work for you, otherwise your programs wont either. An application will only ever be as good - or as bad - as its programmer.

 

Posted Nov 25, '08 at 5:06pm

gameingkid

gameingkid

165 posts

right now i have gamemake 7.0 i think but it wont let me post my game on AG so i need to know what program to use to post games on AG and if its free or how much it costs so i know to start saving.

 

Posted Dec 1, '08 at 1:40pm

haYnguy

haYnguy

30 posts

If AS was purely OO, then you would NOT be able to directly modify the _x member of an object ( myObject._x = 34 )because it would violate encapsulation. Thus, AS is not purely OO...

Q.E.D :P

 

Posted Dec 19, '08 at 10:35pm

walkerm930

walkerm930

4 posts

hey gamingkid

if you want to make a game that you can upload to AG you gotta have make flash games using adobe flash. a 30 (i think) day trial can be found here-[url=https://www.adobe.com/cfusion/tdrc/index.cfm?product=flash&promoid=EBYEX&loc=en]

 

Posted Dec 19, '08 at 10:37pm

walkerm930

walkerm930

4 posts

i think the dash messed it up

link= [url=https://www.adobe.com/cfusion/tdrc/index.cfm?product=flash&promoid=EBYEX&loc=en]

 

Posted Dec 19, '08 at 10:43pm

walkerm930

walkerm930

4 posts

also lonlonranch has some good tips

if only i had known them sooner
i think the dash messed it up

link=

 

Posted Jan 3, '09 at 9:49am

PixelSmash

PixelSmash

579 posts

What I usually tend to do is if it becomes too much code on the timeline, I put it in a seperate .as file. For me, this makes it easier since it keeps everything together, yet doesn't show the 'useless' timeline GUI - which I don't use when I'm coding anyway

And a few seperate classes ofcourse, such as for the player and the GUI of the flash.

 

Posted Feb 8, '09 at 10:55pm

Gamerzneed

Gamerzneed

12 posts

scripting is rele confusing for me

 
Reply to Good Programming Technique 101

You must be logged in to post a reply!