Am I wrong?
-
jschell wrote:
And are you are expert in every possible technological API that you might reasonable encounter in the modern world?
I never claimed to be an expert or even intermediate. Besides, that was not a problem regarding the API, the problem here is that beginners who learn a very high-level language first do not know what data really is. (It wasn't even explained in various C/C++ books) In fact everything in memory is made of the same binary code and you can not tell what it is. It could be a picture, a string, a number or even executable code. The typechecking is only a way to help us remember what we want to do with this piece of memory. For an experienced coder like you that might be obvious, but for the beginner it's not. IMHO knowing that is very important no matter what language you choose (not HTML though xD) because it allows you to bypass typechecking if you need to. In my example you could use this knowledge to split the pixel-array into pieces and cast them to a pascal string so you can send them with WinSock and after receiving rejoin them together. Ofcourse you would also need to know that the first byte in a pascal-string determines it's length and that it wouldn't work with null-terminated strings. (which is kinda important too because many WinAPI functions use null terminated wchar strings). A basic knowledge about stack, heap, stackframes, pointers and things like that might be very useful as well (for example when recursive functions cause a SO or unsafe functions like gets() cause unexplainable behaviour). It also explains why you shouldn't put very big data on the stack and why you should call by reference when using functions which need that data.
Cody227 wrote:
I never claimed to be an expert or even intermediate.
However the point is that your example is one single API. And there are a vast number of them. Even as a general concept it will still fail to help in a vast number of APIs/technologies.
Cody227 wrote:
In fact everything in memory is made of the same binary code and you can not tell what it is. It could be a picture, a string, a number or even executable code....
"In fact" ...I have been coding for 40 years and started before Java/C# were even ideas and first encountered C++ before there was even the idea of a standard for it. And I have written assembly, created some drivers and written code that wrote/read directly to memory, disk drives and other hardware. I only work on server side applications and even now a great deal of my time is spent interacting with externals systems which have a very wide array APIs. So I don't need a tutorial on what the problem is that you are discussing. But perhaps because of the breadth of of my experience I understand how impossible it is to grasp every possible API variation. The vagaries of different types seldom matters. And keep in mind that my focus/expertise tends to require that I must use far more of these than the average developer. To be fair what matters far more is that it is very likely that a single API/technology is very likely to be inadequately documented. And thus even if one has an idea of how a specific method of an API should be used doesn't guarantee success. Matter of fact is it possible that two methods within one API might differ internally on something that should be the same.
-
Am I wrong thinking that C is a better language for one to learn as Java or Delphi? I have a friend who always says C and C++ are hard to learn, outdated and impractical. I can understand that he thinks Java is better as it was his first language, but I seriously can not understand why he thinks Delphi is better than C. After Basic it's one of the worst languages that I've seen so far. I was alyways convinced that you need to know how a computer works at low-level to be able to write decent code... Altough I've never never written a single program in ASM I feel like I would've never understood coding without it and seeing what my friend texts me sometimes I might be right. Only a few days ago he stated that he wouldn't need to learn pointers because Java "doesn't use them" and "var parameters in Delphi aren't pointers". And at the same time he asked how to send an array of pixels with WinSock because the appropriate delphi-function only accepts strings. But then there are things that really annoy me about C like null-terminated strings. They are so damn slow!
BASIC and assembly were the first languages I used to program, and I thoroughly enjoyed both (though they could be frustrating at times). I reminded myself recently about assembly and binary arithmetic and related topics, simply because I find them enjoyable. I then went on to use C++, then C# (non-Web based), then Java, PHP and JavaScript et al. I enjoyed C++, and still use it on occasion, and got annoyed when I was 'coerced' to switch to C#, but after a while I preferred C#, though I never ever really got into ASP.NET, I just don't like it. Then I preferred Java, as I could think more about the purpose of the code I was writing and less about syntax or what pointers were doing. Then I went back to playing with assembly, because I enjoy it. However, having done all that I still feel like a Noob, because I have very little commercial experience (not my aim to get much either). So my point is - knowing about binary arithmetic and registers etc. is fun, but it isn't that much use today, except perhaps for the odd creative use of binary operators. That said, a keen programmer will surely learn about these things eventually, just out of curiosity - surely?