GPIO Module and the old SWI's
Pages: 1 2
Steve Pampling (1551) 8170 posts |
Interrupted by cat needing to be fed and lost the thread in a set of edits: “trying to do far too much, or having a personal axe to grind.” Case in point: The difference is that with C it’s unavoidable.
Well, you can write a DTP app in say C and then update it quickly to match some quirk of a new platform or you can write it in assembler and utilise some really obscure feature of the current platform and have it break on future platforms. Note that I’m not anti-C, I just have difficulties finding the right mindset. |
Clive Semmens (2335) 3276 posts |
Absolutely. I’m not really doing DTP any longer; not since 1997 with Impression at Physiology, or since 2007 with FrameMaker at ARM. I couldn’t afford FrameMaker! I use LibreOffice for preparing books – fiction only – for print. I’m not anti-C; I think it’s a pretty crappy language, but it’s the best we’ve got, exactly because it’s portable & widely used. I’m not anti-C, but I find it horrible to work with and I don’t need to. The italicized bit being the real point. It’s not really a matter of finding the right mindset – I’m sure I could do that if I was sufficiently motivated, but I’m not, never have been, and am unlikely to be in the future. |
Rick Murray (539) 13840 posts |
Subtle. I like her. :-)
The difference is that C encourages code reuse. Put things in libraries rather than writing the same thing over again and writing the same thing over again and writing the same thing over again and writing the same thing over again and writing the same thing over again. C also encourages the use of constant definitions, a concept that does not exist in BASIC (the closest you can get is assgning values to variables – something that pollutes the variable list and requires a specific variable lookup for every use). I just had a look at the code to !Chars and there are fourteen integer variables defined at the beginning to act as constants. A little further down we see stuff like The thing is, all of this stuff needs to be defined somewhere.
As Steve (not that Steve, the other Steve! ;-) ) says, it is possible to write software in C without using any external references [I do not count stdio, stdlib, string, etc as external because they are a required part of every functional C compiler]
The other thing is that BASIC is an implicit part of the system. There’s not one Acorn machine since the Beeb (possibly the Atom) that doesn’t have BASIC onboard. So you know you can write something in BASIC and you know that as long as it’s the correct sort of machine (the 6502 range can’t do ENDWHILE, the Archimedes can’t do GCOL r,g,b) then it will run. No if/but/maybe. It’s there, it’ll work. The other other thing is that we aren’t exactly blessed with much in the way of languages that a RISC OS machine can run directly.
No. Just a humourous attempt to point out that before one maligns C, keep in mind that your current favourite programming language might actually be written in it. ;-)
Indeed. I can understand (and mostly tolerate) why C scatters its definitions all over the place in the name of modularity, even if it means grepping the filesystem to try to find where the hell something is actually defined. What I can’t abide is those who write BASIC and stuff it full of GOSUB and GOTO. I read, a while back while on break at work, the Osborne guide to creating adventure games. It talked about how they worked, and then gave the most awful code to implement it. It was awful out of necessity, as most (lesser) dialects of BASIC could only support GOSUB and GOTO. But the end result was like trying to find patterns in a bowl of linguine. Far far worse than any mess I’ve even encountered in C, and this was a book teaching kids how to program.
No, it would be crazy to use BASIC for a DTP app. Or anything else heavyweight like a web browser or professional grade image manipulation program… …oh, wait… [refer to Steve’s missing either/or comment about using BASIC for things it’s not really supposed to do but manages to do surprisingly well anyway]
You wouldn’t. But somebody did. That’s why they exist. ;-)
I probably am too, but the time when I would have been diagnosed, nobody wanted to be labelled autistic. These days, I consider myself to be somewhere on the spectrum (cerulean!!!) but I don’t need some tidy little tick box to fit into. If I am, if I’m not, the best I can manage is a nonchalant shrug. I don’t believe it helps to break things up into modules and patterns. That, to me, just seems like plain common sense. When you’re making a cake you add ingredients in a certain order and help the mixture “become”. You don’t just chuck everything into a bowl, whisk it to hell and back, and consider it fait accompli. That will produce a cake, it just won’t produce a particularly nice cake. And what’s the point of cake if it isn’t nice? Mmm… cake… doughnuts… tea. |
Clive Semmens (2335) 3276 posts |
Well yes, obviously! And I’m very grateful to them!
Indeed. Horrible. Did BBC BASIC have FN and PROC from the beginning? I don’t remember now. |
Steve Pampling (1551) 8170 posts |
I told people many years ago, “I am the Steve, all the others are just that – others” :)
On the Beeb, and still people used unwarranted GOTO.1 1 Use that and then go play with Bill Gates’ masterpiece2 (where’s a brick wall when you need it?) 2 GWBASIC he did, DOS he did not. |
Pages: 1 2