| View previous topic :: View next topic |
| Author |
Message |
Tuncay
Joined: 07 Nov 2006 Posts: 383 Location: Berlin
|
Posted: Fri Mar 21, 2008 9:04 pm Post subject: code validation on code-sections in Forum |
|
|
Here is a wish to the forum, not to AutoHotkey itself.
I think, it would make sense to validate the script code in code sections with JavaScript. It does not need to be conform with latest Ahk release, just simple checks.
Sure, it is not that easy to write such a JavaScript-Script.
At least checking simply the syntax is enough for most cases. If a code seems to be not correct, there could be a red advice that the code may actually not valid. |
|
| Back to top |
|
 |
Oberon
Joined: 18 Feb 2008 Posts: 458
|
Posted: Fri Mar 21, 2008 9:32 pm Post subject: Re: code validation on code-sections in Forum |
|
|
| Tuncay wrote: | | it would make sense to validate the script code in code sections with JavaScript | Why? |
|
| Back to top |
|
 |
Tuncay
Joined: 07 Nov 2006 Posts: 383 Location: Berlin
|
Posted: Fri Mar 21, 2008 10:12 pm Post subject: |
|
|
| That would catch some errors early and help us finding simple errors. If someone provide us code in forum, just to show how it is work or a script, then we have at least code that is minimal validating. |
|
| Back to top |
|
 |
Oberon
Joined: 18 Feb 2008 Posts: 458
|
Posted: Fri Mar 21, 2008 10:34 pm Post subject: |
|
|
| It's better if people test the code before posting it. AutoHotkey has the most comprehensive .ahk script validation available. |
|
| Back to top |
|
 |
jaco0646
Joined: 07 Oct 2006 Posts: 487 Location: MN, USA
|
Posted: Sat Mar 22, 2008 6:06 am Post subject: |
|
|
| Oberon wrote: | | It's better if people test the code before posting it. | It's also better if people eat a healthy diet, get regular exercise, and obey all traffic laws; but that doesn't prevent obesity and road rage.
| Oberon wrote: | | AutoHotkey has the most comprehensive .ahk script validation available. | Sounds like an excellent reason to port it to the forum.
P.S. Normally I don't write replies with sarcastic undertones such as this, but it's been a bad day for the Help forum: lots of spam, laziness, and people looking for handouts. The noble ethos of "Trust in the User" has taken a beating lately.
P.P.S. Since I don't often write the word "obesity," I checked it on my thesaurus (WordWeb) which has only 1 definition: "More than average fatness." For some reason, I find that extremely funny, and I'm truly laughing out loud as I type this!  _________________ http://autohotkey.net/~jaco0646/ |
|
| Back to top |
|
 |
Oberon
Joined: 18 Feb 2008 Posts: 458
|
Posted: Sat Mar 22, 2008 11:10 am Post subject: |
|
|
| jaco0646 wrote: | | Sounds like an excellent reason to port it to the forum. | Do you understand the implications? How many hours of R&D it would take a person competent in javascript to fully analyse the ahk syntax and write a complete cross-browser compatible validator. On some threads there are numerous (>10) codeblocks so parsing them all would consume large amounts of memory, crash browsers on slower computers and add seconds to the loading time on newer pcs. My firefox already consumes 200mb on average on my p4 3.2ghz 3gb ddr2 system. I predict a script of this nature will use another 20-50mb per page; on a usual session that would sum up to 100-150mb if caching/snapbacks are enabled. Don't forget codeblocks are also used for other languages and less often ascii art, so visitors would be welcome with unexpected error messages when they least expect it. |
|
| Back to top |
|
 |
|