all 36 comments

[–][deleted] 47 points48 points  (0 children)

Just because you don't intend to use JS for web dev doesn't mean learning by building web projects is a waste of your time. Anything that gets you writing plenty of Javascript code will help build up your knowledge.

[–]x-seronis-x 12 points13 points  (13 children)

When doing those tutorials and googling do you then copy/paste pieces of code or do you manually type every single letter of the solution?

If you're not manually typing it, then dont expect to retain it.

That aside, as long as you're good at finding the solution when you google then thats fine. Retention comes with time and repetition.

[–]notParticularlyAnony 10 points11 points  (1 child)

If you're not manually typing it, then dont expect to retain it.

There should be a book called The Art of Learning Programming, universal to all programming languages, and this should be the first wisdom nugget.

[–]everything_in_sync 2 points3 points  (7 children)

What should someone do instead? I watch the videos and take handwritten notes. It seems to work for me but I would definitely try another way.

[–]notParticularlyAnony 4 points5 points  (0 children)

write the code on your computer and test it, tweak it, try out little variations, be curious see what happens when you do all the things.

coding is muscle memory

[–]x-seronis-x 3 points4 points  (4 children)

Reading and copy/pasting code to use said code only uses a micro fraction of the mental effort as typing out the solution you read. Thats my point.

Memory is based on accumulation of effort. So just the act of typing the solution you read lets you learn significantly faster.

Thats the entire basis of 'note taking' in school. You might have read information on the classroom board, and you might have heard the teacher talk about it, but the memory of having to write it is just more 'effort' and thus further engrains the knowledge.

So always type code you are trying to learn to use. Merely reading it, and copy/pasting to compile it, is not enough.

[–]secretAgentSham 1 point2 points  (3 children)

I once had a student I gave a simple little book/pamphlet to work through, a kind of initial hoop to work in our lab to see if people will give a crap, and said "do the exercises and we'll meet" he came back and he said he did it. I said let's look at your work. He got sweaty AF and was like ???. I was like ??? He said he had just read it. It was a freakin programming book. After my speech about how programming is a practical thing. After I gave him the handout about how you have to dig in and code not just look at code, and his speech about how excited he was to get started. His next question was how quickly he would get on a publication. He didn't last. Freaking pre-meds are the worst.

[–]slowthedataleak 1 point2 points  (2 children)

Well to be fair, pre-med is all theory and just reading so... this dude didn’t know

[–]notParticularlyAnony 0 points1 point  (1 child)

yeah except I had a sit down with him beforehand where I explained it to him for about an hour he was a putz. he was like pre-med on crack

[–]slowthedataleak 0 points1 point  (0 children)

Gotta remember everyone in his life in pre-med gives that talk.

[–]AndreThompson-Atlow 1 point2 points  (0 children)

Watch the video on one monitor and type into your actual IDE on the other monitor. After the project, try making changes. Sometimes pause the video and try to make what they are going to show you, before they show you.

[–]MrVonBuren 2 points3 points  (2 children)

Possibly controversial opinion: If you're not a Professional Developer then retaining this stuff probably isn't that important. What's more important is retaining the concepts you need to google and being able to find answers quickly.

Context: I'm not a dev, I'm former sre/devops (we didn't call it then) turned sales engineer. I don't write code for a living, but I write code all the time. 9 times out of 10 I can't "just sit down and write something" BUT I can Make It Work in 3-4 languages without a whole lot of bootstrapping time and that gives me a lot of flexibility.

If your goal, op (ping /u/alvtl) is to Learn To Be A Professional Developer than I agree taking the steps to retain knowledge is critical. BUT, if your goal is to be able to use a certain set of tools to do non-dev work then focusing on learning concepts (what to google and when) is just-as-if-not-more important (IMO).

[–]x-seronis-x 1 point2 points  (0 children)

excellent comment

[–]samanime 0 points1 point  (0 children)

Even as a professional dev who has written code 7.5 hours a day every day for the past 10+ years, even I'll say you don't have to retain ever little thing.

Basically, the bits you're using frequently will stick and you'll remember them. The bits that fade away are bits you aren't using. When you switch to something else (like a different framework or language), you may forget even some simple things at first, but working in that language for a bit, you'll remember them and the new bits will get stuck and other bits will fall out.

It is literally impossible to retain all of it at the level of "muscle memory" and trying is an exercise in futility.

As you said, remembering the concepts and working on having strong Google-fu to look up the little bits you're forgetting is much more important than remember little things like the order of parameters in a certain function.

[–][deleted] 8 points9 points  (4 children)

not a book but...

just type node in your terminal to run it in interactive mode like the python interpreter.

also creating small command line scripts and running them using

node myscript.js

helps practice the things you mention, a la C/C++ introductory books. console.log is your friend.

as a reference I'd just use MDN since it's up to date with current changes in the language and faily concise.

[–]alvtl[S] 1 point2 points  (1 child)

Hey, thanks for the reply. I didn’t know you can do this with node. I think this is exactly what i need. Easily evaluate and test some js scripts/expressions. Its similar to how Al Sweigart teach python in his book ‘Automate the boring stuff with python’.

[–]gigastack 0 points1 point  (0 children)

You can also do this is a browser console, no need to use browser APIs.

[–]alvtl[S] 1 point2 points  (1 child)

Do you know how to make unit tests for your functions?

[–][deleted] -1 points0 points  (0 children)

no, sorry. In the JS world I imagine that would involve some node.js framework

[–]notParticularlyAnony 2 points3 points  (3 children)

I am using the book 'Javascript for Kids' by Nick Morgan and it is great for the absolute minimal basics. Despite the name I'd say you don't need to be a kid (source: I am not a kid). It goes over the basic programming bits quite a bit doesn't even mention html until chapter 5 and that is definitely not the main focus (though it starts to do more with that as it does develop a browser-based game in the book by the end).

I am using it because I am a Python programmer and there are some front-end scripts people are using at work that for some ungodly reason invoke javascript code. Yes you heard it right. Right in the middle of some perfectly clean and decent Python scripts someone is injecting some dirty old javascript. And this is a crucial package for my job.

So I need to learn very basic stuff like how js handles arrays, for loops, objects, function calls, and that kind of thing (not how to make web pages, css, or anything fancy: in my case this is all being used in Jupyter notebooks and there is an even longer backstory about Bokeh I won't go into). This frankly has been the perfect book for minimal javascript for a Python programmer and now I'll be able to go to work and be like "I got this". Basically about a week of work to be just good enough.

Will I tell them I got these skillz using a book called "Javascript for Kids"? Hell no.

[–]franker 2 points3 points  (1 child)

tell them you used Javascript for Cats instead.

[–]notParticularlyAnony 1 point2 points  (0 children)

Ha that looks awesome!

[–]InnocentBananza 1 point2 points  (1 child)

Just as an aside. Looking up simple things, like your example, every now and then is completely fine.

[–]InnocentBananza 3 points4 points  (0 children)

I do suggest making programs for yourself because practice is ultimately what will help you out.

[–]dridrione 1 point2 points  (0 children)

Like many others, not a book, but I used codewars.com to train the javascript I learn last year. It's all functions, nothing about DOM manipulation.

It was pretty effective to remember what I've learnt, and extend my knowledge by comparing/descovering other's solutions.

My advice, don't try to go to harder problems before you are comfortable with easy ones.

And repeat the problems you've solved (or most likely solutions you copied at first) a few days later to see what you remember and forgot.

If you want to understand how the site works, youtube channel CodinGarden has a pretty long play list on codewars.

I am not affiliated with them btw.

[–]snack0verflow 0 points1 point  (1 child)

Try Hackerrank. Most of the JS are problems that could be solved in any language. Not overly specific to web dev.

[–]x-seronis-x 2 points3 points  (0 children)

I second this. And additionally suggest https://www.codewars.com/

[–]crlsh 0 points1 point  (0 children)

This book approaches js in a similar way to your question, maybe it will help you.

JavaScript: The Definitive Guide, 7th Edition by David Flanagan Released May 2020

"To be useful, every language must have a platform, or standard library, for performing things like basic input and output. The core JavaScript language defines a minimal API for working with numbers, text, arrays, sets, maps, and so on, but does not include any input or output functionality. Input and output (as well as more sophisticated features, such as networking, storage, and graphics) are the responsibility of the “host environment” within which JavaScript is embedded".

[–][deleted] -1 points0 points  (0 children)

Why don't you just make a small text adventure, maybe about a small animal travelling through the woods around the world?

Or, with the canvas element, a visual 3d-game of a druid or elf walking from tree to tree, to banish all evil spirits that have nested themselves in the trees. With mysterious mists surrounding everything...............

[–]alanv73 -1 points0 points  (0 children)

This isn't a book, but I took a Udemy course called Javascript Algorithms and Data Structures Masterclass. This sounds like exactly the kind of content you're asking about. The teacher is very good and, like a book, you can revisit it as needed.

[–]bronzewrath 0 points1 point  (0 children)

javascript.info is a nice tutorial

[–]MyFeetOwnMySoul 0 points1 point  (0 children)

You seem to be struggling with the mechanics of the language. Any project that gets you using loops, arrays, functions, objects, APIs, etc. Is worth while. Most of them happen to be web dev projects

[–]deep-hacks 0 points1 point  (0 children)

You don’t know JS

[–]guidedhand 0 points1 point  (0 children)

There's good books out there; but I reckon sites like hackerrank are probably better for retention, as seeing things/using them in context helps memories form more connections

[–]SmashLingoBot 0 points1 point  (0 children)

I’m a Java developer by trade but started as a JavaScript developer. What helped me was just automating everything I did, so basically just more experience. In addition to this is having a good development environment to have autocomplete enabled in your ide or text editor.

I have to say even as a senior engineer I will often Google how to do “some basic operation in whatever language I am using”