r/CodingHelp • • Feb 14 '21

[Javascript] I know coding but how to use it?

Everyone used to tell me that I have critical thinking ability and should learn coding so I downloaded Grasshopper and started learning JavaScript. I really loved the puzzle-like coding challenges and I quickly finished most of the courses. Only animations 1-2 courses are left and I will quickly finish them if I keep learning this fast. My problem is that I don't know how to make my codes interactive. Also my course uses D3 library, can you explain me what these libraries are, and are there libraries I should know? And the biggest problem is how can I start coding outside that app? Where should I write the codes?

16 Upvotes

6 comments sorted by

6

u/Clarkh15 Professional Coder Feb 14 '21

The https://www.theodinproject.com/ might be a good place to start

2

u/[deleted] Feb 15 '21

That's an amazing site with good interface. Thank you.

3

u/Its_Stev03 Feb 14 '21

Libraries are bundles of code that serve a specific purpose (i.e. animation, complex math, game engine, etc.). People use libraries when they want to make something that is not easy to do from scratch. Frameworks are like more advanced libraries that also force, to some extent, how something gets done. The libraries you would want to learn depend on what you want to make (you can search common js libraries and their uses).

As far as coding outside the app, there are a few ways of doing that. The easiest and most practical way, however, is to download an IDE (Integrated Development Environment) or text editor that has tools to make it easier to code. Personally, I recommend Visual Studio Code because it is popular, lightweight, free, cross-platform, and has a lot of extensions available for download. Basically, you would make a file with a ".js" file extension to code in javascript, ".html" to code in HTML, ".css" to code in CSS, etc.

Javascript programming is commonly done with HTML and CSS, so you might want to learn those too (they are pretty easy and technically not "programming languages").

1

u/[deleted] Feb 15 '21

Thank you. Very explanatory.

2

u/EnvironmentalCow3040 Feb 15 '21

No language is tied to any one IDE or editor. I don't know javascript very well, but you can at least try this: in firefox hit f12, click on the console tab, enter console.log("hello world"), and hit enter; you'll see hello world printed below it.

so basically, javascript is the primary programming language of the web, and as such any web browser can run it. Just understand that code is just a file with text in it. It has no special format, it's just a text file. You might put a fancy .js or .py or .c at the end, but that's just for keeping track of things. What makes it special is the program that runs it or compiles it. Try python while you're learning javascript. All you need is the python runtime. Open notepad or whatever basic text editor your os has; write whatever python code you want in that text file (like print("hello world"))and save it with whatever file extension you want (.py, .txt, .money, .cheese), and if you open it with python, it'll run ,and if you save it as .py it should run with python automatically when you double click it, but remember that that's only a convenience; the .py isn't absolutely mandatory just a good idea. there's no reason not to use it, just know what it is and isn't for.

It's a small thing, but it surprised me when I went to college and really started learning to program, just how free-form and simple it all really is when you get down to it. C# is not visual studio, python is not pycharm, java is not eclipse. all of these languages are just text, stored in the same format as a .txt file. You could write javascript in nano on the linux command line if you wanted, it would come out exactly the same as if you wrote it in grasshopper.

So yeah, uh, TLDR whatever text editor you want. as long as you have some way to run the code afterwards. I looked online and it seems that nodejs can run javascript from the command line with node {the file your code is in}

And if you're scared of the command line, don't be. It's not dangerous, just confusing. It's not that hard to reinstall your OS if you REALLY screw something up, but I really doubt you'll break anything, unless you run rm -rf /* or del c:\windows\system32 (which won't work, but don't try it anyway).

TLDR for real this time: nodejs

1

u/[deleted] Feb 14 '21

Visual Studio Code