>>> What's your mind set when it comes to programming?
Does it work? Is it perfect? (Is it safe?) (Is it readable/commented?)
>>> Do you like to look for one specific problem to fix?
- I don't need to look for anything, I either solve an old problem, solve a new problem, or improve an old script.
- Answering questions on the forum has helped round my knowledge of AutoHotkey, to check certain commands that I never use, or take on challenging RegEx questions.
- Sometimes I will learn a tiny bit of information from a question, not even the answer. I will be reminded of an old issue I wanted to double-check. Sometimes a gap in my knowledge is exposed that I didn't know I had, e.g. recently: opening the Desktop user/public combined folder versus the Desktop user proper folder in Explorer (taking into consideration that Explorer might not be the default app to open programs with), plus I had previously made a special effort to find ways to open special folders and Control Panel items.
- The more you know, the more you can notice a tiny thing that may be of great value.
- Btw users should be wary of stating something with certainty, or without qualifiers, for example, I often have to double-check basic things in the documentation before posting, one example of this was regarding 'UTF-8 ini files', I knew how the IniRead/IniWrite commands would probably work, and I could try to figure everything out just by reading the documentation, but really I had to write the code and then double-check it, which I did.
- Talking about double-checking, it's awful if you've made a typo or missed out a word, to know that editing the post will untidy the post by leaving a 'last edited' message. I also find, too many, or too few, commas, just as bad nowadays.
- Sometimes a problem that I would likely experience in the future is anticipated by someone else, I am forewarned and forearmed.
- I dread changes in Windows 8 and Windows 10, that may exist, but that I do not yet know of.
- I am concerned that we need a web browser that we can do COM-equivalent actions with, and that perhaps using Selenium is not the answer if it only lets you operate on one-tab only windows, and/or has other restrictions. I would even consider using a little-known browser as my main(/only) browser, if it had this capability.
- I also tend to think of tutorials as important, not just scripts.
- Generally speaking, I do something that is useful to me, I don't look for things to do for the sake of it, I suppose I could look at Project Euler if I ever wanted to do code but didn't have any code to do. I could also start reading the AutoHotkey source code. Another idea is to skim read all of the posts by a particular user.
- Occasionally I'll do something silly like 'qwertybetical order' or metric time or image-based scripts like the Solar System/Mandelbrot set scripts. Or the AHK console script that I did as a joke because I wanted an excuse to create a GUI with grey text on a black background, which looks quite cool, but which could in theory be useful. C++ has a console window available, so why not AHK, so I made one.
>>> Do you try to show off your skills in programming by making a highly detailed script/program?
- I don't always insist on making everything as short as possible, but sometimes a small piece of code can look really elegant.
Code: Select all
(oArray := {})["a","b","c"] := 3
;v.
oArray := {}
oArray["a","b","c"] := 3
- I want my scripts to be as simple as possible, so in theory, no. I do like to make my scripts as readable and as clear as possible, this is often helped by clear variable names, indicating variables/objects with 'v'/'o' prefixes, so that you can distinguish them from command names etc, and occasional comments.
- Also to save people bother, it's best to include any constants as comments, i.e names not just numbers. This is not something I always did, but I do now, this definitely helps me when I review old scripts.
- In this regard, if you can stand the 7 gig or so download for Visual Studio Express, the .h files (header files) in C:\Program Files (x86)\Windows Kits\8.1 plus NirSoft SearchMyFiles are really useful for looking up constants.
- Rather than showing off per se, one has to love the elegant hack, I believe these to be rare, but I have listed a few on my homepage. I would welcome anyone to post a collection of them.
>>> Do you tend to veer off topic from your original project to move to another?
- I think people like variety, so switching between multiple projects can be easier than spending all day on one project.
- Sometimes if I have a long to-do list, I can group certain things together, that have some sort of overlap, and investigate them simultaneously, this can be quite efficient.
- I tend to have one goal, and then once the goal is met, the project is over. Sometimes you'll find additional features you would like to add, to a project that you've completed. Feature requests, either by you or by someone else.
>>> Why are scripts created by experts so complex that they aren't readable? They're written in the same language? I'm just curious
- Laziness. Lack of expertise. Lack of understanding of other people. Haven't collected personal principles for clear coding. The lack of style.
- I have done so much with AHK, but I would generally say, never use object classes. For people that haven't questioned this, they probably won't agree with this, should they read this. But many months later it might sink in.
- The AHK standard arrays (i.e. its methods) and File object are useful however.
- I've always been willing to use object classes, but realistically they've never been useful, and using straightforward standard arrays and/or functions provides the better approach.
- Also, if you use functions rather than methods, this is more flexible, you can apply them to anything, they aren't anchored to the object.
- It's been painful trying to deconstruct someone's class to understand how something works, or to create a simple stand-alone function. Often people create a fancy class, and perhaps they feel proud of it, a 'concept', but then someone creates their own class for something similar, e.g. different GUI control types, and it's completely different and incompatible. So I say, keep it simple, and don't patronise the user. Don't insist on creating a vision, keep everything as low-level as possible, don't impose an esoteric way of doing something where it's not needed or wanted.
- It's amusing when you notice someone's personality on the forum, but more humorous is when you notice their inflexibilities, or an occasional lack of imagination.
- (Assuming that the code works.) Style is the most important thing, indeed Linus Torvalds in a TED talk said he looks for style.
Good questions. Cheers.