🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Most quick/modern/worthwhile way to learn JavaScript

Started by
32 comments, last by 8Observer8 3 years, 6 months ago

I am a beginner level programmer in C++. I have completed some projects. I also have worked with Java and PHP and SignalR. I've done a bit with JQuery.

My last project for experience is an ecommerce site using JavaScript.

What would be the quickest/most worthwhile/most modern way to go about this. Should I study jQuery a bit. How about the older JavaScript, can I use that? And the database SQL or NOSQL? Any other libraries I should learn?

Thanks a million,

Josh

Advertisement

lucymer001 said:
while her Instagram post overall has received more than 396,840 likes

Sounds better to say almost 400,000 likes instead. Of course you would know that if you wasn't a turd.

🙂🙂🙂🙂🙂<←The tone posse, ready for action.

From my experience, jQuery isn't used anymore, at least from those companies I worked with. They currently set on TypeScript (Microsoft's Javascript derivate). As for all cases, it depends! For mobile Apps you may want to go for NodeJS and Angular, if you want to write a Desktop Web App, NodeJS and Electron is your way to go for example. If you want to pair your Web App with some C#, I can suggest Electron Edge (JS) or one of it's Forks. There are also some Javascript HTML5 Web Engines out there and C++ might work as well using Web Assembly.

Josheir said:
What would be the quickest/most worthwhile … way

Get a project and do something ¯\_(ツ)_/¯

Since this is gamedev.net I will need to point out this should be game-related…

But okay, let's just make it programming related, I guess it's good enough.

I have been advocating for years by now, consider JS, PHP, Jquery… dead in the water. I said it. Whaaat?

The point isn't whatever JS exists or not. Or if the browser runs it or not. The point is if it is viable. React/Angular/Vue make Jquery look like the stone age. Don't even get me started on nodejs/typescript. Be warned none of this is relevant for game development as they all miss the mark by several orders of magnitude in performance. Even webassembly believe it or not is over twice as slow as native.

But… if you want to deliver web apps, I would suggest looking look into other sites as well. I know several dudes around here mangle web tech but you sure would be getting more feedback.

I would suggest to drop the ball on JS and go fully Typescript/Angular. Your mileage will vary.

Previously "Krohm"

Do not study jQuery because you will spend your time. Study JavaScript with practice. Use “let/const” from ES6 instead of “var”. Use arrow-function: (…) => {}. Later you can start TypeScript if you want. Study HTML5/CSS3 for game GUI. Just write small games. You can draw primitives using Canvas API. Start with this tutorial: 2D breakout game using pure JavaScript Learn WebGL and GLSL because writing shaders is very useful for 2D/3D games. One of the best book for beginners is: WebGL Programming Guide

W3SCHOOLS is magic. Tada: https://www.w3schools.com/js/DEFAULT.asp

taby said:

W3SCHOOLS is magic. Tada: https://www.w3schools.com/js/DEFAULT.asp

Not trying to encourage a flamewar here, and I admit that w3schools has improved a bit and also offers a nice variety of code snippets.
But surely you don't think it ever holds a candle to MDN when it comes to js: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide

This book is game oriented: JavaScript for Kids: A Playful Introduction to Programming

SuperVGA said:

taby said:

W3SCHOOLS is magic. Tada: https://www.w3schools.com/js/DEFAULT.asp

Not trying to encourage a flamewar here, and I admit that w3schools has improved a bit and also offers a nice variety of code snippets.
But surely you don't think it ever holds a candle to MDN when it comes to js: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide

It's all good. ?

Josheir said:
I also have worked with Java and PHP and SignalR

I learned SignalR a little. It is for C# ASP.NET. Take WebSockets and Node.js/Express. You will have JavaScript only. See it is simple to connect a server and a client. Place this files in one directory like this:

my-game
---public/index.html
---app.js

  • Install Node.js and “nodemon” (npm i nodemon -g)
  • Go to “my-game” and run: nodemon app.js
  • Open a browser tab and type: localhost:3000
  • Open a browser console: Ctrl+Shift+J and you will see “connection”

app.js (Server)

const express = require("express");
const http = require("http");
const ws = require("ws");
const path = require("path");
 
const app = express();
app.use(express.static(path.join(__dirname, "./public")));
app.get("/", (req, res) => { res.sendFile(path.join(__dirname, "index.html")) });
 
const httpServer = http.createServer(app);
const wss = new ws.Server({ server: httpServer });
wss.on("connection", (wss) => { console.log("connected") });
 
const port = process.env.PORT || 3000;
httpServer.listen(port, () => { console.log("Server started. Port: ", port) });

public/index.html (Client)

<!DOCTYPE html>
<html lang="en">
 
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
 
<body>
    <h1>Hello</h1>
    <script>
        const ws = new WebSocket("ws://localhost:3000");
        ws.onopen =
            () => {
                console.log("connected");
            }
    </script>
</body>
 
</html>

This topic is closed to new replies.

Advertisement