How to teach your girlfriend to program if you are not a teacher, but she believes in you

When your boyfriend is fullstack


When your boyfriend is fullstack


Working as a programmer and living in a five-minute walk from the office, it is extremely difficult to have time to “move away” from work, moving away from work.


I think many people know it: for the last half hour you have been sitting and thinking about an unclear error that came from whence and, as a result, without having solved the problem, you check that all your commits have flown to the corporate repository, turn off the car and exit the office, knowing that tomorrow morning, with a fresh mind, everything will be decided.


No matter how wrong!


Of course, the decision comes at the most inappropriate moment: someone gets behind the wheel, someone in the tram, someone lucky enough to work near the house, somewhere in the yard, and even in the elevator. In my case, the flow of thought following the decision is poured on the girl who, well, in programming, as they say, does not kick her tooth.


Then one day she comes to you and solemnly declares:
- I am ready! Ready to learn programming! Come on!


In this article there will be no source codes, in it I will try to answer the questions that stood before me at the planning stage of a programming course for my own girlfriend.


About how, having no practical experience in training, I decided to introduce a person into programming, who explained that “you are smart” and “we will succeed”, I will tell you under the cut.


Welcome!


What for?


On this seemingly absolutely fair question, I received an equally fair answer:
“You are still talking about programming all the time, and at least I’ll understand you.”


Fair? I'm not sure that this is a good reason to become a programmer, even if not a professional one. On the other hand, I am deeply convinced that in the future, perhaps not so distant, programming, if it does not become something everyday, it will at least make a very serious step in this direction. And as you know, you can not stop the chaos - lead it!


So, having enlisted the support of my girlfriend, and the hope that I got a little bit from my grandmother, who was once a teacher, I sat down to draw up a training plan.


Bicycles - our everything


Of course, it was possible to google tutorials on creating something simple on some conditional python, but, as often happens, I love bicycles, which means that someone’s course will not work for us - we need to do it ourselves.


In fact, of course, like any cyclist, I immediately found many reasons not to use existing solutions. And, perhaps, someone will find them not objective, but I do not pretend to be the last resort. So what’s wrong with a bunch of free online courses?


Programming languages


Teaching programming Russian-speaking person should, of course, in Russian. A lot of terms that we regularly read in the stdlib documentation of the next language are perceived by us, professional programmers, intuitively statement, expressionor even parsethis is something that we don’t have to translate, even if our level of English implies translation, not instant understanding of the text. To a person who is not connected with programming or even simply with IT, many of our terms will simply break their heads, completely discouraging the desire to continue learning.


There are many courses in Russian, but all of them, in my opinion, are not suitable for an ordinary person. Why?


First of all, for the most part, these are either web programming courses ( PHP , JS , Python , etc), or because of this to your enterprise ( Java , C # , etc), or this is C / C ++ - this is not a cake for newbie


The first category usually does not teach programming itself , offering to make a finished product for several lessons - a site usually. I don’t see anything wrong with that if a person’s goal is to create a website , but let's be honest: such courses will give you a certain architectural pattern (MVC, most likely), a code base for several modules, and that's all - no knowledge. It is thanks to these courses that we have so many stupid questions in the telegram channels and forums devoted to some language or technology. And it is impossible to blame the newly minted programmers for these stupid questions - they have not received basic knowledge, hence all the troubles.


As for the other two categories, again, I believe that this is not what a newcomer should start with.


I remember how fellow students at the university ran into the topic of pointers. Most of them still do not understand anything about it, and yet they were couples: a living teacher, the possibility of dialogue, the duty to practice - all the conditions.


By the way, if I am not mistaken, then I am the only one of my course who works in the specialty. I think that contributed to this study in the school of QBasic and Pascal , simple, understandable and giving a basic understanding.


Carrying all these thoughts in my head, I came to the conclusion that the best language for learning, in my opinion, is Go today : simple syntax, strong static typing, the ability to start work without dancing with a tambourine and, a lot of important things, to collect any platform without the same dancing - all this makes Go an ideal candidate for the first programming languages.


I should add that I hadn’t written on Go before, but for work I just needed to write a fast multi-threaded web service, which meant that I could train my girlfriend, while at the same time learning myself.


It was here that it turned out that there are no materials for teaching a person to program from scratch to Go in runet. There are wonderful tours, specialized sites and everything, everything, everything that will allow you to master the language in a day or two, if you already know how to program. But she - can not.


Hello bike


Practical value


As a result, most of the courses offer you to have in your cozy home repository either an arbitrary number of scattered examples, or a finished product, usually not necessary for you.


Of course, the free course “Simple Store on React + Redux ” is an experience, however, as I said, in practice it is useful only to a person who wants to have a shop , but does not want to hire someone to develop it.


In fact, the newcomers who have completed a similar course will not make any progress in programming.


In my opinion, the ideal option for a novice developer would be to study the basics of programming , but using the example of creating an interesting product for him .


Developing a project from scratch will allow you to acquaint a person with all the stages of the project’s life from, I apologize for the tautology, its design - before deploying in a combat environment and subsequent support.


In this case, the student should not receive ready-made architectural solutions and, especially, source codes. All this should be a product of studying relevant aspects of development.


But what might interest a girl?
I wrote my first program (apart from what we wrote in class) for my younger brother when he began to learn the multiplication table: entering a range of numbers, randomly outputting two of them to a brother with a suggestion to enter their work, test and so on in a circle.


It was probably my seventh grade. At this age, writing a useful (at least some) program was happiness for me, that is, I was interested . But it is easy to interest a seventh-grader in writing a primitive “calculator” —what can an adult girl be interested in ?


The idea came, as usual, from everyday life. Once again, she asked me to write the proportions of ingredients in a notebook.


Honey, we urgently need a bike!


Big and with a sidecar


We have long wanted to start a book of recipes, because she likes to experiment with me, and these experiments are often very successful.


But is it really just a recipe base?


Of course not!


On what , what and in what order we will write, I understood at the same instant.


Back-end


What we start with Golang is that it was decided before it became clear that we would write. Now it was possible to decide on what exactly Go would be responsible for .
API . Of course, the API !


The language allows the standard library to raise a simple http-server, which will be a layer between the database and clients.


By the way, it was decided to use PostgreSQL as the database . SQL is an excellent language for developing the logic of working with data, plus we can touch PL / pgSQL , which, in general, is quite similar to Go , which means that during the development of the backend we can already learn three to one degree or another. language.


Front-end


Since in this situation there are no deadlines, as well as individual development teams, we can afford to start the frontend after our server part is complete.
Why exactly?


Firstly, it will allow not to switch between too many languages ​​and technologies for a beginner.


Secondly, we need to teach a person into architecture. Therefore, let them first develop a full-fledged backend, and only then go to the client.


As for the client, the choice for me here was also obvious.


Ignoring the trend for reactivity is stupid, because we do not have tons of Legacy code, in addition, some of these frameworks are extremely easy to learn.


We are talking about Vue.js . Of course, one could use React or a more exotic solution like Svelte , but it seems to me that these technologies are for more mature developers.


In addition, the client part will be written in TypeScript . Probably, many will disagree with me, but still I believe that dynamic typification is, at least, a blessing, but it is good only in the hands of those who understand what typification is in general.


That is why to continue learning, it seems to me, more correctly in a language with static typification. It is in the language, so Flow was not considered. On the other hand, I wanted to keep the maximum compliance with JS , without taking the girl to CoffeeScript , Elm , etc.


Speaking of the frontend and the modern technology stack, one can not forget about the Progressive Web Application ( PWA ).


In my opinion, this is the ideal technology for learning, or, more precisely, to interest the student.


Own application in a mobile phone regardless of the platform? Do not need to learn difficult for a beginner languages? This is a great motivation, perhaps one of the best, I think.


Therefore, our frontend should, above all, meet all the requirements for PWA .


Mutual language


The last question I could find an answer to was the format of the client’s communication with the server.


On one side, otherwise, there was REST with all its advantages and disadvantages, and on the other - GraphQL . I didn’t want to offer pure REST , as it entails certain problems that gave rise to such solutions as GraphQL . However, GraphQL itself , in my opinion, is also not a good technology, although it is of some interest. But again, interest for me, for other developers - yes, but for a beginner of GraphQL , as a way to solve problems associated with the use of classical REST , will not be interesting, because the beginner doesn’t know all these problems, does he?


Why not try to combine the ideas of REST and GraphQL ?


Of course, thinking through your own implementation goes beyond learning the basics of programming, but writing is by no means. Therefore, it was decided to secretly invent your own bike, and offer to implement it in the framework of the project.


Results


What we have to go:


  • First you need to develop a server-side architecture;
  • Then meet and design the database structure;
  • Having a database, we begin to study Go and write the server API ;
  • Next comes acquaintance with HTML and CSS ;
  • Having mastered the basics of layout, quickly parse TypeScript syntax ;
  • Having dealt with TypeScript , we start writing frontend on Vue.js ;
  • We are upgrading the frontend to the PWA level .

For me, this is the first human learning experience in programming. Perhaps this approach will show itself not as I see it in my own head.


However, I hope that he will still justify himself, and my experience will be useful to someone who falls into the same situation.


Thanks for attention!


Also popular now: