[quote]Exactly - you could type the equation in wrongly such that it was a syntax error. A scripting language won’t detect it until runtime. Perhaps it only gets run 2/3rds of the way through the game in an obscure circumstance. This is why we developed compilers!
I still don’t get it. Keep talking!
Cas
[/quote]
In 99.999% of situations you will visually spot the syntax error. But writing that equation has taken you 3 seconds. Writing a class to house a method and a method to house the equation, and choosing an immutable signature and choosing (and possibly defining) types…all this takes a lot more than 3 seconds. You usually use a script in such a situation (IF you decided it was appropriate) because:
[] The equation would be edited by people who won’t or can’t edit java files - or can’t be trusted to - but who can just about manage basic algebra (or, indeed, classless basic).
[] or: The minutes saved in not adding the java baggage, and compiling, and recompiling for each and every minor change, outweigh the time lost for the occasional syntax error that slips through and wastes a lot of time in one go.
[] or: You need to save time NOW and you are willing to do that at the expense of losing even more time in the future (e.g. “demo has to work tomorrow morning; we can re-code next month, after GDC is over, and gradually replace the scripted bits with systems bits”).
[] or: You want people editing this who don’t have access to a compiler (perhaps they’re editing code in a web-browser and wouldn’t have the nous to intrepet compiler errors even if you redirected them to the web browser; nb: I’ve been involved in a game project where this actually happens - people with 0 programming experience are able to edit complex scripts in web forms; this is appropriate for their use case, and works very nicely)
[*] or: …many others…
Really, though, there isn’t much cause for a debate about whether you should or shouldn’t use scripting langs (it only makes sense to evaluate each situation separately). They’re merely another tool, and AFAICS it’s pretty obvious what their main pros and cons are compared to more proscribed languages, like Java. You just evaluate them for each part of your project, no?