News for hackers. Stuff that matters.
Re:Web Development for Beginners – A Curriculum by userbinator on Sunday May 08, 2022 @02:34AM (#31301851)
about JavaScript, CSS, and HTML basics

...and this is where it goes off the rails; teaching JS before HTML is how we will continue to have the ridiculous proliferation of app-sites that shouldn't require a single line of JS instead needing the latest version of $browser (you have a choice of browser - pick one ...) to even show any content at all. Forms don't need any JS to work, yet the impression this gives to beginners is that they do.

https://news.ycombinator.com/item?id=25915313

But then again, this is Microsoft, which is now firmly in bed with Google in contributing to the Big Browser monopoly, so I suppose I shouldn't have expected anything else. The agenda is obvious to anyone who cares to look.

Re:Web Development for Beginners – A Curriculum by KronisLV on Sunday May 08, 2022 @03:33AM (#31302036)
> The agenda is obvious to anyone who cares to look.

Alternatively: it's just teaching whatever is popular in the industry, for better or worse (similarly to how DevOps people would be taught Kubernetes, even if it can be horrible in certain cases and for smaller projects).

Many sites out there don't need JS. Server side rendering would suffice. And many other sites out there would be well served with minimal JS for enriching a few forms.

Yet, that's not the reality that we live in. The reality is that the majority of the developers out there will simply have to deal with lots of JavaScript, TypeScript and frameworks like Vue, React, Angular (i'm using the term "framework" here because they change the entire direction of the development of your front end, not that it matters at all).

So, that's what curriculums will focus on, since clearly people want to have good employment prospects. It doesn't seem like the linked one gets too caught up with the frameworks, though.

Re:Web Development for Beginners – A Curriculum by atoav on Sunday May 08, 2022 @06:36AM (#31302857)
I teach that kind of stuff at university — I would never think about teaching JS before HTML and CSS. Students should understand what ia possible with HTML and CSS alone. Then we look at the server side, and understand infrastructure and how servers can potentially deliver different HTML and CSS depending on the request and then we start introducing JS as a means to replace serverside stuff, to enrich HTNL and CSS or to interact with REST APIs without reloading the page etc.

But understanding the infrastructure is key here. Understanding the "M" in HTML, understanding the "C" in CSS, understanding http etc.

Re:Web Development for Beginners – A Curriculum by mrslave on Sunday May 08, 2022 @09:10AM (#31303685)
I am trying to finally learn what's going on in the web browser and my biggest hurdle has been CSS. I can read & write rules but the questions are really, which rules and under what circumstances? That plus the different layouts (grid, FlexBox, etc. -- terminology almost certainly wrong, sorry!). Can you please recommend a good resource for learning CSS & layouts?
Re:Web Development for Beginners – A Curriculum by chrisweekly on Sunday May 08, 2022 @10:48AM (#31304558)
https://every-layout.dev is amazing, and teaches foundations and builds up from first principles.
Re:Web Development for Beginners – A Curriculum by cookie_monsta on Sunday May 08, 2022 @09:48AM (#31303933)
Maybe too lightweight for your liking, but these helped me get my head around grid and flexbox:

https://cssgridgarden.com/

https://flexboxfroggy.com/

Re:Web Development for Beginners – A Curriculum by hoofhearted on Sunday May 08, 2022 @10:06AM (#31304089)
Come on now! You must be overcomplicating things if you are having challenges digesting CSS. Cascading Style Sheets are probably the easiest thing to comprehend on the frontend.

Team Treehouse is a great resource for learning frontend and backend stuff.

Re:Web Development for Beginners – A Curriculum by danielovichdk on Sunday May 08, 2022 @10:45AM (#31304530)
How do you center an image on the screen, both on desktop and mobile ?

Like every other aspect of programming, there are multiple answers to this.

So I think it's a valid concern

Re:Web Development for Beginners – A Curriculum by dgb23 on Sunday May 08, 2022 @03:41AM (#31302065)
But to master JS tools you want rock solid fundamentals and know about default behavior, writing clean HTML and CSS. I even teach more about networking and HTTP than JS. They actually want to know: what happens when I type an url into the browser?
Re:Web Development for Beginners – A Curriculum by serial_dev on Sunday May 08, 2022 @04:17AM (#31302225)
While I agree with you that knowing the basics is obviously helpful and desired, in the end what gets you your first job isn't "what happens when I type a URL into the browser".

What gets you your first job is you knowing how to use the tools that the companies already use to ship software solutions on the web. If they use react, webpack, graphql, then your best bet at getting your first job is learning enough about those to be productive in a couple of days at the company, and not what happens after you hit enter in the URL bar.

95% of my work as a regular web/mobile dev was about being able to fetch some data, massage it, display it, then handle user interactions to send something back to the server. Some software dev jobs are more complicated than that, but to be honest, most of what we do it not rocket science.

Once you get your first job, you can work "backwards", and learn the basics. This approach also helps you learn what is important as you see it firsthand that it's important. Your team is there to help you learn, you earn money in the process, you make your customers' life easier, and you build your portfolio and gain experience to get your next job (that will hopefully be more challenging than a CRUD app).

I'm not saying that it's great that you learn the tools before the basics, I'm just saying it makes sense if you want to get a job and pay your bills (and set yourself up for long term success as you learn on someone else's dime.

Re:Web Development for Beginners – A Curriculum by dgb23 on Sunday May 08, 2022 @07:10AM (#31303025)
Have we misunderstood each other? I'm talking about teaching web fundamentals to absolute beginners, not people who are already programmers or CS graduates. In terms of content think starting with something of this scope: https://developer.mozilla.org/en-US/docs/Learn/Getting_start... and then building on that.

The fundamentals are clearer and more accessible to teach than frameworks. This inspires confidence and I'm pretty sure you won't save any time if you jump ahead and teach React and especially Graphql. You have a _way_ better foundation to learn and use React if you know HTML, CSS, JS, HTTP that I mentioned but also browser dev tools and I would even put git before that. Also people who are already professionals in some field close to web dev will ask fundamental questions, they want to understand things.

Learning framework X is a piece of cake if you at least roughly understand how it works and aren't on completely shaky grounds, and when framework Y comes along you can ask the right questions right away.

The _vast_ majority of web development doesn't use React or Graphql anyway. I don't even know a single dev who knows React and Graphql but cannot make a website without them or doesn't know what DNS is, what common HTTP headers mean or don't know how to center a div.

Re:Web Development for Beginners – A Curriculum by solarengineer on Sunday May 08, 2022 @07:19AM (#31303065)
I have worked with people who are "fullstack" with Javascript + Typescript, but do not even know what a CPU core is.

Some are even amazed that a basic HTML page can be created with a plain text editor.

Such people are "ReactJS" specialists, not even Javascript/Typescript specialists. One cannot easily engage in a conversation on types with them - not that they are negative or close-minded, but such concepts are in the "unknown unknowns" for them.

Nope. Knowing the fundamentals does not take all that very long and can in fact go a long way in enabling someone to pick up newer technology.

Re:Web Development for Beginners – A Curriculum by KronisLV on Monday May 09, 2022 @02:27AM (#31311217)
> I have worked with people who are "fullstack" with Javascript + Typescript, but do not even know what a CPU core is.

Now, this is the opposite of the point that you're making, but i have to admit that it's pretty cool on some morbid level! The fact that we have abstractions that are strong enough for them not to leak and make people dig into the details (e.g. the JS event loop being all that they need to think about).

That's also why tens of millions of people out there can work with spreadsheets of text processing software without knowing what a compiler or interpreter is, or even caring much about the benefits of dynamic linking vs static linking.

Similarly, i can write SQL against a DB without knowing anything about the RUM conjecture or really much about anything apart from the very basics of ACID (at least before Oracle fails to plan queries correctly and needs either statistics to be regenerated or hints added for the optimizer, because it's an evil piece of software).

It just works. I'd argue that it's the way things should be - working on the JVM should absolve one from thinking about compile targets and worrying about things like whether the CPU is from Intel or AMD, or what the ASM format is or whatever. Working in the browser might as well absolve one from worrying about most platform minutea as well, otherwise nothing would get done.

Is is still nice to have a bit of curiosity and explore those things, there being some merit to that, which might as well not be immediately apparent? Sure! Is it required for those people to truly be specialists in their own niche and to be safe from people making fun of their other shortcomings online? Absolutely not!

Re:Web Development for Beginners – A Curriculum by rzzzt on Sunday May 08, 2022 @04:55AM (#31302370)
To be fair, it is (was?) a typical interview question, so it does get you closer to a job if you know the answer.
Re:Web Development for Beginners – A Curriculum by blowski on Sunday May 08, 2022 @05:27AM (#31302505)
Indeed. An interview for a first job is not the place to rant on some pet peeve you've picked up via Hacker News.
Re:Web Development for Beginners – A Curriculum by DeathArrow on Sunday May 08, 2022 @04:03AM (#31302165)
>Many sites out there don't need JS. Server side rendering would suffice.

But many push towards single page apps even if a web site is better suited for the job. If you only have a hammer in your toolbox...

Also, you can have SPAs without Javascript, you can use any language / framework that targets Web Assembly. I enjoy Blazor for SPA.

Re:Web Development for Beginners – A Curriculum by xigoi on Sunday May 08, 2022 @01:56PM (#31306366)
How do you use WebAssembly without JavaScript? I thought it still requires glue code in order to access the DOM.
Re:Web Development for Beginners – A Curriculum by bhobs on Sunday May 08, 2022 @04:56AM (#31302376)
This view that you don’t need JS and can do most things natively is tired and screams of old timers trying to cling on to the past, when web pages didn’t have rich user interactions and good UX. Sure, you can build forms that perform full page refreshes, but ajax requests offer a better user experience.
Re:Web Development for Beginners – A Curriculum by uallo on Sunday May 08, 2022 @05:31AM (#31302526)
Native dropdowns have much (much!) better UX and accessibility than most custom dropdowns built with JavaScript. Same goes for native form validation. And there are many more examples. Using JavaScript does not necessarily improve UX.

Use the platform where it makes sense. Extend it with JavaScript where needed. Make it work for everybody and make it better for capable browsers. That is called progressive enhancement. OP did not say that you may never use JavaScript. Just be mindful about it when you do.

Re:Web Development for Beginners – A Curriculum by amelius on Sunday May 08, 2022 @07:36AM (#31303142)
You can say the same about computers in general. No computer is preferable over having to use one.
Re:Web Development for Beginners – A Curriculum by krono on Sunday May 08, 2022 @06:25AM (#31302803)
When someone has just barely crossed the "hello world" stage, I don't think they should be thinking about asynchronous XHR requests, or be pulling up user experience research to find the optimal shade of red for making input validation errors appear less aggressive to middle aged women with a bachelor degree in communications who are part-time employed in marketing.

Let's start with getting data from the form to your back-end, and once we've got those must-have basics down, then we can start introducing the nice-to-have bits.

Re:Web Development for Beginners – A Curriculum by bigDinosaur on Sunday May 08, 2022 @09:24AM (#31303761)
I consistently have a more pleasant time with the well-designed, minimal JS websites (which are now a rarity) than even the better designed websites which heavily use JS. And my job is allegedly to 'improve' the internet with more JS.
Re:Web Development for Beginners – A Curriculum by chrisweekly on Sunday May 08, 2022 @10:51AM (#31304596)
See https://remix.run for a clear demonstration of "best of both worlds".
Re:Web Development for Beginners – A Curriculum by legopeice on Sunday May 08, 2022 @07:38AM (#31303153)
Please could you inform me how you would build a form that creates, lets say a secondary loan for a company with attached assets. The assets could be zero, or many.

How would you create this form without Javascript? Would you require a user to create the assets before the loan?

Saying that HTML provides everything a developer needs to provide an application to client is so ridiculous, I have no idea why this sentiment is so popular. the vitriol expressed for front end devs from the community seems out of place.

Forms work without JS for the most basic baby forms. the moment you go enterprise, more is needed. which is where JS steps in, What am I missing here?

Re:Web Development for Beginners – A Curriculum by e12e on Sunday May 08, 2022 @08:44AM (#31303522)
You would make multiple form, and track state on the server side (user createdvempty/wip loan, user added assets, user reviewed and confirm loan). Probably share state between client and server via a session token (cookie). Optionally share some state via REST - eg loan ID and asset IDs in path).

That said - complex forms is a typical example of when you might want to move from a web "page" to an "app".

Re:Web Development for Beginners – A Curriculum by legopeice on Sunday May 08, 2022 @09:07AM (#31303670)
Share state? I disagree heavily. There is no reason for the backend to know how many assets a user is trying to add to a loan, or delete, or accidentally load, or add but realize mid-way that it doesn't apply.

Do you belive the backend should know about human incorrect input and track state?

What if a cat steps on a keyboard? every addition to a form is a page reload and a query to the server. then the server sends a response. Which is exactly the bloat everyone seems to go on about.

Im sorry but living in a world of enterprise apps, the sentiment that JS is a poor language and a bad choice is both out of place and highly de-coupled from real-world usage.

Re:Web Development for Beginners – A Curriculum by e12e on Sunday May 08, 2022 @09:38AM (#31303851)
You need to share state. You might only store finished loan applications server side, but often it's nice to allow a user to pick up where they left off. Or keep a list of started, not finished applications, to hand over to sales. Etc.

But sure, application state might not go in the same db/schema as completed transactions.

Re:Web Development for Beginners – A Curriculum by legopeice on Sunday May 08, 2022 @10:14AM (#31304168)
Seems like a pretty good place for the browser and JS to step in? unless you want a DB full of application_partial tables?
Re:Web Development for Beginners – A Curriculum by e12e on Sunday May 08, 2022 @10:49AM (#31304571)
Well, if you want to allow users to resume sessions from desktop on laptop/phone/tablet - you need to store state somewhere else.

But there are different levels of state: completed transactions (application finished and submitted), partial business logic transactions (three out of five steps completed) and "app state" (field 6 of form 4 partially filled in etc).

They can all be kept diffently in sync (in sync, because the browser will keep partial state via native widgets if nothing else). Even w3m keeps track of inputs in forms before submission.

Re:Web Development for Beginners – A Curriculum by legopeice on Sunday May 08, 2022 @04:09PM (#31307688)
Seems we are having a different discussion now about shared state instead of whether JS is necessary and capable. Over used. definitely. Obsolete and to be derided at every turn. absolutely not.
Re:Web Development for Beginners – A Curriculum by e12e on Monday May 09, 2022 @07:38AM (#31312917)
The initial question (how would you create a form for handling creating multiple dependent resources without using js) - is inherently about various types of state - and if/how to share them between the client and the server.

As I mentioned, I think complex business flows like these can be a great reason to go from "web page" to "web app" - precisely because it enables rich, ephemeral client state with (some) business rules close to the client.

But that doesn't mean you can't do powerful things with just html/http and some form of continuations etc on the back-end.

Re:Web Development for Beginners – A Curriculum by Peritract on Sunday May 08, 2022 @09:02AM (#31303627)
> the moment you go enterprise, more is needed.

If you're employed, working at scale and need to do the complicated stuff, you're not a beginner web developer anymore. At that point, you should already understand the fundamentals and start extending on top of that.

Re:Web Development for Beginners – A Curriculum by legopeice on Sunday May 08, 2022 @09:10AM (#31303686)
Precisely. Good observation.
Re:Web Development for Beginners – A Curriculum by davidelettieri on Sunday May 08, 2022 @06:25AM (#31302806)
Looks like the first few lessons use Javascript to give an introduction to programming and not to web development in general. I don't see any agenda. Just teach programming on the language a web developer will happen to use later.
Re:Web Development for Beginners – A Curriculum by escape_goat on Sunday May 08, 2022 @10:48AM (#31304556)
If one wishes to teach web development, one teaches JavaScript. That's the end of the story.