- 1

c style arrays taught in c++ course

Please replace these with std::vector or at least std::array, they're outdated.

12th Nov 2017, 1:43 PM
Timon Paßlick
21 Answers
+ 18
We can have a lesson on std::vector and std::array, but C-style arrays are no where near being outdated, less elegant, or less important. In terms of learning, you will want to start from the latter before you proceed to the former two.
12th Nov 2017, 4:24 PM
Hatsy Rei
Hatsy Rei - avatar
+ 13
I do. it's 4:22am and I haven't slept. So yes. I do
12th Nov 2017, 5:23 PM
jay
jay - avatar
+ 12
It is good to know both ways. What if one has to maintain legacy code one day?
12th Nov 2017, 2:04 PM
jay
jay - avatar
+ 11
yes. also embedded systems may lack support for std::array
12th Nov 2017, 2:18 PM
jay
jay - avatar
+ 11
Some may. I would agree that array and vector should be included along side c style arrays.
12th Nov 2017, 4:10 PM
jay
jay - avatar
+ 10
more is always better :)
12th Nov 2017, 5:15 PM
jay
jay - avatar
+ 6
Send Sololearn feedback 😃
12th Nov 2017, 1:44 PM
Vukan
Vukan - avatar
+ 3
Arrays and subscripting is a language feature. std::array and std::vector are standard library features. Not all projects use standard library. So, imo learning the language features, especially the core ones, like arrays, is essential, and learning the standard library is really useful, but is kind of separate and nay even be optional. Learning std::arrays, std::vectors, and whatever else containers without getting a clue about the language provided arrays, is like learning about smart pointers without knowing what a regular pointer is.
12th Nov 2017, 5:33 PM
deFault
+ 3
Using STL in some embedded projects may be problematic. Some STL functionality may be replaced with the framework's implementations, like in Qt (arguable topic). Different reasons, not very common.
12th Nov 2017, 6:50 PM
deFault
+ 2
Perhaps the Sololearn developers can add new lessons C++03 and C++11 and give a brief explanation of STL Containers and other features in those, just like the lesson 'HTML5' in the HTML course.
4th Dec 2017, 8:06 AM
Solo Wanderer 4315
Solo Wanderer 4315 - avatar
+ 1
Ok, so we think different but we can all agree on teaching each of the three. That's fine.
12th Nov 2017, 5:00 PM
Timon Paßlick
+ 1
I don't quite agree on that. The most is the whole internet. And having read it is good, but probably you're lacking time. You know what I mean?
12th Nov 2017, 5:17 PM
Timon Paßlick
0
How?
12th Nov 2017, 1:44 PM
Timon Paßlick
0
Yes, but the older one is less important and the SL course is small anyways.
12th Nov 2017, 2:07 PM
Timon Paßlick
0
Ahhhh... It's about elegance, not about performance. And if it is not supported by some embedded systems, you can use c arrays again. How many SoloLearners which start learning c++ write embedded systems?
12th Nov 2017, 4:05 PM
Timon Paßlick
- 1
Ok.
12th Nov 2017, 1:46 PM
Timon Paßlick
- 1
@Hard I don't know exactly what you mean. But in the c course, low level arrays must be covered because a c coder has no other choice.
12th Nov 2017, 1:57 PM
Timon Paßlick
- 1
Yes, if they say you should try to avoid them, they can also introduce c style arrays.
12th Nov 2017, 4:12 PM
Timon Paßlick
- 1
That's interesting. Why do some people refuse to use stl for their projects?
12th Nov 2017, 6:41 PM
Timon Paßlick
- 1
Ok.
12th Nov 2017, 6:59 PM
Timon Paßlick