News for hackers. Stuff that matters.
Re:Again on 0-based vs. 1-based indexing by bachmeier on Wednesday January 20, 2021 @06:11AM (#25845007)
You're supposed to start out by teaching them pointers. Once they fully understand how pointers work, you move them on to Hello World so they can write their first program. Then it will be intuitive when they see 0-based indexing. I think that's the HN consensus on teaching kids how to program.
Re:Again on 0-based vs. 1-based indexing by me_me_me on Wednesday January 20, 2021 @06:49AM (#25845290)
That's an excellent idea! We should also teach them quantum physics so instead of questioning programing language flaws they would question reality. Another problem solved.

I think we are on the track to create a perfect programmers factory.

Re:Again on 0-based vs. 1-based indexing by taneq on Wednesday January 20, 2021 @08:51AM (#25846401)
Honestly a lot of the confusion that I've seen in novice programmers over the years comes from the fact that nobody explained to them (1) that a program is a set of instructions that are executed one after the other by the computer, and/or (2) that memory is like a long line of boxes, each of which can hold a byte.

Once someone understands (2), pointers are incredibly simple and obvious.

Re:Again on 0-based vs. 1-based indexing by scythe on Wednesday January 20, 2021 @10:06AM (#25847225)
I have been surprised several times, when helping people to write "their first program" (which, in science, isn't that rare), that it can take days to internalize the relevance of ordering statements in a program. It's deep in every coder's subconscious that the bottom line depends on the top one and not the other way around, and I have had to consciously restrain myself from saying "whaaaaat?!" when I saw how my colleague tried to do something.
Re:Again on 0-based vs. 1-based indexing by Jtsummers on Wednesday January 20, 2021 @10:47AM (#25847776)
I'm glad you've learned to restrain yourself because that mistake makes sense if you're not used to imperative thinking. It doesn't benefit students to have instructors who are shocked by common/natural errors.

Math, as commonly encountered, is a collection of facts and relations. Their notion of variable is very different than in CS and programming.

To a mather (one who uses/does math), this makes sense:

  x = 7 * y
  y = 6
  therefore x = 42
To a coder (of most conventional programming languages) that's an error, y is undefined when x is assigned a value. And even if it did have a value, changing it later wouldn't change x so who knows what x could be.

It makes sense to the mather because each statement exists at the same time. To the coder, each statement is realized over a period of time. To the coder "y = 6" hasn't happened yet when "x = 7 * y". This is the part that has to be communicated to the novice with a mathematical background.

Re:Again on 0-based vs. 1-based indexing by anaerobicover on Wednesday January 20, 2021 @12:12PM (#25848943)
There are non-imperative logic programming languages (Prolog) where something like that would work. And those of us who started with imperative coding are probably just as confused by them in the other direction.
Re:Again on 0-based vs. 1-based indexing by Jtsummers on Wednesday January 20, 2021 @12:22PM (#25849069)
That's why I qualified the statement with "conventional". Prolog is not a conventional language, in the sense that most programmers don't know it (and I'd wager close to half of programmers have never even heard of it, if not more). C, C++, Java, JavaScript, PHP, Python, Perl, Ruby, even Rust are all imperative languages at their core and represent the dominant group of languages in conventional use.

If the OP was teaching people a language like Prolog then there wouldn't have been the same confusion.

Re:Again on 0-based vs. 1-based indexing by jdsully on Wednesday January 20, 2021 @05:45PM (#25852968)
Verilog and other HDL languages work this way, its not an accident humans would start this way as well as the natural world works in parallel.
Re:Again on 0-based vs. 1-based indexing by Jtsummers on Wednesday January 20, 2021 @06:00PM (#25853079)
I actually started writing a comment about that. Teaching VHDL (my experience) to most programmers is an entertaining experience because they expect effects to be immediate, not executed collectively and simultaneously but mediated by a clock or other mechanism. So in an HDL:

  x <= y;
  y <= y * 20;
These two effects actually occur simultaneously, which is different again from what mathematically inclined learners might expect since there is still mutation. It is more akin to the common notation:

  x' = y
  y' = y * 20
Where the ' indicates the next value of x or y (as opposed to the derivative). Or perhaps:

  x_n = y_{n-1}
  y_n = y_{n-1} * 20
And many programming languages don't even have a good notion for similar parallel evaluation and assignment. Python does, with:

  x, y = y, y * 20
Common Lisp has psetf which permits this:

  (psetf x y
         y (* y 20))
Languages with pattern matching/destructuring bind are your best bet for writing this directly without needing temporary variables.
Re:Again on 0-based vs. 1-based indexing by TuringTest on Wednesday January 20, 2021 @10:56AM (#25847909)
What the typical programmer doesn't even realize is that this is an artifact of Von-Neumann architectures (and their assembler language) and optimization of early compilers, not a essential property of computation.

Spreadsheets, expression-rewriting languages or any other functional programming language don't necessarily have this limitation, and declarations can be made in any order if the compiler supports it.

Re:Again on 0-based vs. 1-based indexing by robto on Wednesday January 20, 2021 @11:18AM (#25848214)
I've noticed this as well, and I've concluded that the actual surprising part for new coders is mutability. In basically every domain where non-developers invent algorithms, everything is immutable - spreadsheets, math!. Heck, even reading an article - the words you've already read don't change their meaning just because you've kept reading.

Mutability is really a result of the fact that computers are physical machines. So I think if you're going to teach software development, you should really start at the machine architecture and build up (ala NAND to Tetris) or start with an immutable-by-default language and only dip into mutation as an "advanced" concept, only to be used by experts and definitely not by beginners.

I endorse the second way, as I've seen it work very well, whereas I've seen more than one ship crash on the shore of understanding pointers...

Of course, my N is small.

Re:Again on 0-based vs. 1-based indexing by dodobirdlord on Wednesday January 20, 2021 @11:41AM (#25848518)
I once had the surprising experience of having to help a postdoc with a PhD in mechanical engineering wrap his head around a block of Python code he was reading that looked like:

    x = f0()
    x = f1(x)
He was just mentally blocked on how all of these things could be true at the same time, and/or on how a variable could be used in setting its own value, since assigning a new value to x would change the value that had been passed to f1! His intuition was that this meant some kind of recursion-to-stability was at play.

All he needed was to be informed that this could be equivalently represented as

    x = f0()
    y = f1(x)
or

    x = f1(f0())
Re:Again on 0-based vs. 1-based indexing by sergeykish on Wednesday January 20, 2021 @12:31PM (#25849191)
It is like recipe. And in general it is the way we read books.
Re:Again on 0-based vs. 1-based indexing by smitty1e on Wednesday January 20, 2021 @08:13AM (#25845993)
I was going to go with "bi-stable circuits, building up to half-adders", but you leapfrogged me there adroitly.
Re:Again on 0-based vs. 1-based indexing by TuringTest on Wednesday January 20, 2021 @10:51AM (#25847847)
It's plank-sized topological-connected vibrating goo all the way down.
Re:Again on 0-based vs. 1-based indexing by jcelerier on Wednesday January 20, 2021 @07:15AM (#25845514)
> You're supposed to start out by teaching them pointers

you can just show them a ruler and ask them where does the first centimeter starts

Re:Again on 0-based vs. 1-based indexing by doodpants on Wednesday January 20, 2021 @09:19AM (#25846696)
To which they should cleverly reply, "Aha! You said 'first' centimeter, not 'zeroth' centimeter, thus defeating your own argument."
Re:Again on 0-based vs. 1-based indexing by gjm11 on Wednesday January 20, 2021 @10:43AM (#25847719)
Someone I knew at university, who prefers starting at 0 (for mathematical, rather than computational, reasons) made the following argument/proposal.

"First" is an abbreviated form of "foremost". So if you start counting at 0, "first" corresponds to index 0. There's no real clash here yet; "first" and "one" are entirely separate terms.

"Second" is from Latin "secundus" meaning "following"; the second thing follows the first. So "second" corresponds to index 1. Again, no clash yet; "second" and "two" are basically unrelated.

"Third", though, actually derives from "three". So "third" has to correspond to index 3.

This leaves a gap, which might perhaps be filled by a new word "twifth", corresponding to index 2.

So now we have the cardinal numbers: zero, one, two, three. And the corresponding ordinals: first, second, twifth, third.

Re:Again on 0-based vs. 1-based indexing by mjevans on Wednesday January 20, 2021 @11:02AM (#25847993)
The hypothetical student's sarcastic answer isn't technically correct.

> you can just show them a ruler and > ask them where does the first centimeter start(s)

The question involves a nuance of the english language, the distinction between a measure of wholeness and the contents of that unit.

Length is a count of the completeness of a measure. The length of an interval must inherently include 0 as a unit to describe taking no units.

A 0 starting index is likewise also required to indicate skipping no storage cells.

Therefore an absolute index start must be zero based, and the Addition of duration must also include the option of zero as a means of describing a point at which to begin, but having not yet used any length.

The subtle trick is that is a point, an array of zero size; this is why the length, or alternately absolute stop point, for an array storing anything is one higher. It isn't actually zero indexed, it's a different property of measure (the size or stopping address).

A centimeter is also a wonderful example since it should graphically contain eight additional ticks for millimeter marks, and naught else, among it's inner span. This aligns wonderfully with explaining that there are targets spots for 8 bits of an octet within that single byte of indexed storage.

Re:Again on 0-based vs. 1-based indexing by ycombobreaker on Wednesday January 20, 2021 @09:27AM (#25846788)
Doesn't that just demonstrate your (edit: the teacher's) point exactly?

The first centimeter starts at 0.

The first array element starts at 0.

Re:Again on 0-based vs. 1-based indexing by TuringTest on Wednesday January 20, 2021 @10:57AM (#25847931)
No, that's the lower bound of the first array element.
Re:Again on 0-based vs. 1-based indexing by nybble41 on Wednesday January 20, 2021 @02:15PM (#25850619)
It's the offset of the first array element from the start of the array. The first element is at the start of the array, so the offset is naturally zero—there are zero elements prior to the first element. Like the markings on a ruler, array indices are cardinal numerals (0, 1, 2, …) counting the distance from a reference point, not ordinal numerals (1st, 2nd, 3rd, …) representing rank in a sequential order.
Re:Again on 0-based vs. 1-based indexing by TuringTest on Wednesday January 20, 2021 @05:31PM (#25852847)
If you're comparing arrays to centimeters on a ruler, the first element is at the center of the first cell; at zero, there's the left border of the first cell.

(Also please note that both this and my previous reply are tongue-in-cheek).

Re:Again on 0-based vs. 1-based indexing by gerdesj on Wednesday January 20, 2021 @08:25AM (#25846118)
There's a difference between a cm being the thing that exists between the lines with 0 and 1 against them and the distance that is 1cm. Indexing is within the scope of the first definition. You might as well ask where the 0 or 1th element in an array starts and finishes.
Re:Again on 0-based vs. 1-based indexing by eutectic on Wednesday January 20, 2021 @08:21AM (#25846076)
Or give the example of birthdays; in your first (initial) year of life you are 0 years old.
Re:Again on 0-based vs. 1-based indexing by coldtea on Wednesday January 20, 2021 @08:25AM (#25846125)
And they'll see that rulers are broken too, they should start with 1 instead!
Re:Again on 0-based vs. 1-based indexing by k9000 on Wednesday January 20, 2021 @10:48AM (#25847785)
To which some of us older Americans would say, "Which one is the centimeter?" It's so hard for me to think in metric.
Re:Again on 0-based vs. 1-based indexing by xxs on Wednesday January 20, 2021 @02:26PM (#25850766)
so the question is: what's worse - imperial or 1-based index?
Re:Again on 0-based vs. 1-based indexing by carlhjerpe on Wednesday January 20, 2021 @06:46PM (#25853432)
Imperial, because of it's vagueness people use other measurements as well. Something is x stories high. Something is a "stones throw away".

Though i do appreciate Fahrenheit for how it scales with humans. 0 is really damn cold, 100 is really damn hot, while in Celcius 0 is kinda chilly and 100 is instant death.

Re:Again on 0-based vs. 1-based indexing by xxs on Wednesday January 20, 2021 @07:40PM (#25853862)
>100 is really damn hot,

It's actually supposed to be the body temperature. Due to imprecise measurements, it's actually having a light fever. Flip note: C scales the same - 0 is the water freezing point, and then you have the same scaling as F but in 5s instead of 10s. [and you gotta remember: (f-2pow5)*5/9].

That's an old debate, yet if you are born/used to C, F is pretty horrific.

Re:Again on 0-based vs. 1-based indexing by carlhjerpe on Thursday January 21, 2021 @02:15AM (#25856368)
I forgot to mention that I'm Swedish and use C daily, I just think the F scale makes more sense for humans
Re:Again on 0-based vs. 1-based indexing by fomine3 on Wednesday January 20, 2021 @09:50PM (#25854734)
100C isn't instant death, see sauna. Maybe you compare 0C air and 100C water so to be fair, 0C water is maybe death within dozen of minutes
Re:Again on 0-based vs. 1-based indexing by HPsquared on Wednesday January 20, 2021 @07:33AM (#25845674)
Very nice, I'll steal that.
Re:Again on 0-based vs. 1-based indexing by stabbles on Wednesday January 20, 2021 @06:37AM (#25845189)
That's great advice for a kid learning python. "Kid, let me tell you about pointers in C, then you'll understand we you have to write range(1, 13)"
Re:Again on 0-based vs. 1-based indexing by coldtea on Wednesday January 20, 2021 @08:24AM (#25846108)
Monads should make the list too...

Also trampolines. Kids love trampolines. From there it's a simple jump (pun intended) to something like the Y-combinator!

Re:Again on 0-based vs. 1-based indexing by globular-toast on Wednesday January 20, 2021 @08:05AM (#25845926)
I agree, but Python doesn't have pointers. So I agree with your parent that Python isn't a good language for teaching.

Unfortunately teaching languages that are good for learning, like Scheme or Pascal, went out of fashion a long time ago. For years now universities have been teaching marketable languages. Ten years ago that was Java. Now it's Python.

Re:Again on 0-based vs. 1-based indexing by erostrate on Wednesday January 20, 2021 @07:15AM (#25845520)
I can't tell if this is a joke or not.
Re:Again on 0-based vs. 1-based indexing by laichzeit0 on Wednesday January 20, 2021 @08:06AM (#25845936)
It's hilarious that people are taking this comment literally. HN comedy gold. Reminds me of when I was working with a German work college and he just could not pick up on English sarcasm.
Re:Again on 0-based vs. 1-based indexing by valvar on Wednesday January 20, 2021 @08:37AM (#25846245)
I thought it was a pretty obvious joke, but then I saw lots of people seemingly seriously agreeing, so now I'm not so sure.
Re:Again on 0-based vs. 1-based indexing by userbinator on Wednesday January 20, 2021 @09:27AM (#25846775)
There's two groups of programmers, those who started learning with low-level, and those who started with high-level languages. I'm personally in the former group, and think there are definite advantages to doing it that way. You are probably in the latter.
Re:Again on 0-based vs. 1-based indexing by valvar on Wednesday January 20, 2021 @10:38AM (#25847657)
Sure, for adults, that's fine (but I still disagree with the approach, as pointers are a notably tricky concept that really isn't necessary in the beginning). But it's like saying that before teaching a kid addition and multiplication they should understand the Dedekind–Peano axioms -- it's simply overkill and more likely to discourage them than anything else. (But it depends on age and aptitude, of course, so obviously YMMV).

FWIW I started with K&R, but times have changed and I definitely don't think it's a pedagogically sound way of teaching programming.

Re:Again on 0-based vs. 1-based indexing by gjm11 on Wednesday January 20, 2021 @10:49AM (#25847808)
Back in the mid-to-late 20th century, there was a movement to teach mathematics rather that way, though I don't think it ever got as far as teaching small children the Peano axioms. The "New Mathematics", they called it. I remember encountering talk of sets and functions in UK primary school circa 1975.

It never worked very well in practice. I expect that when you're fortunate enough to have unusually able teachers teaching unusually able pupils it might do OK -- but then, in that situation, anything will do OK.

(Tom Lehrer fans will know about this from his song "New Math", with "It's so simple, so very simple, that only a child can do it" in the refrain.)

Re:Again on 0-based vs. 1-based indexing by cpcallen on Wednesday January 20, 2021 @05:34PM (#25852867)
For the record: Lehrer-style "new math" was what I was taught at elementary school in Ontario in the 1980s. I know it was not what my parents had been taught, because they couldn't understand how we did subtraction. We did do some other bases (mainly binary, as I recall) as well as modulus.

I certainly had unusually able teachers.

Re:Again on 0-based vs. 1-based indexing by userbinator on Wednesday January 20, 2021 @03:44PM (#25851739)
I don't think it's comparable to teaching arithmetic from a highly theoretical basis, since the type of low-level beginnings I'm advocating for are starting from a concrete foundation --- logic gates from relays and such, not unlike the approach used by Petzold's book Code.

Incidentally, that book has been praised for making computation easy to understand for non-programmers, which I would consider to be evidence for starting out low-level.

but times have changed

Not for the better, if you look at the average state of software today --- and I think a lot of it can be explained by the general lack of low-level knowledge.

Re:Again on 0-based vs. 1-based indexing by auxym on Wednesday January 20, 2021 @07:31AM (#25845654)
It has to be. Right?
Re:Again on 0-based vs. 1-based indexing by teamonkey on Wednesday January 20, 2021 @08:21AM (#25846082)
Is this before or after teaching category theory?
Re:Again on 0-based vs. 1-based indexing by psychoslave on Wednesday January 20, 2021 @11:33AM (#25848410)
Just forbid them to read Principia Mathematica.

All of them.

Re:Again on 0-based vs. 1-based indexing by djxfade on Wednesday January 20, 2021 @06:17AM (#25845059)
I don't think a lot of beginner friendly languages exposes pointers to the developer
Re:Again on 0-based vs. 1-based indexing by randomdata on Wednesday January 20, 2021 @09:20AM (#25846700)
Unless they have arrays, which are conceptually not a whole lot different.
Re:Again on 0-based vs. 1-based indexing by mewpmewp2 on Wednesday January 20, 2021 @09:50AM (#25847052)
Most of the time you don't use them or think or need to think of them as pointers.
Re:Again on 0-based vs. 1-based indexing by randomdata on Wednesday January 20, 2021 @11:17AM (#25848196)
No, but pointers are thought of as array indices. If you understand arrays, you understand pointers.
Re:Again on 0-based vs. 1-based indexing by mewpmewp2 on Wednesday January 20, 2021 @12:50PM (#25849460)
What do you mean by understanding? E.g I have been using arrays productively in PHP and JavaScript, does it mean I understand them?
Re:Again on 0-based vs. 1-based indexing by randomdata on Wednesday January 20, 2021 @02:55PM (#25851138)
If, given a[n], you understand that n points to a position in array a then you understand pointers.
Re:Again on 0-based vs. 1-based indexing by wiz21c on Wednesday January 20, 2021 @06:22AM (#25845091)
pointer is an implementation detail. No one should have to learned that first.
Re:Again on 0-based vs. 1-based indexing by tpush on Wednesday January 20, 2021 @06:57AM (#25845346)
A pointer (or reference, or just 'address') is a general concept that by definition is part of any language featuring mutation.

Any language that makes use of mutation for primitive constructs (not saying that's the case here specifically) needs an understanding of "observing/causing change" pretty early on.

Re:Again on 0-based vs. 1-based indexing by improbable22 on Wednesday January 20, 2021 @07:14AM (#25845503)
> is a general concept that by definition is part of any language featuring mutation.

One counter-example is Mathematica. I can mutate any object any time I like, and doing so is extremely common. Yet under "pointer" its help tells me about some unicode symbols, and some GUI stuff about mouse pointers.

In reality, some of its lists are dense memory like C, some contain arbitrary objects (such as expressions, or high-precision numbers), but these implementation details aren't part of the language, and most users never know them.

Re:Again on 0-based vs. 1-based indexing by tremon on Wednesday January 20, 2021 @07:32AM (#25845664)
Mathematica is also not a low-level programming language. It's math-based, so it deals with abstract concepts, not concrete hardware implementations.

0-based arrays are based on hardware implementations; 1-based arrays are based on abstract collections; you could make the argument that 0-based arrays are a leaky abstraction, but the question then becomes: what abstraction? C explicitly tried not to abstract away the underlying hardware.

Re:Again on 0-based vs. 1-based indexing by improbable22 on Wednesday January 20, 2021 @08:25AM (#25846123)
If "any language" means "any language sufficiently low-level to have C-like pointers", then no contest!

Surely the point of any language at all is to abstract away some details of the underlying hardware. Both for portability and to make things easier for human brains. How much you should abstract away obviously varies, based on what you're trying to do, and on how varied the hardware is.

And it depends on how much computation & memory you can give your compiler. One reason new languages can have nicer abstractions is that they don't have to compile on 1970s hardware.

Re:Again on 0-based vs. 1-based indexing by pjmlp on Wednesday January 20, 2021 @08:59AM (#25846490)
Ada, Pascal, Modula-2,....
Re:Again on 0-based vs. 1-based indexing by wiz21c on Wednesday January 20, 2021 @09:29AM (#25846801)
lisp, smalltalk, scheme, R.
Re:Again on 0-based vs. 1-based indexing by zajio1am on Wednesday January 20, 2021 @12:27PM (#25849134)
0-based arrays/indexes are also based on abstract concepts. 1-based ordinal numbers (in both maths and language) are just tradition from time before 0 was generally accepted. Set theory (as a clean design of math foundations) also starts ordinals at 0.
Re:Again on 0-based vs. 1-based indexing by tpush on Wednesday January 20, 2021 @07:29AM (#25845636)
The specific word or implementation isn't important.

In Mathematica's case (and most other languages, sadly), presumably the concept of 'variable' is overloaded with the semantics of a pointer/reference. Meaning, you cause and observe changes to locations via a variable.

Re:Again on 0-based vs. 1-based indexing by tomp on Wednesday January 20, 2021 @07:31AM (#25845655)
Trying to program without understanding how data is stored in memory is like trying to cook without understanding how heat affects food.
Re:Again on 0-based vs. 1-based indexing by cmrdporcupine on Wednesday January 20, 2021 @08:28AM (#25846148)
At this point even assembly language is an abstraction of a simpler machine overtop of a much more complicated one, and few programmers really understand what's happening underneath. It's not like a chunk of 'memory' in your C program corresponds exactly to a physical location on a DRAM chip anymore. There's N layers in-between, not just in the OS's virtual memory model but also in the chip's caches, etc.

We're all dealing with abstractions over abstractions at this point, so it's really about finding what model of understanding works for the learner and then going from there.

Re:Again on 0-based vs. 1-based indexing by oliverx0 on Wednesday January 20, 2021 @07:57AM (#25845865)
Terrible analogy. The beauty about computer science lies in abstractions. You don’t have to understand the low level details to be productive at the higher levels, you just have to understand the interfaces. If we go down this rabbit hole, do you have to understand how the memory bus works, how the operating system is implemented, etc... before getting to hello world?
Re:Again on 0-based vs. 1-based indexing by turminal on Wednesday January 20, 2021 @08:29AM (#25846157)
There is a huge difference between explaining how indexes come from offsets and understanding operating systems. I think more emphasis should be put on the insane amounts abstractions underlying the high level language at hand when teaching programming. Explaining that 0-based indexing comes from offests seems like a good start in that direction for a kid learning python.

And when beginners won't be beginners anymore they'l have to learn how the underlying abstractions work anyway. A programmer that doesn't at least superficially understand how operating systems work is not going to be able to write performant or secure software, let alome combine those qualities.

Re:Again on 0-based vs. 1-based indexing by userbinator on Wednesday January 20, 2021 @09:33AM (#25846835)
Digital logic is a good start...

You don’t have to understand the low level details to be productive at the higher levels, you just have to understand the interfaces.

I've worked with programmers like that. They can glue a lot of things together, but when the slightest of problems appears, they are absolutely lost with how to debug. They usually resort to making pseudorandom changes until it "appears to work", and are also unable to appreciate just how fast computers are supposed to be.

Re:Again on 0-based vs. 1-based indexing by TuringTest on Wednesday January 20, 2021 @11:56AM (#25848738)
I learned physics and transistors at comp-sci. It didn't help with programming at all (though it made wonders for my understanding of the philosophy of computation).

The kind of understanding you're rooting for relies on formal logic, not electronics.

Re:Again on 0-based vs. 1-based indexing by AnIdiotOnTheNet on Wednesday January 20, 2021 @07:38AM (#25845705)
That depends entirely on the kind of programming you're trying to do. For beginners working in high level languages it is an implementation detail they need not be concerned about.

Growing up with BASIC, I didn't have any understanding of pointers or how memory worked. PEEK and POKE, which I only saw used in other people's programs and examples, were black magic as far as I could tell. It wasn't until I learned C that I actually understood them but I still managed to write a whole lot of programs without ever using them.

To be a professional programmer I'd agree though. If you don't understand how pointers work, regardless of the language you're using, you're probably not good at your job.

Re:Again on 0-based vs. 1-based indexing by RaptorJ on Wednesday January 20, 2021 @07:50AM (#25845798)
This is an unfortunate analogy given how complicated and poorly understood the heat-affects-food chemical reactions are. And yet food gets cooked.
Re:Again on 0-based vs. 1-based indexing by NateEag on Wednesday January 20, 2021 @08:00AM (#25845889)
I'd say that makes it an apt analogy.

It just makes a point opposite to the author's intent.

Re:Again on 0-based vs. 1-based indexing by Someone on Wednesday January 20, 2021 @09:38AM (#25846910)
Are you sure about the author’s intent? Unless you know the writer very, very well, I think it’s impossible to tell from written text.
Re:Again on 0-based vs. 1-based indexing by NateEag on Wednesday January 20, 2021 @11:21AM (#25848249)
You make an excellent point. I shouldn't have been sure about the author's intent.

Thank you for pointing out my error.

Re:Again on 0-based vs. 1-based indexing by mewpmewp2 on Wednesday January 20, 2021 @09:48AM (#25847031)
Exactly, you don't need to know how molecules act under the hood to be productive cooking.
Re:Again on 0-based vs. 1-based indexing by IncRnd on Wednesday January 20, 2021 @04:06PM (#25851996)
Until you need to substitute ingredients, you use a different type or rangetop, the pan metal or thickness is different, or something else changes. This was a perfect analogy. People can follow the recipe of assemling various frameworks and toolkits to create software, but they will eventually encounter difficulty.

You may not need to understand molecular differences, but knowing hows fats, proteins, and carbs work, along with how to substitute ingredients, and different theories of cooking all help to actually understand why you can cook until mysteriously things don't work the same as yesterday.

Re:Again on 0-based vs. 1-based indexing by vendiddy on Wednesday January 20, 2021 @08:15AM (#25846021)
I've been learning to cook recently and I haven't the slightest idea how heat affects food.
Re:Again on 0-based vs. 1-based indexing by IncRnd on Wednesday January 20, 2021 @04:11PM (#25852049)
It is said that each fold on a chef's hat represents a different way they know how to cook an egg. Thet need to understand when to apply low heat, high heat, add liquids, when proteins denature and when they coagulate.

Of course, following a recipe in specific ideal circumstances works, as long as nothing changes.

Re:Again on 0-based vs. 1-based indexing by stabbles on Wednesday January 20, 2021 @07:40AM (#25845718)
Lisp programmers don't care how heat affects food since the 1950s.
Re:Again on 0-based vs. 1-based indexing by gct on Wednesday January 20, 2021 @01:45PM (#25850232)
a pointer is an array index
Re:Again on 0-based vs. 1-based indexing by psychoslave on Wednesday January 20, 2021 @11:28AM (#25848334)
What? I thought first they should go through TAOCP in integral. They should be grateful if you allow them to use MMIX instead of MIX.
Re:Again on 0-based vs. 1-based indexing by Dirlewanger on Wednesday January 20, 2021 @08:04AM (#25845919)
That's how they used to do it in universities back in the 80s/90s. Start out with the hard stuff first in Intro to Computer Science. By the end of the course, you'd go from 400 people to about 50. Wish they'd still do that to keep numbers low.
Re:Again on 0-based vs. 1-based indexing by tzs on Wednesday January 20, 2021 @11:27AM (#25848317)
Although doing it "to keep numbers low" doesn't seem to me to be a good reason to do it, it is generally a good idea to have some hard stuff early in a field.

The idea is that if the hard stuff comes too late, people might not find out that they aren't really suited to that field as a career until it is too late to change majors without having to take an extra year or two of college.

The intro class is too early for that, though, because CS is useful enough for other fields that many people (perhaps even a majority of people) taking intro CS don't intended to actually go into CS. Better is to put it in the first class in a field that will mostly only be taken by people who are intending to go into that field.

Re:Again on 0-based vs. 1-based indexing by TT3351 on Wednesday January 20, 2021 @11:35AM (#25848435)
The best college courses I took were ones where the professor frontloaded all the hard assignments towards the first month of the semester. Every slacker dropped out, and for most of the semester we just had great discussions because everyone was doing the readings.

Just like DRM, make it a little harder to skate on by and you actually filter a lot of casual/non-serious people.

Re:Again on 0-based vs. 1-based indexing by dotancohen on Wednesday January 20, 2021 @10:56AM (#25847904)
You are going to get downvoted to hell for "gatekeeping" but you're right.

Instead of just graduating 50 people who "get the trade", we're now diluting them with another 350 that "made the grade". Then tech firms need wild, crazy interview processes to sort them back out. Everybody suffers, including the 350 who may have been productive and happy in another, more suitable profession.

Re:Again on 0-based vs. 1-based indexing by Dirlewanger on Wednesday January 20, 2021 @11:40AM (#25848501)
And it's weird that people see it as gatekeeping, since there's plenty of other professions out there that artificially restrict supply, and no one raises a sthink about them. People do about software because we work online and are constantly giving opinions no one asked for.

It's less about gatekeeping, and more about sustaining a healthy industry that is quickly headed for a disastrous race to the bottom. Google and friends are spending billions under the magnanimous "bringing coding to everyone" when they really just want to lower developer salaries. Not everyone needs to learn how to code, just like not everyone needs to be a doctor, or learn how to be a carpenter. I constantly wonder when will be the right time to "get out" before salaries start their inevitable side downwards. Could be a couple decades though.