PokeZam Forums  

Go Back   PokeZam Forums > Off-Topic > Technology

Technology For everything from Video Games to Cellphones.

Closed Thread
 
Thread Tools Display Modes
  #1  
Old 04-17-2008
FreezeWarp's Avatar
FreezeWarp FreezeWarp is offline
Pokezam Webmaster

 
Join Date: Apr 2007
Location: Petting a Kitty :D
Posts: 3,986
Default Good Guidelines to follow when Programming

This thread was posted to save my work.

1. Make sure it is usable on Internet Explorer 5+, Opera 7+, Firefox 1+, and Safari/Konqueror (uncommon, not as important)
....a. Keep the languages you use compliant with all browsers. NEVER use CSS3 and HTML 5
....b. Use common image forms, don't use .fbm (Fuzzy Bitmap), or .ic1, .ic2, .ic3 (Low, Medium, and High Resolution Image Graphic)
....c. Be careful with Microsoft fonts. Macs and Linux Users can't use them unless they don't load software like OpenOffice.
....d. And use code fixes for different browsers. However, you probably won't use one for anything but internet Explorer (are we surprised?).
2. Keep things fast. Here is a good formula:
....a. Use CSS for the graphic element. Stay away from images if you are merely trying to get data across.
....b. Use minimal Javascript, though still use it as you can't do nothing if you don't use some of it.
....d. Absolutely NEVER use FLASH if it loads automatically.
....e. Everything else should be HTML and Database (php, mysql) as that should be all you need
__________________
Annoucments:

It seems as though I have disappeared again. Se ya soon, and please, use email (rehtaew@gmail.com). I'm 20 times more likely to read your message then over PM (and 30 times more likely to reply).

ZamFights Beta should come around Christmas, now.

Spoiler Alert:  ZamFights Progress    

Summary

ZamFights, a Pokemon Mass Multiplayer Online Role Playing Game, developed by Pokezam's Webmaster Freezewarp, continues its development into Alpha 7, where you can trade Pokemon with a global trade station like feature and battle other trainers. Several bugs were also fixed.

Alpha 9, now in development, will feature numerous events and locations to go to, that is up to Fuschia. It will also feature the new, interactive map, numerous minor features, and an altered look.

Alpha 9 should come around Thanksgiving, and Alpha 10, or the public Beta, should come around Christmas.

Alpha 8 Preview




I actually like the idea of a sixth generation Pokemon Emerald remix; few people think of the possibilities that one game has in full, colorful, barely pixaleted 3-D (in other words, think of a Play Station 2 or Xbox Original). The existing 3D we have with the DS is good, but the next generation of handheld consoles should give much more detail to the game - imagine being able to change your perspective to look into the sky while the stormcloud is slowly stretching across the region once Kyogre and Groudon have both been awoken. Imagine seeing the sky tower, and a green tail, to the left, and mirages to the right. For that matter, think of Mirage Island!

There are so many other moments for which we could experience in perspective-3D Pokemon Emerald; the battle frontier is one example, but just seeing the sun rise and set as the time passes in Dewford city would be awesome. Of course, my dreams may be more than one generation away; are there any Wii games that even would make this real?
  #2  
Old 04-17-2008
Kaboom Kaboom is offline
Twilight Blaziken
 
Join Date: Aug 2007
Location: The Dark World, for Darkness is the leading power!
Age: 17
Posts: 1,028
Default

Certain things are done in different ways on different browsers, just so you know.
  #3  
Old 06-16-2008
Kaboom Kaboom is offline
Twilight Blaziken
 
Join Date: Aug 2007
Location: The Dark World, for Darkness is the leading power!
Age: 17
Posts: 1,028
Default

BUMP!
Here are my responses to your suggestions:

Quote:
Originally Posted by ShinyRaichu View Post
1. Make sure it is usable on Internet Explorer 5+, Opera 7+, Firefox 1+, and Safari/Konqueror (uncommon, not as important)
You can in fact detect a user's browser (see http://www.adamhaskell.net/getinfo.php for details) and redirect to a different page if you have browser-specific elements. This saves time for 1.d.

....a. Keep the languages you use compliant with all browsers. NEVER use CSS3 and HTML 5
There is no problem with using these latest versions, as long as you only use elements which exist in previous versions. If you must use new elements, use the getinfo stuff to make sure the user can view it and redirect if not. (As a side note, I prefer HTML5 because the doctype tag is simply <!DOCTYPE HTML>

....b. Use common image forms, don't use .fbm (Fuzzy Bitmap), or .ic1, .ic2, .ic3 (Low, Medium, and High Resolution Image Graphic)
The recommended image format is PNG. However, BMP is better for icons, JPG is excellent for photos, and GIF is the only format to support animations. An interesting note: the GIF format is patented, so theroretically you should be paying royalties every time you use it!

....c. Be careful with Microsoft fonts. Macs and Linux Users can't use them unless they don't load software like OpenOffice.
Use Microsoft fonts if you will, but be sure to define a substitute font in case the user doesn't have the font installed. This applies to all fonts, and you should always have a failsafe defined (such as Times or Arial)

....d. And use code fixes for different browsers. However, you probably won't use one for anything but internet Explorer (are we surprised?).
You can have completely different pages which are redirected to depending on browser (see above), but be aware that it isn't foolproof.


2. Keep things fast. Here is a good formula:
....a. Use CSS for the graphic element. Stay away from images if you are merely trying to get data across.
How about: use CSS for everything! Avoid local styling wherever possible (use classes instead). Also, most attributes in tags are deprecated to make way for CSS. Use it now to avoid having to redo everything in a few years' time!

....b. Use minimal Javascript, though still use it as you can't do nothing if you don't use some of it.
If you have a page which requires JS, be sure to use <NOSCRIPT> to display a message if JS is off. Another trick to be used in conjunction is to use JS to generate the page, which means that there will be no errors or ugly content if JS is off.

....d. Absolutely NEVER use FLASH if it loads automatically.
That should be left to your own judgement. FLASH can be good, but can also be very bad. Use at your own risk!

....e. Everything else should be HTML and Database (php, mysql) as that should be all you need
Words of great wisdom!
Another comment: You can use the getinfo stuff to make sure that the user's browser supports elements such as tables, JS, frames and the like. However, I noticed the PSP returns NULL when asked if it supports JS, frames..., so I advise checking if it's a WAP device beforehand.
Also: You can use the PHP trigger_error( $error_msg, $error_level) method to alert people to potential problems. $err_msg is the error message to display, and $error_level is one of the following:
- E_USER_NOTICE: The lowest level. Outputs a notice and continues running.
- E_USER_WARNING: Same as above, but used to designate a potentially fatal error.
- E_USER_ERROR: A fatal error, the script stops and the page is displayed as it has been built so far.

Any questions: do PM me!
  #4  
Old 06-16-2008
DX-MON's Avatar
DX-MON DX-MON is offline
On the Road
 
Join Date: Mar 2008
Age: 17
Posts: 57
Default

Quote:
Originally Posted by Kaboom View Post
The recommended image format is PNG. However, BMP is better for icons, JPG is excellent for photos, and GIF is the only format to support animations. An interesting note: the GIF format is patented, so theroretically you should be paying royalties every time you use it!
Kaboom, your comment about GIF is WRONG, the patent ran out 4 years ago.....

see http://en.wikipedia.org/wiki/GIF for more on that format and it's now run-out patent.

Also, it wasn't the format itself that was patented, it was a compression method it could employ that was, the LZW algorithm.
__________________
The worst thing about the darkness is the light at the end - DX-MON
Spoiler Alert:  Dragons    



Click us or we'll die!

Last edited by DX-MON; 06-16-2008 at 09:12 AM.
  #5  
Old 06-16-2008
Kaboom Kaboom is offline
Twilight Blaziken
 
Join Date: Aug 2007
Location: The Dark World, for Darkness is the leading power!
Age: 17
Posts: 1,028
Default

Oh, did it? Never mind, nobody cared anyway! I always use PNG except for anims. It interlaces better, I think... and the W3C "wishes web designers use it".
  #6  
Old 06-16-2008
DX-MON's Avatar
DX-MON DX-MON is offline
On the Road
 
Join Date: Mar 2008
Age: 17
Posts: 57
Default

Now, for my 2 cents on good programming practices, this time it's C/C++....
  1. Don't use a compressed format (no if (a == b) {
    statements;
    })
    if you have to use brackets, use the form if (a == b)
    {
    statements;
    }
    as from that it's always clear as to what each braket belongs to.
  2. Always comment upon the code, not just for others sakes, but for yours in the future
  3. Whenever you have to do complex things, split it up into separate functions
  4. NEVER with hold on using switch/select statements
  5. If you're thinking that you've not got enough checking happening in your code, you don't.... never think that lots of if statemnts are bad, they aren't.
  6. too many functions are bad, you're probably repeating something, or not optimizing it properly.

If you do the above in C/C++ then you will get good, optimized code out of any compiler, and it'll always be easy to debug.
__________________
The worst thing about the darkness is the light at the end - DX-MON
Spoiler Alert:  Dragons    



Click us or we'll die!
  #7  
Old 06-16-2008
FreezeWarp's Avatar
FreezeWarp FreezeWarp is offline
Pokezam Webmaster

 
Join Date: Apr 2007
Location: Petting a Kitty :D
Posts: 3,986
Default

@Kaboom - I have to disagree with displaying pages differently for different browsers. It works, but it takes up space and time and in all honesty, should you need to?

In addition, CSS can slow a page's load if used too much. I really can't phrase what I'm trying to say right (so don't start shooting at me), but rarely use inline css and only add names in an external file if they will reoccur often.
__________________
Annoucments:

It seems as though I have disappeared again. Se ya soon, and please, use email (rehtaew@gmail.com). I'm 20 times more likely to read your message then over PM (and 30 times more likely to reply).

ZamFights Beta should come around Christmas, now.

Spoiler Alert:  ZamFights Progress    

Summary

ZamFights, a Pokemon Mass Multiplayer Online Role Playing Game, developed by Pokezam's Webmaster Freezewarp, continues its development into Alpha 7, where you can trade Pokemon with a global trade station like feature and battle other trainers. Several bugs were also fixed.

Alpha 9, now in development, will feature numerous events and locations to go to, that is up to Fuschia. It will also feature the new, interactive map, numerous minor features, and an altered look.

Alpha 9 should come around Thanksgiving, and Alpha 10, or the public Beta, should come around Christmas.

Alpha 8 Preview




I actually like the idea of a sixth generation Pokemon Emerald remix; few people think of the possibilities that one game has in full, colorful, barely pixaleted 3-D (in other words, think of a Play Station 2 or Xbox Original). The existing 3D we have with the DS is good, but the next generation of handheld consoles should give much more detail to the game - imagine being able to change your perspective to look into the sky while the stormcloud is slowly stretching across the region once Kyogre and Groudon have both been awoken. Imagine seeing the sky tower, and a green tail, to the left, and mirages to the right. For that matter, think of Mirage Island!

There are so many other moments for which we could experience in perspective-3D Pokemon Emerald; the battle frontier is one example, but just seeing the sun rise and set as the time passes in Dewford city would be awesome. Of course, my dreams may be more than one generation away; are there any Wii games that even would make this real?
  #8  
Old 06-16-2008
Kaboom Kaboom is offline
Twilight Blaziken
 
Join Date: Aug 2007
Location: The Dark World, for Darkness is the leading power!
Age: 17
Posts: 1,028
Default

Space is not a problem with Bluehost (and I think others), since you get infinity bytes of it. As for time, it takes at most half a second to get the browser data and to redirect, since there's nothing sent to the browser. Therefore, give or take a second, the loading time is unchanged.

As for CSS, it is much faster than the deprecated attributes, as long as you use it efficiently.

PS I'm not shooting you, I'm making suggestions based on yours
  #9  
Old 06-16-2008
FreezeWarp's Avatar
FreezeWarp FreezeWarp is offline
Pokezam Webmaster

 
Join Date: Apr 2007
Location: Petting a Kitty :D
Posts: 3,986
Default

Quote:
Originally Posted by Kaboom View Post
Space is not a problem with Bluehost (and I think others), since you get infinity bytes of it. As for time, it takes at most half a second to get the browser data and to redirect, since there's nothing sent to the browser. Therefore, give or take a second, the loading time is unchanged.

As for CSS, it is much faster than the deprecated attributes, as long as you use it efficiently.

PS I'm not shooting you, I'm making suggestions based on yours
Actually I was referring to the coders time, its just not worth it. It'd be much faster if the browsers were all made to standards.

True, though a lot of depreciated values really aren't good in the first place, such as blink tags.
__________________
Annoucments:

It seems as though I have disappeared again. Se ya soon, and please, use email (rehtaew@gmail.com). I'm 20 times more likely to read your message then over PM (and 30 times more likely to reply).

ZamFights Beta should come around Christmas, now.

Spoiler Alert:  ZamFights Progress    

Summary

ZamFights, a Pokemon Mass Multiplayer Online Role Playing Game, developed by Pokezam's Webmaster Freezewarp, continues its development into Alpha 7, where you can trade Pokemon with a global trade station like feature and battle other trainers. Several bugs were also fixed.

Alpha 9, now in development, will feature numerous events and locations to go to, that is up to Fuschia. It will also feature the new, interactive map, numerous minor features, and an altered look.

Alpha 9 should come around Thanksgiving, and Alpha 10, or the public Beta, should come around Christmas.

Alpha 8 Preview




I actually like the idea of a sixth generation Pokemon Emerald remix; few people think of the possibilities that one game has in full, colorful, barely pixaleted 3-D (in other words, think of a Play Station 2 or Xbox Original). The existing 3D we have with the DS is good, but the next generation of handheld consoles should give much more detail to the game - imagine being able to change your perspective to look into the sky while the stormcloud is slowly stretching across the region once Kyogre and Groudon have both been awoken. Imagine seeing the sky tower, and a green tail, to the left, and mirages to the right. For that matter, think of Mirage Island!

There are so many other moments for which we could experience in perspective-3D Pokemon Emerald; the battle frontier is one example, but just seeing the sun rise and set as the time passes in Dewford city would be awesome. Of course, my dreams may be more than one generation away; are there any Wii games that even would make this real?
  #10  
Old 06-16-2008
Kaboom Kaboom is offline
Twilight Blaziken
 
Join Date: Aug 2007
Location: The Dark World, for Darkness is the leading power!
Age: 17
Posts: 1,028
Default

Argh, not the dreaded <BLINK>! Anyway, anyone can do that with JS and it would work with no problems at all on all browsers, not just Netscape.

As for the matter of the programmer's time, I'd say it depended more on patience...
Closed Thread

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 04:57 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Template-Modifications by TMS
© 1999-2009 PokeZam. All Rights Reserved.