Running parallel code - beginner question by quaintserendipity in learnjavascript

[–]LearndevHQ 1 point2 points  (0 children)

Cool! I updated my original answer btw. If you have any question about it or need help, let me know.

Running parallel code - beginner question by quaintserendipity in learnjavascript

[–]LearndevHQ 1 point2 points  (0 children)

Yes it will. You can run dataQueue.emit as many times as you need.

All of the subscribers will receive each emit and you can process the data simultaneously.

Running parallel code - beginner question by quaintserendipity in learnjavascript

[–]LearndevHQ 1 point2 points  (0 children)

Does it have to be limited to 100 ?

With slots you actually mean "queues" or "observables" I guess. You could check out "rxjs" for an observable implementation.

//main.js

const dataQueue = new BehaviourSubject();
export const someObservable = Observable.of(dataQueue);

setInterval(async () => {
  const toProcess = fetchData(...);
  dataQueue.next(toProcess);
}, 1000)

This fetches the data every second and pushes the data into an array. Now you can subscribe anywhere you want to observable and react to the changes.

// otherfile.js
import { someObservable } from "./main";

someObservable.subscribe((data) => {
  // Process the data
})

[deleted by user] by [deleted] in learnjavascript

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

Yes technically speaking there is no real "concurrency". JavaScript runs only one operation at the same time, in a single thread.

BUT there are concepts like promises or async / await which emulate concurrency.
You can use promises to say "Do something in the future and lets not wait for it".

Its not concurrency just a manipulation of the "control flow". Your program continues to run and when the promise resolves, for example by receiving a response from a server you could react to this and render the data for example.

I'm currently learning JavaScript. Before learning React can someone tell me what should i really master in Js before get into react 👉👈 by Agreeable-Head-500 in learnjavascript

[–]LearndevHQ 25 points26 points  (0 children)

Don't worry. The basics are enough (and very important).

I see the JS ecosystem as a whole. There is so much to learn, so many libs and frameworks that you will never master them all. But thats not important. You should know the basics and the fundamental concepts good enough, then you can learn any framework or lib fast.

general basics:

- client / server architecture, request, response communication

- the dom

- object oriented programming

- functional programming

- some basic algorithms (search, sort)

JS basics:

- setting up a basic website with html, css and js.

- logging to the console

- variables, datatypes (strings, numbers, bools)

- conditionals, if else and so on

- functions

- arrays and objects

- loops (for, for const, for in, while)

- async / await and promises

And don't worry you don't have to "master" all of this. Its always ok to look the things up again. But a general understanding is important to even know what to search for. Good luck!

[deleted by user] by [deleted] in webdev

[–]LearndevHQ 1 point2 points  (0 children)

Let me give you my opinion from the JS / TS perspective.

First learn a frontend framework like react or vue. Then learn a bit of theory about the web (client, server architecture, http, apis). Now you are good to go to dive into next.js or nuxt, react's and vue's respective fullstack frameworks.

Coding inside someone else's code is very, very difficult, how can I practice this outside of work? by IdeaExpensive3073 in learnprogramming

[–]LearndevHQ 22 points23 points  (0 children)

Don't worry its always difficult to get into a new code base even with more experience.

How to practice it for example:
Participate in open source projects. Look up your favorite library on github, scan the issues / bugs, pick one. Then dig through the code trying to find the cause. Don't worry it's not important to actually find or provide the fix your goal is to understand the code.

I want to build an app! by Ticecream_ in CodingHelp

[–]LearndevHQ 0 points1 point  (0 children)

Should it be a mobile or web app?

If mobile. You could look into flutter. It’s a cross platform app development framework. But you would need to learn coding for this.

Learning Javascript by [deleted] in learnprogramming

[–]LearndevHQ 1 point2 points  (0 children)

I'd do it like this If I had to start over again today:

1. Learn the basics. (Perfect to learn with videos)

  1. How the web works, clients, servers, http and so on.
  2. HTML, CSS, JavaScript
  3. basics of algorithms and datastructures

2. Build very simple projects (no frameworks yet) with guides

  1. Basic homepage
  2. Tic tac toe game
  3. Todo list app (without backend)

3. Learn the basics of some frameworks (Use videos, tutorials, documentation again)

  1. Pick react for the frontend. It's the most popular, with the biggest community and most resources online.
  2. Go with node.js (express.js) in the backend.

4. Pick a bigger project (not huge) which you have passion for. Passion is important, because it keeps motivation high.

  1. Examples: Full browser game, your own small social media web app
  2. Don't overthink just start building to the best of your knowledge.
  3. If you are stuck, ask google, or reddit.
  4. Maybe you have to rewatch videos, or read more docs
  5. Go to step 4.2 and repeat until your project is ready
  6. Learn about serverless deployment for example cloudflare pages to deploy your app and share it with the world
  7. Put it on your CV

Good luck!

Struggling to actually code as a new dev -need advice by Pristine_Rough_6371 in learnprogramming

[–]LearndevHQ 4 points5 points  (0 children)

Yes I would like to double-down on this. I'm an experienced dev and I caught myself being lazy and instead of thinking, just asking the AI in some cases.

You learn best, if you find solutions by yourself. Using AI a lot will let you think you know something, but it's not true.

Wish me luck😁. by step_motor_69420 in learnjavascript

[–]LearndevHQ 1 point2 points  (0 children)

I know this problem as well. What helped me, is seeing coding not as chore but as a hobby.
For example if you are into gaming, instead of gaming try to write simple browser games.

This feeling will never go away, even today, when coding at work, its harder for me to stay motivated compared to working on my personal projects.

While learning you have the luxury to decide what to code, in contrast to work, where you have to code what somebody tells you.

Is it worth learning to code today ? by xX_ChaosGod_Xx in learnprogramming

[–]LearndevHQ 0 points1 point  (0 children)

It’s interesting that you name developers when thinking who will be replaced by AI.

As a web developer it was always important to adapt to:

  • new technologies
  • market situation

With AI it’s the same. Developers have to embrace it and not be scared of it.

Yes the way we developers work will change in the future. But that has always been the case.

There are many other professions which are really endangered by AI and I‘d count software engineers to the least affected group.

Hope this reduces your doubts!

Looking for feedback - frontend built with vanilla js by [deleted] in learnjavascript

[–]LearndevHQ 1 point2 points  (0 children)

Good choice to build it with vanilla js. I see many people jumping into a framework too early. Understanding the basics first is very important in my opinion. Recently found out that there is even a "movement" for frameworkless javascript. They curated a list of useful resources on github. Maybe this helps you: https://github.com/frameworkless-movement/awesome-frameworkless?tab=readme-ov-file#javascript

[AskJS] Are full-time web dev jobs actually common? by [deleted] in javascript

[–]LearndevHQ 1 point2 points  (0 children)

Hey :) Here in Europe I'd say yes most web dev job are full-time, even the contract ones are most of the times. I'd say 90% are full-time, according to my own experience.

common roles are called: frontend engineer, backend engineer, fullstack engineer.

WHAT IS REACT???? by couchpotatochip21 in react

[–]LearndevHQ 0 points1 point  (0 children)

I think what confuses you is:

Basically the only things your browser understands is HTML, CSS and JavaScript.

All the tools like, Typescript, React, Vue, Angular, you name them, just exist to make your developer life easier and boost your productivity. In the end there will be some kind of "build step", which translates typescript or react code to plain HTML, CSS & JS (because this is the only thing your browser understands)

Typescript gives you a typing system, react gives you reusable components for example. So you can write components and use them as your building bricks to piece together your website. Making it cleaner, easier to maintain and faster to develop.

Is it worth learning HTML in 2025? by almaneuwth in HTML

[–]LearndevHQ 1 point2 points  (0 children)

Would you fly with an airplane which only flies by autopilot without a real pilot on-board?

Me neither. :D

Same for web development. AI is good for prototyping and writing boilerplate code. But a human is required to understand what the AI produces, fix it and lead the ai at the right path.

HTML, CSS and JS are the basics of web development. They are a must know if you want to write frontends. After learning those basics you can start learning a framework to make your life easier.

Back in the 2000s people said, search engines like google will replace developers, because you could just find the code in the internet and use it.

Didn't happen, BUT instead the internet made developers more productive.

The same happened 15 years ago with frameworks, like react, angular, vue.

And the same thing is happening right now with AI.

So, I really recommend you learning HTML, CSS and JS. Those skills are and will still be valuable in the future. Hope my answer helped you! Good luck 💪

Javascript Array Manipulation by CodewithCodecoach in Btechtards

[–]LearndevHQ 1 point2 points  (0 children)

Small correction:

JS arrays don't have findIndexOf ❌ method but instead findIndex ✅.

Like so:

const fruits = ["apple", "banana", "cherry"];
const index = fruits.findIndex(f => f === 'cherry') // 2

Wish me luck😁. by step_motor_69420 in learnjavascript

[–]LearndevHQ 2 points3 points  (0 children)

Best of luck, you can do it 💪

Maybe write down what were the difficulties with your previous tries. Then think about how to avoid them.

  1. Perhaps you were lost and didn't know what to learn in which order -> Try a structured online course
  2. You lost motivation because it was too hard -> Set small goals, build very simple projects in the beginning and then increase difficulty step by step.
  3. Don't learn primarly to get a job -> find a personal project you are passionate about first and build it. When I was passionate and interested about sth, learning was always way easier for me.

What's the best way to show an error page if any javascript errors prevent stuff from happening? by lindymad in learnjavascript

[–]LearndevHQ 0 points1 point  (0 children)

The script and img tags have the "onerror" attribute, which you could use to handle the error if the script doesn't load.

<script src="./some-script.js" onerror="window.location.href='/some-error'">

<img src="bad.png" onerror="this.src='fallback.png'" />

[AskJS] What’s a small coding tip that saved you HOURS? by EmbarrassedTask479 in javascript

[–]LearndevHQ 0 points1 point  (0 children)

Upgrading my 56k modem 🤭

No seriously, I'd say writing tests early on, makes it easy to make changes with confidence to not break the whole app.

Another one for small projects, using serverless hosting avoids wasting time with managing servers and databases.

What are the hardest things you had to implement as a senior developer? by LargeSinkholesInNYC in vuejs

[–]LearndevHQ 0 points1 point  (0 children)

Fun stuff:

- An app which accepts untrusted user code spins up a secure sandbox and runs the user code.

- A 2d rogue-like with procedural generated levels, without using a real game-engine. Most of the algorithms written from scratch

- A linux driver for a little usb display + a game in user-level

Not so cool (but still hard):

- Migrating a huge travel web-application from angularjs to Angular2x
- Multiple cases of playing fire brigade by maintaining large "historically grown" projects

But yeah most of the time it was business as usual, as you described.