6,456 reputation
1835
bio website
location United Kingdom
age 43
visits member for 4 years
seen 4 hours ago

Dec
16
comment Unicode and Fonts
Designing fonts is font design - just because a computer's involved doesn't make it programming.
Dec
2
comment How would one implement communication between an input device and a PC?
Of course I could be making some obsolete assumptions. For example, when you think about it, a USB game controller driver doesn't own a particular USB port. The port its currently dealing with may host multiple devices via a hub. IOW a game controller driver isn't really communicating directly with the hardware - there's other drivers in-between. And I'm sure I've heard about user-mode drivers or something like that.
Dec
2
comment How would one implement communication between an input device and a PC?
That's why Microsoft decided that all drivers should be checked by them (at a price) and should be signed - you still get unsigned drivers on occasion, but the user gets an alert and has to give specific permission to install them. So Microsoft has been systematically testing drivers and charging for that for quite a while. I'm not sure how far they are following the Apple model and checking and controlling Apps in the app store, but drivers were controlled for a long time before, there's good reasons for that, and Microsoft are unlikely to get complacent about them.
Dec
2
comment How would one implement communication between an input device and a PC?
For the windows store issue - I don't know for sure, I've never considered writing software to sell there, but drivers have special privileges and have an ability to crash the whole operating system that other software shouldn't have. If you remember Windows 98, almost all of the crashing issues with that were due to bad drivers - partly because Microsoft didn't control their development (e.g. the DDK back then was IIRC a free or cheap download) and partly because even the DDK examples had errors and there were few tools to catch them.
Dec
2
comment How would one implement communication between an input device and a PC?
I'm not sure why doing "some manner of magic" is a problem. Drivers, background services and applications are all software - they can all do calculations and make decisions. For joysticks, Windows has its own model of game controllers. You can fake that at the driver level certainly, but I can't see why you can't fake it at the Win32 API level by sending fake messages as well. That's not strong evidence that it can be, of course.
Dec
1
awarded  Nice Answer
Dec
1
comment How would one implement communication between an input device and a PC?
The most reliable method is IIRC to install drivers for virtual keyboard and mouse devices, as you seem to suggest. Send messages to those drivers which they translate to keyboard/mouse events. As far as Windows is concerned, these events are coming from a genuine keyboard/mouse. But that could easily be overkill, might get you in trouble with the windows app store if that's relevant, and means getting the Driver Development Kit. It may be easier to send fake messages via the Win32 API or .NET. See e.g. here
Nov
28
awarded  Yearling
Nov
21
answered Determining the winning condition for Tic-Tac-Toe
Nov
5
awarded  Nice Question
Sep
4
awarded  Good Answer
Aug
15
comment Has whitespace in identifiers ever been idiomatic?
Some dialects of BASIC have multi-keyword command names. Not the same thing, of course, but considering these are built-in commands in dialects with huge numbers of commands that should really be in libraries, they're related in a cheating kind of way. Anyway, examples include game-oriented BASIC dialects old and new (Dark BASIC, IIRC STOS on the Atari ST) and I think even the original Dartmouth BASIC (for matrix operations). Of course two or more keywords making a command name is trivial provided the parser recognizes the commands.
Jul
30
revised Why the scorn for COBOL?
Got the older standard year wrong twice (1973 instead of 1974) - fixed
Jul
30
revised Why the scorn for COBOL?
Confessions now that I can check facts - bought a copy of the book I originally learned from
Jul
17
comment Are there any scientifically rigorous studies of coding style principles?
Personally, I particularly like exceptions for success in the found case for a recursive depth-first search - they hand the responsibility for unwinding all the recursive calls to the compiler so there's no need for don't-keep-searching-if-I-already-found-something handling after every recursive call, keeping those details from complicating the search code.
Jul
17
comment Are there any scientifically rigorous studies of coding style principles?
Anyway, I think a lot of people think of exceptions as kind of alternative alternative exit points - because they're meant for error cases (sort of) they don't really count. I understand that's a bit language-culture sensitive, though. In some languages "exception" is more than the name - an exceptional success case is valid (and IIRC Stroustrup said something like that about C++, raising a philosophical point about whether an error is an error if it's handled). Some even say exceptions are just another control flow to use whenever it gives the control flow you need.
Jul
17
comment Are there any scientifically rigorous studies of coding style principles?
I saw your point about the 1995 paper only after that last comment, and decided to upvote - interesting point. I think your downvote may be more because your post is long, and starts out with a subjective point, so probably the downvoter didn't read the whole thing (the same as me, at first). Basically, it's a good idea to introduce your real point early.
Jul
17
comment Are there any scientifically rigorous studies of coding style principles?
I didn't downvote this, but on your "But in doing so you may have to introduce additional variables and/or code duplication both of which typically make the program harder to understand." point, that's a subjective claim. I agree that adding a variable or code duplication makes it hard to understand, but arguably adding a goto makes it hard to understand too, plus arguably the damage done by duplication can be mitigated by factoring the duplicated code out into a function (though IMO moving complexity into the call graph doesn't automatically eliminate it).
Jul
2
awarded  Curious
Jun
15
comment Why are most functional programming languages also interpreted languages?
Then again, Haskell is statically typed (and definitely compiled) yet has a similar tiny-but-there run-time cost for calling typeclass members - yet another form of late binding, really - and although I don't know much about ML, it probably has some equivalent too. In my mind, late binding is one of those things that shows that interpreting vs. compiling is blurry - though thinking of particular kinds of run-time work as left-over interpreting is probably a bit odd when the whole point of a program is to do work at run-time.