Wednesday, March 24, 2010

Coding Rule

Here, i decided to write my coding rules to code as i prefer, subsequently.

1. In any function or procedure body don't write more than 40 rows.
It can help you view entire function in 1 page.
2. Use 0 function status value on perfect success, 1< on application errors, -1 or -1> on runtime errors.
3. Use layer or interface as soon as possible.
This can help you make updates on online apps.
4. Always log. On every start of a function, log parameters and after generated result, log result
This is your key to secure coding.
5. Naming convention is key to fast coding. Create your own or pick any from experts' templates

Sunday, March 21, 2010

Google Maps - /* Guardian removed escaped content */

Last week, while i was loading Google Map in intranet web site, there was a syntax error in javascript loaded from http://maps.gstatic.com/intl/en_ALL/mapfiles/208a/maps2.api/main.js, and was not showing google map.
I found that firewall replaced some codes with "Guardian removed escaped content" text. I told our security deparment to unblock gstatic.com, i got rid of the problem. We use SmoothWall fire, it's latest updates were changed or configured to replace javascript comment with the text. Maybe this post can help someone who faced the same problem with me :)