Блог пользователя MikeMirzayanov

Автор MikeMirzayanov, 5 лет назад, перевод, По-русски

Привет, Codeforces.

На прошлой неделе я стартовал эксперимент.

Я верю в полу-автоматизированное обучение программирования через задачки. Есть понятные плюсы такого подхода: независимость практики от преподавателя, хорошее тестирование решений, понятные майлстоуны у ученика, способность системы к масштабированию.

Основы программирования в этом смысле совсем хороши: несложно подготавливать задачи, есть понятный план обучения, хорошо понятен прогресс ученика.

Наверняка какие-то структурированные курсы для обучения языку с нуля уже есть. Но почему бы не сделать именно так, как нравится именно мне? ИМХО, здесь принципиально важен набор задач — рост уровня их сложности, разнообразие, отсутствие требований в математической подготовке. У меня есть опыт преподавания (ОМГ, почти 20 лет!), некоторые наработки от моей работы со студентами Саратовского университета и желание попробовать!

Итак, эксперимент. Начиная с 20-го февраля замечательная девушка le.mur занимается изучением основ C++ с нуля под моим присмотром и руководством. Мы договорились, что свои впечатления она фиксирует в специальном Instagram-аккаунте (подписывайтесь, это мотивирует!) Лена не училась математике каким-либо углубленным образом, начальных навыков в программировании и информатике – нет. Каждый день она занимается 2-4 часа. Одно домашнее задание должно выполняться за 1-4 дня. Мой план состоит в том, что можно минимизировать индивидуальные объяснения, пока так и получается.



Нагло украл фотографию из Instagram

Примерный план обучения на ближайшее время (то есть самое начало) выглядит примерно так:

  • Понятие переменной, простейшие функции (min, max, abs), задачи без ветвлений и циклов.
  • Оператор ветвления, обе формы (if, if-else). Понимание областей видимости переменных, вложенные ветвления. Задачи на ветвления.
  • Операторы циклов: while и for. Задачи на применение циклов без дополнительных конструкций (то есть решаются в один цикл без ветвлений и вложенных циклов).
  • Задачи на применение циклов и ветвлений.
  • Задачи на применение вложенных циклов.

Каждый пункт соответствует одному домашнему заданию и будет содержать 10-20 задач по этой теме. Дальше по плану ожидаются массивы и строки, но до них еще только предстоит дойти.

Один из первых выводов, который я успел для себя сделать: на начальном этапе не стоит погружать в излишние детали, упрощенное или неполное понимание помогает понять основы. Например, пока Лена оперирует только целочисленными переменными (тип int), всегда ставит фигурные скобки после управляющих операторов, использует только логические && и ||, лишь примерно понимает смысл заклинания «using namespace std». Мне кажется, что после получения первоначальных навыков расширить понимание типами, дополнительными операторами и прочими подробностями будет проще.

Я надеюсь, что у Лены будет получаться и она не потеряет мотивацию к занятиям.

А как вы изучали самые основы программирования? Что хорошо сработало именно для вас?

  • Проголосовать: нравится
  • +266
  • Проголосовать: не нравится

»
5 лет назад, # |
  Проголосовать: нравится +134 Проголосовать: не нравится

Thank you, I will definitely try to do well and learn a lot of new things!

»
5 лет назад, # |
  Проголосовать: нравится +42 Проголосовать: не нравится

Мне snark показался.

Видимо мне пора менять глаза .

»
5 лет назад, # |
  Проголосовать: нравится +24 Проголосовать: не нравится

Hello! I used a Brazilian site, called CodCad, (now its into another one, NepsAcademy). It teached me the very basics at CP and my first teacher was Rogério Júnior, a ex-competitor, silver at IOI 2016. He was the main reason, cause the way he used to teach programming was awesome and enjoing. Now he's at MIT, so im studying here, at codeforces!

  • »
    »
    5 лет назад, # ^ |
      Проголосовать: нравится +4 Проголосовать: не нравится

    Can you identify the main reasons and features that made Rogério's course so interesting and useful?

    • »
      »
      »
      5 лет назад, # ^ |
        Проголосовать: нравится 0 Проголосовать: не нравится

      The simple way he approached to the questions, pacience to explain and, mainly, the love he showed while coding and teaching. He was so inspiring and he trusted at my potential and told me that I could have a chance to go to IOI. After that, I`m studying a lot in order to improve always!

  • »
    »
    5 лет назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    I also can say that I learned most from CodCad. Really useful to grasp the concept

»
5 лет назад, # |
  Проголосовать: нравится +23 Проголосовать: не нравится

Когда впервые в школе появилось программирование, списывал все у соседа в течение пары месяцев, постепенно, в процессе этого списывания, сам во всем разобрался

»
5 лет назад, # |
  Проголосовать: нравится +7 Проголосовать: не нравится

I did a self-paced online programming course, Harvard's CS50x, on and off when I was in 9th grade. But I feel like I've learned more from competitive programming and doing my own projects rather than taking a structured course, so this idea seems like a good combination of the two.

»
5 лет назад, # |
  Проголосовать: нравится -13 Проголосовать: не нравится

I think, I know who'll beat tourist one day :D

»
5 лет назад, # |
Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

Я как-то рассматривал идею построить автоматическую систему обучения базе олимпиадного программирования посредством решения небольших заданий, в постановке которых содержатся сложные идеи, придумать которые самостоятельно — проблема для обучаемого. Ваш эксперимент в этом плане будет очень интересным.

Мои оценки указывали на невероятную сложность подготовки набора заданий, у меня получалось, что речь идет о сотнях, если не тысячах. Кроме того, у меня не было сильных идей, как устранить типичную копипасту кода уже решенной подзадачи, столь часто встречаемую на олимпиадах.

  • »
    »
    5 лет назад, # ^ |
      Проголосовать: нравится +14 Проголосовать: не нравится

    ИМХО, в олимпиадах используются уже достаточно много сложные идеи и пройти весь путь переизобретая всё задача для единиц. Мне кажется, что именно при подготовке к соревнованиям работает простой эффективный подход:

    • изучение теории и подходов — лекции, чтение книг/статей, просмотр видео-объяснений;
    • решение учебных задач по темам (без жестких временных рамок, не контест) — домашние задания, прорешка старых тематических контестов, дорешка задач;
    • применение новых навыков в режиме контеста — раунды, учебные тренировки, просто тренировки с задачами на тему и т.п.

    В пользу будет чтение кодов других участников на сданные задачи, иногда работа в команде.

»
5 лет назад, # |
  Проголосовать: нравится +8 Проголосовать: не нравится

Yeah, that's basically how I learned programming. I had algorithmic theory from our local correspondence seminar, but as far as actual coding, I was just trying to solve problems and looked up concepts I had the most difficulty with (such as what the hell is standard input/output and how do I use it).

  • »
    »
    5 лет назад, # ^ |
    Rev. 2   Проголосовать: нравится +8 Проголосовать: не нравится

    such as what the hell is standard input/output

    Heck, I had trouble understanding loops and arrays for couple of month in high school

    • »
      »
      »
      5 лет назад, # ^ |
        Проголосовать: нравится +1 Проголосовать: не нравится

      Features of imperative programming languages: you write what computations you want it to do, it does that (or something else... or crashes...).

      Features of an environment/framework: you write a magic command and a complex process gets done. How does that even work?

»
5 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

That's actually the same as my experience for learning my first language, C++. The teacher told us to solve problems using C++, and along the way I started to learn the basics of the language as well as those more advanced techniques (like sort by comparators, etc). I would say that such way of learning is pretty effective since the feedback (which is essentially the most important thing in motivating learning) is given immediately when you solved the problem.

»
5 лет назад, # |
Rev. 2   Проголосовать: нравится +14 Проголосовать: не нравится

Cool idea for a blog, but maybe more details would be helpful for other beginners. Are you choosing problems from online judges or preparing something new with small jumps of difficulty?

I remember a course of Pascal (and later C++) with simple problems: read A and B, and print the area of a rectangle with dimensions A and B. Reverse the array. Print the christmas tree made of characters '*'. So yeah, I also learned by solving problems.

It would be cool to eventually have a start-from-zero series of problems/lessons in Codeforces. On the other hand, such things exist already for sure (like a Polish platform from which I learnt).

  • »
    »
    5 лет назад, # ^ |
      Проголосовать: нравится +11 Проголосовать: не нравится

    I use educational problems (mostly just exercises) I used in Saratov State U with students/schoolchildren. Also I prepared some problems because in some topics I don't have much easy educational problems. If this experiment succeeds, I will consider the opportunity to publish the materials in the form of a course.

    • »
      »
      »
      5 лет назад, # ^ |
        Проголосовать: нравится +18 Проголосовать: не нравится

      If you don't mind me asking, how exactly will you define the success of the experiment? Her being able to solve a certain difficulty after a period of time or maybe you have something else in mind?

»
5 лет назад, # |
  Проголосовать: нравится +10 Проголосовать: не нравится

Мы в школьных лагерях практикуем изучение С++ с нуля, программа очень похожая и подписаться могу под каждым словом. Добавлю только, что после изучения циклов мы сразу сажаем людей на vector и string, т.к. использование массивов и char-строк в С++ взрывает мозг новичкам. Самое сложное — первые 2 дня, когда надо объяснять, как работает среда разработки, а дальше процесс идёт довольно легко — главное, не гробить и не бояться давать очень похожие задачи, чтобы закрепить получше навыки. Пока кажется, что всё успешно, но о конкретных результатах можно будет судить через 2-3 года.

P.S. Рубинчик в лагерях пропагандирует начинать обучение с Python. У меня был крайне неудачный опыт со студентами после Python — переучивать их оказалось даже сложнее, чем паскалистов, так что пока стараюсь избегать — может быть и зря.

  • »
    »
    5 лет назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    Всё так, массивы и строки планирую сначала давать на примере std::vector и std::string.

»
5 лет назад, # |
Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

Great idea! I look forward to hearing how far this goes (I bet very far).

And how did you learn the very basics of programming?

Solving lots of problems on Project Euler :)

What worked well for you?

Getting instant feedback, having clear goals (for me, "solve the next 5 problems" is much more motivating than "try to learn Python, I guess"), gradually increasing difficulty

»
5 лет назад, # |
Rev. 2   Проголосовать: нравится +151 Проголосовать: не нравится

only approximately understands the meaning of the “using namespace std” magical spell

[hashtag]metoo

»
5 лет назад, # |
  Проголосовать: нравится +12 Проголосовать: не нравится

Удачи ВАМ! Надеюсь, будет интересно наблюдать!

»
5 лет назад, # |
  Проголосовать: нравится +15 Проголосовать: не нравится

I started solving problems after I had nearly completed 3 years in computer science, and I already knew most of the basic algorithms. Only after I started solving problems and competing online did I realize that I actually had not fully understood a lot of them, or the importance of complexity. I even lacked basic debugging skills, plus a lot of other stuff that I know consider to be basic knowledge. Not only did I gain coding quality and speed, I also started learning and using more advanced algorithms, and even having a good time while doing so, something I would have never done by myself by reading a book or attending some random lecture. TL;DR: I learned the basics in university, but what worked well for me was sitting down and solving problems and competing.

»
5 лет назад, # |
Rev. 2   Проголосовать: нравится +22 Проголосовать: не нравится

Your idea reminded me of my experience in adaptive simulator (Python example). The essence of the practical approach: a person is looking for information when it is needed. If the problem is not solved, the authors give a simpler one.

+ The analysis paralysis is unlikely (I know that gKseni loves this concept). This problem occurs among theorists and is sometimes called "overthinking".

+ The information that a person searches for himself and immediately applies is best remembered.

- Knowledge will not be complete (online course can help).

- You need to have the strength to decide to open complex tasks, when you can enjoy only simple ones.

And thanks for this post. My not very long way in IT began with a thought: to solve problems on the first date is so romantic. :D

»
5 лет назад, # |
  Проголосовать: нравится -20 Проголосовать: не нравится

Беспалевный пиар инсты.

»
5 лет назад, # |
Rev. 2   Проголосовать: нравится +17 Проголосовать: не нравится

Update on March, 17: In 3 weeks le.mur solved about 60 problems, studying each day for 2-5 hours except weekends and few day-offs. Now she is studying linear arrays (she uses std::vectors).

»
5 лет назад, # |
  Проголосовать: нравится +27 Проголосовать: не нравится

Update on April, 15: In ~7.5 weeks le.mur solved 105 problems. She continues to study each day for 2-5 hours (there was a rest week because of ICPC finals plus weekends). She is starting std::strings. I think after strings and practice with multi-dimensional arrays, she will be ready to take part in Div3 rounds!

  • »
    »
    5 лет назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    Сколько задач она решила за 4 месяца ? Вы можете где-нибудь добавит список этих задач?

    • »
      »
      »
      5 лет назад, # ^ |
        Проголосовать: нравится +31 Проголосовать: не нравится

      Please, use English to reply comments in English. I think there were a confirmation windows like "Are you sure your comment in English?" and you ignored it :-(

      I wrote about here progress below. Most problems are absent on Codeforces, they are not from the contests but they are special educational problems to study basics of a language. Probably, some day I'll publish them as a course for those who are just starting to learn a programming language.

»
5 лет назад, # |
  Проголосовать: нравится +27 Проголосовать: не нравится

Update on June, 25: In ~4 months le.mur solved 182 problems. Now she is focused on problems with nested vectors.

»
5 лет назад, # |
Rev. 2   Проголосовать: нравится +1 Проголосовать: не нравится

I have a friend who wants to get into programming as well, do you Mike, or anyone else have a set of easy problems (truly beginner problems) for my friend to train in.

I can explain him some simple things, but I almost never encounter simple problems in Codeforces for him to train in.

A's in CF are sometimes what I think would be too hard for him and sometimes too unchallenging (they require simple observation and not a teachable C++ experience).

I can probably find some good easy problems on Google, and I will, but if you have any good list that he can follow, it would mean a great deal.

  • »
    »
    5 лет назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    If he is really learning from the very very beginning, then probably a traditional book is the better option. If it is competitive programming then probably USACO training pages is best.

»
5 лет назад, # |
Rev. 2   Проголосовать: нравится +20 Проголосовать: не нравится

One of the best books on teaching programming I've ever read is an old Czech book from 1989 "Martina si hraje s počítačem" (Martina plays with a computer) -- essentially a crossover between a novel and an exercise book that tells a story about how a young girl discovers programming via solving a graduating sequence of tasks set (in secret) by her neighbor, and invites the reader to follow along and solve the same exercises. The book is now horribly outdated, of course, but the core principles are still sound, and resemble your attempts here quite significantly.

Professor Hejny (*the* living authority in teaching maths in Czechia and Slovakia nowadays) has had a lot of success with using similar approaches to help ordinary primary school kids learn maths the way it should be done: by discovering it and learning to think instead of just memorizing stuff.

But make no mistake: when using this approach, a good teacher is even more important than with the classic lecture-based approach. The selection and/or preparation of good tasks is quite crucial for the approach to work as intended.

One important thing I would say you are missing at the moment is interaction with peers. Kids take information from authority in a different way than from their peers. Also, being forced to communicate, explain your ideas, and (very importantly!) resolve conflicts can help your students grow immensely. And excellent materials will, in fact, sometimes intentionally introduce such conflicts as a way to help the students grow.

To illustrate with a simple example, imagine showing a bunch of 7-year-olds a picture of three kids standing on a podium for the winners of a race. The one who won has their head highest, but the one who was third is taller. Now you ask the classroom: point to the kid whose height is the largest. And you let them have a disagreement. Let them voice the arguments for each option, and then have them reach a conclusion (or not). This is real maths. They are just (without knowing they do) discovering why in maths exact definitions matter, and that without them you can have all kinds of ambiguities. They are also learning how to communicate and share their ideas in a way in which the others can understand them.

Good luck in your future endeavors! :)

»
5 лет назад, # |
  Проголосовать: нравится +11 Проголосовать: не нравится

Update on September, 23: In ~7 months le.mur solved 300 problems. Most of recent problems are from Codeforces with ratings in the range 1000-1400. She started to take part in rounds. Hope, she will return green soon. I'm proud of her progress!

»
4 года назад, # |
  Проголосовать: нравится +67 Проголосовать: не нравится

Update on December, 30: In ~10 months le.mur solved 400 problems! She is middle green now. I'm sure: cyan is waiting for here!

  • »
    »
    4 года назад, # ^ |
      Проголосовать: нравится +7 Проголосовать: не нравится

    Hi, I have a suggestion. Now and then many people write blogs asking how to improve. Since you are guiding her, you can make a sheet of problems/links that you asked her to solve or go through and make that thing public. Many people would be benefit from this and they can follow this sheet for training and practising.

    I am of the view that this would help the masses a lot.

    Thanks

  • »
    »
    4 года назад, # ^ |
      Проголосовать: нравится +13 Проголосовать: не нравится

     How does codeforces show only 68 were solved? Is she practicing elsewhere? I am confused

»
4 года назад, # |
  Проголосовать: нравится +19 Проголосовать: не нравится

How's the experiment so far ?

  • »
    »
    4 года назад, # ^ |
      Проголосовать: нравится -33 Проголосовать: не нравится
    • »
      »
      »
      4 года назад, # ^ |
        Проголосовать: нравится +4 Проголосовать: не нравится

      why are you booing him? He is technically not wrong.

      • »
        »
        »
        »
        4 года назад, # ^ |
          Проголосовать: нравится -6 Проголосовать: не нравится

        Because you can't really tell that's someone's failing or succeeding just like that. If a person stays newbie for like 2 to 3 years but improves slowly afterward, eventually becoming a GM in 10 years, would you say that they failed and then succeeded? That doesn't even make sense. You fail only when you give up without reaching your goal.

    • »
      »
      »
      4 года назад, # ^ |
        Проголосовать: нравится +4 Проголосовать: не нравится

      Not really, I think the goal was the programming itaelf, not CP. Being good at CP requires strong math, and that is a different story.

    • »
      »
      »
      4 года назад, # ^ |
        Проголосовать: нравится +15 Проголосовать: не нравится

      Unfortunately, Lena's emphasis has changed and now she spends less time on programming. I do not think that the experiment failed — she studied many programming concepts from scratch, continues to solve, and moves forward mainly through problem-solving. Rather, it only confirms the idea that the most important aspect is motivation, which helps diligence. She solved more than 500 problems for now. I think that it is the programming technique that is already quite stable green, but the lack of math background and difficulties with olympiad ideas prevent rating increase. I think that Lena should not pay significant attention to the rating graph and simply move forward in solving problems, understanding the main topics, and increasing the competitive experience.

      • »
        »
        »
        »
        4 года назад, # ^ |
          Проголосовать: нравится 0 Проголосовать: не нравится

        idk if it applies to everyone, but in my case, as a guy who started out cp with 0 math background(not exaggerating, I didn't even know algebra), going through a course on logic and proofs impacted my thinking significantly(made it better of course). I've often used proof techniques during contests to prove facts about possible solutions(of course you need to know a little bit of theory too). So far I've managed to peak expert within a year. As for the resources I used, I grinded through "How to prove it" by Velleman, which took me a few months.

»
4 года назад, # |
  Проголосовать: нравится +27 Проголосовать: не нравится

Thanks for sharing your experiment Mike!

I agree with not explaining super detail about certain things, i have been there myself and tried to teach one of my students that way. I think it makes them feel more "free" to experiment and to less care about how the code could go wrong, which is good for learning in the beginning.

I find that your several points about the experiment in this blog remind me that i miss something when i teach nowadays, that's why i feel grateful and lucky enough to be able to find this blog post from year ago.

»
4 года назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Wish everything goes well with the learning program!

»
4 года назад, # |
Rev. 2   Проголосовать: нравится -11 Проголосовать: не нравится

  • »
    »
    4 года назад, # ^ |
      Проголосовать: нравится +12 Проголосовать: не нравится

    Because the outcome is not known?.. I know people who could not grasp a notion of variable, when explained by experienced programmers.

    Learning methods are quite important. My first teacher was not doing a good job, I could not understand the loops as she explained it in a way that left me wondering "what is the meaning of going in a loop, you do not get anywhere apart from the starting point".

»
4 года назад, # |
  Проголосовать: нравится +7 Проголосовать: не нравится

Apparently, the girl must have donated huge amount on 10th anniversary.

She owns Codeforces' tee, cap, hoodie and stickers.