Answer the question
In order to leave comments, you need to log in
Programming for children (12+ years). Trends ?
Good evening! I would be glad for any answers and comments
. My daughter is studying at the lyceum. With friends, he participates in olympiads and other physics and mathematics competitions. But the irony of fate is that the computer science teacher left the country and this subject is taught by the physics teacher in the general education program.
What books or frameworks to start educating teenagers with? It is important to understand not only the realization of the existing potential (advanced mathematics, geometry, eureka, computer science, etc.), but also the applied meaning of independent learning for children. The idea is that the chosen direction of programming / modeling will find its application in the future 5-7 years in the future.
Answer the question
In order to leave comments, you need to log in
Learn basic languages and algorithms. We were taught first in Pascal, then in C ++, at some point we were given the opportunity to choose the language in which we submit projects. The projects were something like this: tags, a calculator, parsing an expression (using BNF), long arithmetic (about numbers that do not fit into the desired type), parsing an expression and plotting a function, Markov chains, an archiver using the Huffman algorithm. And of course, some task databases with testing systems like topcoder or acmp.ru
Better dig in the direction of Olympiads in Informatics. Freimworks will not save here. This is where brains are needed. Ability to solve problems. You can look at books written by Steven Skiena. Look for clubs in sports programming in the city.
The idea is that the chosen direction of programming / modeling will find its application in the future 5-7 years in the future.Easy: robotics/pattern recognition/BigData.
I do not want to advertise - but we will be happy to invite him to our programming school for children CODDY
You have a very strange code (I advise you to install rubocop and read it) and initially a strange implementation, but I will try to translate what you wrote into something more readable
favorite_room = cookies[:favorite_room].present? ? Room.where(id: cookies[:favorite_room].split('/')) : []
Solved the problem like this:
@arFavoriteRoom=cookies[:favorite_room]
if not @arFavoriteRoom.blank?
@[email protected]('/')
else
@arFavoriteRoom=[]
end
favoriteRoom=Room.where(id: @arFavoriteRoom)
favorite_rooms_ids = cookies[:favorite_room]&.split('/')
favorite_rooms = Room.where(id: favorite_rooms_ids) if favorite_rooms_ids
There are a lot of things in your code, not exactly errors, but things that are not recommended to be done in ruby. I highly recommend reading the rails guide, Matsumoto's Ruby book, and Agile Web Application Development with Rails.
For example:
@ is a prefix for the instance variable, it is not needed here at all.
if not - ruby has operators not, and, or, etc. but their execution priority is significantly lower than their counterparts !, && and || so it's better to use symbols so you don't shoot yourself in the foot.
camel_case is used to name classes and modules, and even more so not in js style with a small letter, write beautiful code so as not to suffer later.
and there are many more comments that can be made on the syntax, so I highly recommend tightening it up.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question