hellomike wrote: ↑Mon 16 Oct 2023, 09:35
However with code like the following
...
one has to know a lot already about the perks/syntax of the C programming language.
You are choosing as your example a piece of code which was not translated from assembly language, so I don't think it's a fair illustration. It's not even part of the BBC BASIC interpreter, indeed it's not code which is in the Windows edition of
BBC BASIC for SDL 2.0 at all (it's Linux code)!
Regardless if it is written from scratch or semi-automated translated. No person in the world only having a minimal understanding can do this.
So how do you think I managed to produce that code? Although I can't actually remember now, it's highly likely that I Googled for something like 'how to allocate memory in Linux' which took me to one of the sites (e.g. StackOverflow) where you can find huge quantities of code examples to do almost anything.
That's the 'usual' way I write C code which needs to be written afresh rather than translated from the BB4W equivalent (obviously there's nothing Linux-related in BB4W).
If you disagree then we simply have a completely different view of what is considered minimal understanding in regards to a programming language.
I
do disagree. With the resources available on the internet, allowing you to find C code to do pretty much anything you can imagine, the level of understanding required to build a working app by combining those building blocks into a self-contained program
is minimal, especially if you already know another programming language like BASIC.
You can of course choose to believe that I am lying, but the facts of the matter are that I have never actively learned to program in C nor have I ever written a C program from scratch. The degree of knowledge of that language I have acquired has been purely by exposure to code examples at MSDN or elsewhere and by searching the internet.
Where I
may have an advantage over some other people is that I don't automatically assume that I won't be able to do something, which I'm afraid is a common failing of BBC BASIC programmers. The number of times I have seen, here or at other BBC BASIC forums, somebody say "I wouldn't know where to start" or "it's gobbledegook to me" or "there's no point me even trying because I won't understand it" is depressing.
Knowing BBC BASIC gives you more than enough understanding of how computer programs are structured to be able to make sense of code written in any other traditional language. Once you move into, say, the Object Oriented Programming paradigm then I can understand how there can be roadblocks, but C is so similar to BASIC in its fundamentals the problem is only a psychological one.