General statistics
List of Youtube channels
Youtube commenter search
Distinguished comments
About
Lepi Doptera
Low Level
comments
Comments by "Lepi Doptera" (@lepidoptera9337) on "Low Level" channel.
Previous
2
Next
...
All
If you think that a language can make you code better, then you are not ready to code in any language. :-)
1
You can learn as many languages as you like. Will that make you a better programmer? No. The actual success recipes for programming are language agnostic.
1
You can make the same argument for -17 based indexing. ;-)
1
Rust is not a panacea. The other day I had a problem on a microcontroller that would have occurred with Rust as well. The data cache was overriding the DMA from a peripheral. Instead of getting fresh data after a DMA interrupt I was getting the same data over and over, again, from the data cache. That's just how the hardware implementation of that particular controller works. Is it a bug? Is it a feature? Who knows. The only way to override it is by either not using DMA (there goes your performance for that particular function), by disabling the data cache (there goes your performance for the entire code) or by manually programming the MMU to remove the DMA buffer from the data cache (there goes your convenience). The only other reason why that particular code ever crashed was a single division by zero error, which would not even have caused a user problem, even if it hadn't been caught.
1
Why would the WH care how slow your program is? ;-)
1
Use auto if you don't mind it generating the wrong result. ;-)
1
@ I can tell you that the problem exists with all "auto" features. In Excel, for instance, the program formats cells depending on whether they look like a string or a number. Tons of spreadsheets are failing because somebody types a string that looks like a number or the other way round. It's even worse with dates. There are features and then there are stupid features. This one is the latter.
1
@ It's not a matter of coercion. It's a matter of producing errors that are not easily visible in the code. If you want a dynamic language like Python, then use a dynamic language, but don't pretend that going there halfway will save you from the severe problems that dynamic languages have. At least pointers are absolutely necessary, but this isn't. I rather have a programmer spell out all types explicitly than have a language/compiler that can generate a type system with exponential complexity automatically. The latter is not safe design. It's also not clear to me that it would be useful. Everything that can be done with types at compile time can be done much better with data at runtime.
1
@ OK, I play. What does it do in your opinion that you can't live without and that you can't do much better and safer without it? I wasn't just talking about "auto" here, of course. I was talking about the entire failed design philosophy of C++.
1
@ignacionr I understand the design of C++ just fine. Stroustrup explains in his book that he wanted to move as much from runtime to compile time as possible. auto and templates are basically the compile time equivalent of dynamic types. And that is the problem. Dynamic types are a bad idea. It doesn't get any better just because you unroll all possible types during compile time (at most it makes it worse in some sense). Here is the Python example of what auto does: a = [] # a one dimensional array a= [a,a] # a two dimensional array print(a) the program results in [[],[]] I can put the above even in a loop: a = [] for i in range[20]: a = [a,a] and now I am getting a one million dimensional array! If I make a tree, I can construct all possible array dimensions from one to a million... in no time. I can make more complicated structures like that, like arrays of dictionaries containing dictionaries of arrays etc.. See the problem? Exponential type multiplication. No programmer can possibly keep up with the consequences of that. auto and templates do the same thing, except that you are limited to a fixed number of type generations that are being unrolled by the compiler, but you can still proliferate types exponentially. Bad, bad idea.
1
That depends on your language. I am sure there are languages that are stupid enough to let you put 28GByte size arrays on the stack so that a function can modify a single byte... but why in the world would you want to do it that way? ;-)
1
Why would you ever use the built in PRNG algorithm???? Ouch.
1
I will publish my next failed language design three weeks from now. :-)
1
A garbage collector is not a panacea. It simply allows you to make different mistakes than a language without that facility.
1
How safe Javascript is has nothing to do with Javascript. It depends entirely on your browser. Unless you wrote your own there is NOTHING you can do about that.
1
Yeah, that works great... except that it won't work at all because you haven't saved your registers and there is no mechanism for passing arguments here. It's also not re-entrant safe. Welcome to interrupt hell. ;-)
1
Previous
2
Next
...
All