tag:blogger.com,1999:blog-889604442512373664.post8898630749002285500..comments2023-10-31T08:28:52.391-07:00Comments on Computer Programming and Magic: The Gathering: Source Code PrivacyForgehttp://www.blogger.com/profile/15838286606081721333noreply@blogger.comBlogger3125tag:blogger.com,1999:blog-889604442512373664.post-80151481693789369512008-12-19T08:40:00.000-08:002008-12-19T08:40:00.000-08:00I'll take "proof of concept", in other words MTG F...I'll take "proof of concept", in other words MTG Forge actually works and that was my final goal.Forgehttps://www.blogger.com/profile/15838286606081721333noreply@blogger.comtag:blogger.com,1999:blog-889604442512373664.post-55206230925313923792008-12-17T20:45:00.000-08:002008-12-17T20:45:00.000-08:00@Nxwtypx: Macro design follows a bit of a differen...@Nxwtypx: Macro design follows a bit of a different protocal in terms of what is good and what isnt good practice. In scripting languages there is no compilation so you can make changes to the source whenever needed and anyone who has the script(macro) can make these changes. With Coding once the code has become an object only those who have access to the source can make the changes. Also 1k lines is a huge amount of code for a macro which normally has a few sharply focused tasks, but it is absolutely tiny for a program with serious functionality. If you looked at the source for Word(or Excel) For Windows that uses that macro youd find probably more like half a million lines of code. :) Maybe not since its been refined over a few decades but still it is more likely to much larger. With that much code a global variable can make mush of what you've written.:) <BR/><BR/>@Forge Yes it can be a private thing but sharing source is akin to collaboration. It gives other people a chance to help you fix things you didn't know how to fix. And maybe insight into how to refactor such code in the future. Also in the defense of global variable use. They exist for a reason besides just legacy. They should be used with great caution in any complex coding endeavor but they may indeed be the only GOOD way of accomplishing certain things. I prefer to put such data into Objects that are given global scope but I understand that Java is a bit funky with Scope issues. Also if you are uncomfortable with people viewing your source that tells me you think it is wrong/unworthy and that is a poor attitude. EVERYONE writes bad code sometimes. Your code is probably at its core principle just fine and stands as a proof of concept. That's no small thing.Gando the Wandering Foolhttps://www.blogger.com/profile/11853286404078430074noreply@blogger.comtag:blogger.com,1999:blog-889604442512373664.post-2689404997092038192008-12-17T15:55:00.000-08:002008-12-17T15:55:00.000-08:00I beg to differ - I usually happily show the code ...I beg to differ - I usually happily show the code of Macros I've created for work to anyone interested enough to see it.<BR/><BR/>As to global variables, perhaps my operations are too small (my biggest VBA macro hovering at a thousand lines), but I use them all the time; as to resetting them, I just have a big long subroutine to do it.Nxwtypxhttps://www.blogger.com/profile/04599046257253399532noreply@blogger.com