Treating strings as arrays is bad, but Codecademy teaches beginners to do it?

Okay so I was looking at string methods on W3schools to see what other ways of searching for a word there are, 'cause for example, I would like to have the whole word found, not each letter as a separate entry. And in there, I found out that “Accessing a String as an Array is Unsafe”, with the example showing that this is exactly what we’re doing in this exercise!
If this is bad practice, why is a course for beginners who don’t know any better teaching to do it as if it were a normal thing to do, without at least pointing out “hey, normally you shouldn’t do it, but just in this exercise we’re going to anyway”? This makes me have doubts about all other exercises and courses, like what else am I learning that I’ll end up having to unlearn (assuming I will actually find out that it’s something I shouldn’t do)?

I don’t think it was considered when writing the course, but such a browser would be over 5 years behind the language specification and should probably be replaced anyway.

I would suggest putting any doubt away and focus on learning the concepts, syntax and logic. The lesson is riddled with concepts and if the instructions are followed without questioning them, the outcome is relatively simple to arrive at.

By today’s standards, there is no reason why we cannot access a string by index, so long as we are not trying to change the character at that index. It is, after all an iterable, and iterables have indices.

The article mentions a few times that changing a string means replacing it with a new one. All we are doing in this exercise is reading the characters and matching them to the first letter of our name. No mutations are attempted. The course author was likely trying to keep the number of new concepts to a minimum.

Following instructions without any amount of questioning them is probably rarely a good idea, and anyway, if I just follow the instructions without thinking about it, I don’t think I’ll learn a lot (or I’ll forget it very quickly). So I’m guessing either the course on Codecademy or the W3schools guide, or both of them, are a bit obsolete?

1 Like

Who says we don’t think about it when following instructions? That’s where the questions come from. The more we challenge ourselves to source out docs and examples to help us solve our problem, the more likely we get past the stage where asking in forums is the go-to. Searching the forums will suffice.

That’s the idea. Questions are reserved for study period.

I don’t know who you mean by “we” i “we don’t think”, but your first reply sounded like advice to just follow instructions without questioning them. That’s what I was referring to, maybe it wasn’t exactly what you meant.[quote=“mtf, post:5, topic:60879”]
Questions are reserved for study period.
What? I don’t understand what you’re saying at all, especially as a reply to the part of my post you quoted. Unless you mean literal asking questions, and not questioning things in general? Because we should question everything, always.

Again, at this stage that is overkill. Questions that have to do with the lesson, directly, are the ones best suited for the Q&A forum setup. Those concerned with the instructions or lesson text, or interface need to be directed to Platform Problems, or raised as discussions in the Corner Bar, which is where this topic is going.

Well, I mean, question everything in general.
Thanks for moving the topic, I don’t really understand how the Codecademy forum works as it looks very different than most, and this section is where I got after clicking the Q&A Forum button on the course site.

1 Like

@6lancmange, I believe the best takeaway form this is some advice I gave to a user, and will be consistent in giving out. Codecademy is primarily an exercise platform, allowing you to move through simple courses/tracks/plans and follow along with instructions to write the code yourself. It fails very hard in supplying substantial & foundational understanding of the language, deeper complex concepts, etc. Just remember, think codecademy & exercise.

So when @mtf suggest that the understanding of concepts be reserved for study time, you should be taking your practice here and applying it in your own time. If you spend some time seeing the help questions, most are very basic, and primarily around syntax issues, or just not understanding concepts from the exercises.

Users here really should not be using this platform as their primary source of learning & practice. I began here in 2015, but I came here after starting on teamtreehouse, and I’ve also uitlized several other instructional services as well as much practice & studying on my own.

There shouldn’t be too much concern that codecademy is misleading anyone, all users should be supplementing elsewhere, and those who are serious will regardless.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.