2 ms·
> Which, of course, you can accomplish in C by wrapping your UART buffer handling code in functions that do bounds checking. Of course, and you pay other hefty
by weland 13y ago
> Which, of course, you can accomplish in C by wrapping your UART buffer handling code in functions that do bounds checking.
Of course, and you pay other hefty prices in Pascal or Basic for getting this sort of stuff "out of the box". Pascal isn't my favourite systems programming language, either :-).
- pjmlp 13y agoWhat hefty price? There are zero features in C that Pascal and Basic dialects for system programming don't support. The only difference is that you need to turn safety off explicitly. I was doing low level coding in Turbo Pascal before I even cared about C.
- weland 13y agoIn terms of performance? None, assuming a well-written compiler. Depending on dialect you run into other issues though, such as the array size being part of the type signature, which is definitely not nice. The lack of adequate tooling and portability is another issue. Not strictly a problem of the language itself, but a problem you end up facing if you write low-level code in Pascal. Don't get me wrong, I wrote low-level code in Pascal, too. It's nice and I probably wouldn't grumble too much if I had to do it again, but there's a bunch of stuff that comes in the same package with using something other than a language widely considered adequate for systems programming.
- pjmlp 13y agoFaire enough. I do conceed that even though bashing C is a pasttime of mine, I would use it if it is the best option for a given project, depending on the set of factors to be considered for the said project. In real life projects, there should be no place for tooling religion anyway,