Teaching Python is good, but what about Javascript?

You’re reading this post in a web browser. The developer of this site laid out the page with HTML, specified its style with CSS, and made the page interactive with Javascript. You can make the Google Docs, Linkedin, Github, and ChatGPT apps all with just those three languages. Typically, the bulk of the work in creating an application for the web is writing the Javascript, as handling user interactions is more complex than coding the visual layout.

What’s Python used for? Python's primary use by professionals is in data science and analytics. There are many Python packages (bundles of pre-built code) for performing statistical analysis, and these days, machine learning and AI modeling. There are also ways to make games or interactive graphical apps, but they are substantially less popular.

So, which of these languages is better for beginners? As with any technical decision, there are tradeoffs!

Javascript 

Pros

  • Code can run in any web browser without installing additional software. Projects are cheap to run and easy to share on any device.
  • Almost everything you create has a visual or interactive component, and there are a ton of packages online that can help with creating more complicated apps or games.

Cons

  • A functioning Javascript app in the browser requires also writing an HTML file, which is code in an entirely separate programming language.
  • The language has some bad “interesting” design decisions that can drive programming people a bit crazy. Probably the most famous example is that Javascript has an assignment operator (=), an equality operator (==), and the strict equality operator (===).

Python

Pros

  • Python syntax is widely considered to be rather easy to read for beginners.
  • You can create a functioning Python program in just a single line of code.

Cons

  • Python is annoying to install on your computer, and sites that let you run Python in the browser (like Pickcode!) come with their own limitations. This makes publishing or sharing your code with others pretty difficult.
  • Installing Python packages typically requires using tools called package managers (pip, Conda, etc.) that are notoriously difficult to set up. In-browser solutions probably have limited package support, especially when it comes to graphics.

How Pickcode Helps

At Pickcode, we’re happy to help you write code in either Python or Javascript (or Java, if that's your thing). Python is more popular with our early users, so we’ve focused a lot of our efforts there. We don’t support every popular Python package, but we’re working on it!

On the Javascript side, we’ve had a lot of fun as of late experimenting with making projects with different libraries like p5.js and three.js. This summer, we plan on publishing several short courses on making graphical programs with Javascript.

Here are links to a couple of example Javascript programs running in Pickcode. They’re interactive!

What about Pickcode VL?

Pickcode VL (visual language) is our experimental answer to the Javascript vs Python debate for beginners. VL is a version of Javascript with simplified syntax that looks a bit like Python, and simplifies some of the frustrations that developers have with Javascript. Here’s a snippet of VL code that adds the numbers between one and ten and shows it in the console.

VL code for summing numbers from 1 to 10.
VL code for summing numbers from 1 to 10. That 11 is actually a bit of a Python thing

Right now, the only way to write VL is in our structured code editor, where you add code using menus and the mouse (we do this to help students transitioning away from block coding environments like Scratch). In the future, we’ll allow users to write VL code in a regular text editor. With VL, we also include the following libraries for beginners:

  • Chat: make interactive chatbots that show typing animations and can send images
  • Paint: make animated visual designs, like you would with Python turtle
  • Game: make simple 2D games, like our version of Cookie Clicker (try the lesson here, it's been completed over 100,000 times on Hour of Code)

One great thing about VL is that the libraries we're developing can also be used with Python and Javascript with a little more work on our end. In our perfect world, students would get started programming with VL, and then be comfortable transitioning to Python or Javascript, whichever they'd prefer.

Our mission

We don’t really care what language people choose to use! Our goal at Pickcode is to lower the barrier to entry for students to get excited about computer science. That’s a big goal to tackle, and there probably isn’t a one size fits all solution. Our plan is to give teachers and students a wide array of tools and curriculum content, and together we can learn what works best. So far, students have pressed the big green run button in our code editor 2.5 million times, and we’d like to see that number get as high as possible. (can anyone say billion??)

Read more