Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

C is a big 0

Name: Anonymous 2017-08-04 4:47

https://softwareengineering.stackexchange.com/questions/110804/why-are-zero-based-arrays-the-norm

1-based counting was ``the norm'' for thousands of years. Years begin at 1. The Bible counts chapters and verses from 1. Programming languages before C started arrays from 1 or a user-defined index.

Only a few answers mention that some programming languages let you start from 1. This should be filled with answers saying ``1-based arrays used to be the norm and C hackers came along and forced everyone to use the C way because they get confused if you let them choose the index.'' Stupid questions do not bother me, but wrong answers do. Stack Overflow and Stack Exchange are spreading wrongness into the world. They are reducing the amount of truth on the Internet.

They all say that arrays count from 0 and nobody can change it because it would ``confuse'' people. This is the C mentality. They want to force their 0 on thousands of years of human history and on every non-C-based programming language. They want everyone else to cater to them because they are too dumb. Pascal programmers can learn and use C. They don't like it, but they can get used to it. C programmers don't want to use Pascal because it's not C.

Stop catering to the idiots. They are not good programmers if they get confused by simple concepts like array base. Kids using QBasic and Pascal can understand it, but these C ``expert hackers'' can't. We should stop dumbing down our languages and debasing important computer science concepts because some people are stupid.

Name: Anonymous 2017-08-05 4:36

>>10
C arrays are not ``hard to understand".
The C array is harder to understand than the Pascal or BASIC array even though it's less powerful. We have better ways to do arrays that used to be taught in computer science classes and used by ordinary programmers.

The C books teach something about pointers to the first byte of an element, which is an implementation detail of one possible implementation. They also ``flatten'' variable-length multidimensional arrays into one dimension and you have to use multiplication to get the address, another implementation detail. Arrays are a simple and beautiful computer science concept and all of these complicated implementation details are ugly and get in your way of understanding them. These CS classes are dumbing down programmers by using inferior definitions and teaching methods that make things harder to understand. C is dumbing down people and programming languages.

The pointer arithmetic makes arrays starting from a number besides 0 too hard to understand and C programmers want you to fake multi-dimensional arrays with multiplication, which makes multi-dimensional arrays too hard to understand and use, so these new language creators don't include them in their languages.

C for loops are ``hard to understand", making one of the most common array tasks (iterating over an array) confusing and leading to off-by-one errors and buffer overflows.
Yes they are and this is another problem. The C for loop is also full of implementation details, like whether you add 1 before or after you throw away the result. There are at least 4 different ways to add 1 to the index (i++, ++i, i += 1, i = i + 1). The array and loop together make C even worse.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List