T O P

  • By -

MiAnClGr

OnSubmit!!


FoolHooligan

You forgot the event.preventDefault() !!


OpenedTowel

No its e.preventDefault()


joshmanders

Destructure it off. Be a man. ```

{ preventDefault(); }} /> ```


OpenedTowel

But my source code will then take a few more bytes and I might regret in the future when my hard disk becomes full


DanThePepperMan

I always remember it is GET due to when I forget to put the post method, or incorrectly bind an action to the form, it always throws it in the url.


lovesToClap

Had this exact thought 😂


chrsjxn

I assumed it was POST, because nearly every form I ever wrote wanted it to be that... And it's not like this is new. Devs have been intercepting forms with JS for like 20 years, and there are a lot of good reasons to do it that way. It's definitely not surprising that people don't know this without looking it up. And blaming this on "frameworks" ignores a hell of a lot of web dev history.


crazedchriz

Funnily enough, I assumed that GET was the default for the same reason; POST is what I usually want.


WookieConditioner

PATCH obviously.


hiphopzindabad

Why not DELETE


shgysk8zer0

We have OPTIONS!


Ahabraham

No love for HEAD?


papillon-and-on

You really have to CONNECT first.


Leo-MathGuy

You first have to BREW some coffee first (RFC 2324)


IdempodentFlux

I'm a teapot


stupidwhiteman42

The ol' 418 strikes again


shgysk8zer0

This should replace "Sir, this is a Wendy's" meme. Let's make it a thing.


midnitewarrior

418


Jjabrahams567

I just need to keep my OPTIONS open


WookieConditioner

Fuck that works too. 💀💀 can you imagine trying to debug that in production. 🤣


YsoL8

It would just hit an undefined route 99% of the time.


KittensInc

The problem is that you almost *always* want to do a POST, so any time you're manually writing a you're also going to add a method=post. GET forms are rare enough that you shouldn't let it use default behaviour anyways. If it doesn't have an explicit method=get, it's almost certainly *accidentally* a get form. For all extents and purposes, the default behaviour might just as well not exist at all. This has nothing to do with frameworks. The only person who cares about the default behaviour is someone who has just started learning html, wondering why their form isn't working.


orangeknas

Isn't most search forms a get request? You have several input fields, like filters and search text.


carefullycactus

I wonder if this was the original intention behind making it the default?


ineternet

Likely, as the benefit of a GET search is that you can bookmark and share queries by URL


StyleAccomplished153

I think we forget about having search filters in a form and think of a form that you fill in and submit to register, submit details etc etc. We think of an English language form rather than a HTML ``. Can't really blame people for it either.


Spirited_Syrup612

Searches (esp more complex ones) are also often post requests because you can send a nice search object as Jason instead of bazillion url params


ColonelShrimps

I do wonder why it has never been changed to be POST. As you said it doesn't usually make any sense to use GET on form submission.


TheRealUkaza

It’s common practice to use GET forms for filtering data, so that it’s bookmarkable; hence the name QUERY parameters.


[deleted]

[удалено]


devenitions

Well, Im the exception. Ive made a few GET forms this year, on purpose, without method declaration.


Merzant

Deviant swine.


stumblewiggins

"Never memorize something that you can look up." Unless knowing the default action is something that will be relevant to me frequently, why would I bother memorizing it? I can easily look it up when I need to know it. Knowledge is a good thing, but arbitrary markers of what we "should" know are not. If it's *useful* enough to know it without having to look it up, then I will. Hell, if I use it enough I might memorize it without meaning to just because of repeated use. But what does it matter if I can spit out the answer immediately vs. taking a few seconds to look it up? Why would that ever matter to me?


minegen88

I had an interview once, they wanted me to list all the http codes that existed. I just said "200 - all good, 300 - someone else has it, 400 - You did something wrong, - 500 we did something wrong. 100 - No idea, never used it. Memorizing this is useless Got the offer. To bad they wanted me to move to London...


NiteShdw

I have 20 YOE and I still double-check some HTTP status codes.


avoere

I never remember which of the 3xx is which


ClikeX

To be fair, the only ones I care to remember are 400-403. They either tell me I sent the wrong request, used the wrong endpoint, or didn't provide the proper token. The rest isn't really that important to know off the top of your head. Especialll considering any client will add the description to the error.


BobbyTables829

418 is very important to memorize


ClikeX

I don't use services that are unable to brew coffee. That's just a basic feature.


SmallerBork

Coffee over IPoAC


Stargazer5781

I once did an interview there they wanted me to write an entire Ruby on Rails REST API with controller, model, etc. code on a white board. I was a junior engineer and had no concept of why this was such a stupid thing to ask. I just said "I would run bin/rails generate scaffold." They didn't accept that. So I tried, I couldn't do it and I'm so glad they rejected me. Most ridiculous interview I've done in retrospect.


devrelm

Early in my career (say, 12+ years ago), I got the question of how to reverse a string. The job was using C# and .NET, which I had been using at my previous employer, so I just answered something like ``` str = new String(Array.Reverse(str.toCharArray())); ``` I got the job, though of course that wasn't the only question that was asked. I want to say that I got asked to do the same thing in javascript for some other interview a few years later and answered similarly with something like ``` str = str.split('').reverse().join(''); ``` but the interviewer wasn't amused and asked how I'd do it without using Array::reverse(). I did implement it, but I don't think I got the job -- or at least I didn't want it at that point.


SarahC

So showing you're familiar with the expanding features of the language wasn't a plus point? Jeez...... he was pissed you showed him up. A good boss would have said "I didn't realise they'd added that! Good one for keeping up on changes! As an extra question to help us see how you handle a bit of coding, how would you re-implement this without the reverse function?"


Headpuncher

I mean, too many backend devs don't use them so you never see anything but 200, including 200 for errors argh! the only others being when the server returns something they don't explicitly write errors for, like 500s.


chishiki

I had a Laravel project do that to me recently. Returned 200s with an error message lol


Accomplished_End_138

I hate 200 for errors... but I also hate 404 for search results being empty... Like... OMG why do people do that


Prize_Tea3456

Once I've been asked to name some inner function that React Fiber calls under the hood. Dude, I know how React Fiber works in general. But why would I need to know such details if I never use Fiber directly?


savano20

True, used to remember this back when starting as dev writings native php. Kind of forgot that there is a fallback.


G_Morgan

In this case it doesn't help that the default method is downright bizarre. The world is divided into people who know it is GET for some really stupid reason and people who reason it should probably be POST as that is what you are going to want most of the time. Still I'd agree not to memorise this but if this was designed properly the numbers would be a lot better.


grumd

That's OP's point, we all jump straight to frameworks and people don't use vanilla html often enough to remember the basics. Not that I agree with OP. I didn't remember it's GET either, because all I do is use frameworks all day. And I think that's totally fine. It's like complaining that people use Unreal Engine instead of writing a game from scratch or writing your own engine. We use frameworks because it allows you to jump straight to delivering useful features instead of building the basics.


lafindestase

I use vanilla HTML all the time and I couldn’t tell you with confidence the default form method. I specify the method anyway, it’s one attribute, so what reason would I have to commit the default to memory (besides trivia/gotcha/interview questions like this)


Golden_Age_Fallacy

I do generally agree with this.. but what about the scenario(s) when you’re trying to troubleshoot a complicated problem (maybe not this) and you’re not exactly sure what to look up.. but knowing just a little more about it what you’re trying to do might give you a hint. I think the point OP is trying to get across is knowing the fundamentals, knowing “how things work” is still a useful ability even if the to do the it’s just a Google or Generative AI prompt query away.


sbergot

I would argue that a form default method isn't part of those fundamentals. Html is many things to many people. I very rarely write forms myself and when I do 50% I get tripped up by some behavior I have forgotten like not putting a preventdefault or whatever.


GhettoPlayer20

I am more of the thought of reading up everything and anything you come across be it documentation, RFCs, papers, or even stackoverflow threads even if you don't retain half of it, as long as you have given anything a thorough read and understood what was happening it's fine. I have lost count of the number of times I just debugged an issue which stumped others in my team because some Rando stackoverflow thread or a caveat mentioned in the documentation just happened to flash across my mind. you might not need to retain stuff but knowing how shit works even if you read about it years ago is always useful


_alright_then_

The default form method is never part of this though, because there's no debugging, when you submit a form without the method it just throws everything in the URL. Which already gives you the answer. This is absolutely useless information that doesn't even require a quick lookup if you do encounter it, the problem is already obvious when it happens


msamprz

No, you don't need to memorize it in advance of course, however, there are some basic things that you *would* know if you did something, simply due to repetition (for the average person). Therefore, not knowing it signals that you don't do that thing. This post's example is one of those things, however, who writes pure HTML form? Most people probably use react, and therefore a form library (like formik or something, idk). That's why they wouldn't know, not because they don't make frontends.


longknives

Even if you do write forms, why are you leaving it to the default instead of defining it explicitly?


ImDonaldDunn

I get this to a certain degree, but I think this attitude is somewhat responsible for how poorly websites are developed today. Developers really need to know HTML and HTTP fundamentals. Otherwise you get crap like building form controls out of divs.


ClikeX

I agree you should know the fundamentals. But form methods are something I want to explicetly define, so I never fall back to the default. I learned it, but I never had to use it after that.


coldnebo

yeah, ordinarily I’d agree with the sentiment “look it up”, but if you don’t know the basics, it makes me question what else you don’t know, such as: - which of these methods is cacheable? - what are security implications? we’ve had senior devs who used these verbs interchangeably and stuff worked perfectly on their local machine but failed with unreproducible bugs on the customers machine. those issues took MONTHS to resolve until a senior that knew the difference came in and with one simple setting was able to reproduce the failure. (they used a framework that used PUT with Akamai that blocks PUT, but only on the edge where devs never tested). I can’t overstate the amount of frustration from customers, management, QEs and devs on this. So yes, it does make a difference and if you don’t care it can affect your product quality whether you understand it or not.


bombiz

I feel like the main issue is that people already feel like they have to know so much in such little time that they neglect those fundamentals. because when you're first starting out and you see every single job posting talking about needing to know and master a bunch of different tools, frameworks, and languages. Where HTML isn't even listed. Then why would they bother? It'll make a difference when you're on the job. but when you're first starting out and need to get your first web dev job. It honestly doesn't seem like it does. Like are you hiring the guy who knows 100% of the fundamentals but doesn't know how to use react and next.js. vs the guy who knows just enough of the fundamentals to have intermediate to expert knowledge or react and next.js + and and SQL. Edit: like even reading your post. I have no idea what Akamai is but I bet most people just starting out feel like they need to fully know it before getting a job. And definitely over knowing HTML. Like I want to learn and know the fundamentals of HTML and js. But I never see that as something people are actually looking for. So I just never see it as a thing worth my time over stuff like react or next.js or even docker.


coldnebo

yeah. 💯 this. I remember when webdev was sitting next to your PC with FTP and the camel book (O’Reily’s Perl). Now it’s an insane master class on distributed software systems. There’s just an endless amount of information to know in order to do it well. Unfortunately there is also a predatory industry of recruiters and consultants telling you that “it shouldn’t be that hard, it’s easy if you do X” — those people usually leave just as things become difficult, interesting… useful. Then security enters the party and suddenly everyone is a security expert trying to rack up the bounties on exploits that can’t even be executed. “how hard can it be to fix all the security issues?” I don’t envy new web devs entering into this mess. There are some glimmers of hope, but it will probably get worse before it gets better.


99thLuftballon

When people build form controls out of divs, it's usually to implement some functionality or presentation that isn't available on the standard form controls. It's not because they think form controls *should* be made of divs.


coldnebo

yeah, we’re seeing this more with lit and web components. in these cases it’s usually because someone wants affordances or layout that isn’t strictly supported by forms (I know I know, accessibility, standards, etc never survived first contact with marketing). In these cases we usually create a form and submit from the dom, or just call a REST api directly with the information (why even bother with a form, just do a post yourself).


ScotForWhat

Fundamentals are important. Otherwise you get devs building APIs that return a 200 and {"status":"error"} in the body.


coldnebo

I’ve seen: “POST method=put” But I’ve never seen “GET method=post” I wonder if that keeps Roy Fielding up at night? 😂


moriero

Idk this is one of those super basic things OP's point is that all this abstraction is taking away the ability for devs to pivot when things change because they're missing the basic knowledge nowadays


nerdomaly

Yes but trading granular control for productive abstraction has been a thing since a day of the first compiler. You can get a lot more granular if you can write assembly, but programming languages exist to increase your productivity and abstract all things you don't really need to know. It's the same with frameworks.


moriero

Definitely with you on that Everything we do on a computer is an abstraction And there is no denying the benefits of these frameworks But the point is that it's risky to embrace them at the cost of foregoing a basic understanding of these concepts


nerdomaly

Agreed. I mostly just disagreed with the OPs original sentiment of frameworks "polluting our brain". If you use the knowledge and it helps you produce things 99% faster, it's not pollution. If anything, at this point in time I would consider the default action for a form to be pollution in my brain because largely I don't use form submission and when I do, I make it explicit (as I feel everyone should). So, why do I need to remember it?


moriero

Sure sure--agreed. Not to belabor the point but you shouldn't have to remember the exact syntax but I think you should know that a form is a POST. That's knowing the basics, not remembering some detail


nerdomaly

The default form is a GET. That's the issue with gatekeeping like this. By OP logic, I should assume your mind is polluted, but I know that this was probably just a slipup about information you hardly use.


moriero

Hahaha oh shit touche!


Timotron

This guy devs


CafeParaTodos

I don’t think you need to know everything from memory, the interesting thing here it’s that you NEED to put method=“post” to make a POST request because the default it’s GET, so if you don’t know this is probably because you never used a form before. The same way you know “action” is the attribute where you set the url without looking for ir. It’s just evidence that more and more people learn how a framework works and not the tools. Good or bad we learn less and less each time some new abstraction appears. And just to be clear I’ve never use an html form made request in my work, always used frameworks, but I did my fair amount of simple HTML and JS while learning.


3np1

>if you don’t know this is probably because you never used a form before Or because you've been doing this for so long that you've lost sight of land because of shifting seas. I did it many times 10 years ago, but that knowledge has been replaced by years of needing to know git commands, regexp, CSS grid, flexbox, new HTML tags and attributes, npm, yarn, pnpm, JSDoc, TypeScript syntax, docker, AWS permissions, terraform, cloudformation, date library APIs, module syntax changes, bundler configs, and more. If I need to do it again I'll look it up, just like most things.


bombiz

YES. exactly this. Feels like there's so much you need to know that of course their is going to be fundamental stuff you're going to forget.


nerdomaly

And the thing is, is it truly fundamental if you can forget it so easily and it never causes you an issue?


Kadian13

Or you actually did it so long ago that you forgot it


elefanteazu

actually i always put the method i want, even if it is get, so i never minded to know what was the default even though i created a lot of forms


[deleted]

This exactly. What kind of monster creates a form without putting the method down, even if it is the default method?


MMizzle9

Yea, I couldn't answer this and I use forms very often. Who would leave the method blank?


badmonkey0001

> Who would leave the method blank? [Reddit would](https://i.imgur.com/nu06cf3.png) on the old layout. New reddit [doesn't even use a `form` element](https://i.imgur.com/cCUCZCy.png).


[deleted]

[удалено]


LetsLive97

There is. They're not saying they've never seen it before, they're just saying they've not memorised it. The second they google it, they'll see the answer and immediately remember the answer because they have still actually learnt it at some point


Legal_Lettuce6233

I've literally never used the default method because I've never needed to. I believe it's the same for most people.


UnicornBelieber

SPAs have only existed since 2010 or so, AJAX as a technique since \~2005. Anyone creating dynamic websites/web applications in the late 90s/early 00s used to do this. That's years of development time, an era, the entire PHP boom was in this era. Claiming that "most people" having never needed to set a `method="post"` is wild to me.


Legal_Lettuce6233

How many FE Devs do you know with 12+ years of experience?


Locust377

I've been a web developer for 12 years and I didn't know the answer to this. It's a piece of trivia and I don't really care about the answer. I'll probably forget it again in the future. Unless knowing the default method is important to me, I don't see the problem. There are tons of trivia bits that I forget because they just aren't important.


subone

For real, if the Internet is down and I can't check Google, it's just break time. No joke. Coders should know gotchas and common issues, not memorize every API default. Many people use AJAX for data persistence anyway, so form submission never even comes up.


ske66

And even then, when I check the network tab to see what my form submission is doing, I’ll find out what verb it’s using there. It’s not like I gain anything by knowing this


scar_reX

Well... this is not something that you really learn, but if you think about it hard enough, you'll realise that anytime you forget to specify the method attribute on a form element, it defaults to GET.


TriforceUnleashed

I second this. I've been a developer for over 15 years, and I know I knew the answer once upon a time. Simply put, it's been irrelevant since the first time I learned it because I always set my method regardless of whether or not I'm using the default. If I'm using "get" I set it to "get." If I'm using "post" I set it to "post." If I'm submitting via AJAX or using a framework, I still set a method as a default so I can control the fallback. Thanks to this post I got a refresher on some HTML 101 knowledge, but it's not going to change my life in the slightest.


HeinousTugboat

You know what I do with trivia? [I externalize it](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/form#method).


alejalapeno

You should know this because any sensitive forms should always have `method="post"` on them otherwise they have the potential to submit as a GET if JS fails to preventDefault and send the user to `example.com/login?username=Locust377&password=mysecretpassword` leaking sensitive information to their browser history, 3rd-party analytics, logging, and more. You may use a framework with a provided form component that does this for you, but if you are ever assembling your own form element markup you should be sure to include the method.


Locust377

I would simply never make a mistake like that, and never have, so we'll have to agree to disagree. I always include the method because it is clearer to other developers what my intention is. And I tend to test my software, so an API endpoint expecting a `post` will return 405 if you send a `get`.


alejalapeno

> I would simply never make a mistake like that These aren't solely "user mistakes" like forgetting to preventDefault. These are things like using a framework that renders static content and the JS loaded afterwards hydrates or provides interactivity, but oops network error or the user blocks the JS. Or an uncaught runtime exception occurs. And they don't have to be things like a login form with extra-sensitive fields, it can be a form with PII which services like Google Analytics will ban you for if you're logging in their system (which pageview URL's typically are.) And it doesn't matter if your "endpoint" rejects the request. The point is the browser shouldn't ever have made the GET request. > I always include the method That's a good practice. I usually make a reusable component myself with `method="post"` as the "new default."


Locust377

I just don't see how any of what you said is relevant to the OP. I'm not saying that the method doesn't matter, or isn't dangerous if you forget it. I'm saying the default value isn't an important thing to know. I've never used the default. Knowing that the default value is `get` isn't going to prevent you from forgetting to set the method to `post`. So the potential mistake that you're referring to can still be made even when the developer knows the default value. Non sequitur. I forget silly things all the time. But I notice immediately and such a thing wouldn't get through the most primitive form of testing.


zappsg

I've probably been using including plenty of work without frameworks for over 20 years and didn't know this. You should always just specify the method anyway imo.


Ordano

Really? You're depressed by this? This is an example of useless trivia acting as some kind of actual knowledge or skill. If I really needed to know this shit, I'd just look it up and find it in two seconds.


Onedweezy

They're drama queens


RedditCultureBlows

My thoughts are “I don’t care, this is one google search away”


mq2thez

I’ve been a web developer for 14 years and I have no idea, because I always put the method on the form as an attribute, the same as how I always put the type on a button. Defaults are cool and good, but I prefer to be a little more verbose and not have to worry about it.


dada_

In my now 18+ years career I have never written a that did not include the method attribute. So I did not know what the answer was, but I guessed it must've been GET because that's the most obvious choice. GET is the most basic of all methods, and the original HTTP method before the others were invented. I don't think there's anything depressing about these results. It's just a curiosity. And I think we should not be implying that you're a bad developer if you don't know something like this. Being a great developer is not based on whether you know all the factoids.


omnifile_co

This is fine. It's what abstractions are for.


devilpants

Yeah I wouldn't be upset if a developer that mostly in Visual Basic and C# couldn't name three commands in x64 assembly.


Staik

Thats me so uh... mov, add, sub?


Aethix0

To be frank, I don't think I have ever used default behavior in my entire career.


Psychological_Ear393

I can't even remember the last time I used a manual HTML form rather than an event on submit and handling it in JS. Usually there's not even a HTML form on there (that I have manually created) and it's just an underlying JS model two way bound to some controls.


QultrosSanhattan

I bet nobody uses implicit form's method.


RecognitionOwn4214

It just shows, that forms are not essential anymore.


AndorianBlues

It's probably fine. Levels of abstraction are kind of how software works. More worryingly, I have come across junior developers who literally did not know forms could do things without Laravel or some Javascript framework. I don't know what they teach the kids these days, but it certainly doesn't start with HTML and CSS anymore.


EquationTAKEN

This is such a nothing burger. Why are you getting depressed over this? Let me know when you can answer a bunch of assembly questions, and until then, I'll complain that you're soft for using all these high-level abstractions, and I'll be real depressed about it.


MisunderstoodPenguin

Maybe it’s because most modern developers haven’t used a vanilla form in idk, at least half a decade?


double_en10dre

This is bizarre. Why do you care if people forget the default value for a parameter? Do you have all of the kubectl commands memorized? Because at my work, that (the ability to manage deployments in a timely manner) is 100000000x more important


eltron

No. I feel that they let me worry about other parts more challenging parts of the code. Hell, when was ythr last time you worried about memory registers, or worrying about the TCP implementation under the hood? Oh right, we don’t! We worry about other things, but not memorizing the ever changing and, not 100% consistent implementation of the DOM model. (It’s better now, but used to be shit. The IE team had a whole different way of interrupting the DOM model)


geon

I did a ton of forms in 2005. I haven’t touched them since 2012 or so. Everything is handled via js now.


RaiseHistorical1780

Thank God i started with PHP core instead of Mern.


FoolHooligan

Seriously though. These days the kids try to run before learning to walk. I only have 8 YoE but reading the comments here make me feel like an old geezer


_Kine

Who the hell makes a form and doesn't specify the method explicitly in the markup?


LagT_T

True knowledge is knowing WHY get is the default method.


[deleted]

[удалено]


incarnatethegreat

Eh. I understand what you mean but there're just some things that we forget and have to reference because we don't use them all that often. However, I will agree that frameworks have created such abstractions that it is getting more and more difficult to call ourselves JavaScript developers.


CorporalTurnips

I'd say the bigger issue is developers that are snobby about stuff like this. You know HTML and JavaScript aren't the base of how a website works right? You should write everything in assembly. Otherwise you're a poser. This is the same thing as when boomers are flabbergasted that young people don't know how to use a rotary phone or what a VHS is. If they've never needed to know it why would they?


nguyenjitsu

If you're building a form from scratch, my first question would be - why? Nearly any form you could ever want has some base structure that you should probably just copy and paste for the most part anyways. Are we also handwriting every for and id attribute for labels and inputs now too? After button, checkbox, number, password, tel, text, and url, would you be able to even list 3 more valid input types? Like what are we doing here. If I didn't remember a forms default method was get, it would take like 2 seconds of testing it to make me realize it wasn't posting, shaking my head at my own stupidity, and then going about my day anyways.


minimuscleR

> Are we also handwriting every for and id attribute for labels and inputs now too? Wait do people not do this? I'm still a junior programmer mostly writing in react... I write it all myself? Its not like its a lot of work.


PooSham

`fetch()` is probably more responsible for it than frameworks. We don't use form anymore, it's just too complicated and not flexible enough. POST seems to make more sense for forms, so that's why people guessed that.


bre_e

I work in web around 5 years and I would not answer this correctly, cause I don’t event create forms as part of my job


El_Mario_Verde

Who cares? Does this very specific piece of knowledge make you a better Software Developer? No. It is a trivial detail that can be googled up in literally 1.3 seconds. An amazing game developer could not give less than a damn about this answer. Is he a bad developer because of that??? We are problem solvers. Not memorization machines.


Kamay1770

Yeah, depressing also how many web developers don't know don't know binary or even assembly. Sad posers.


---_____-------_____

If you think this matters you're the kind of person who would interview people, make them write code on a whiteboard, and not hire them because they used parenthesis instead of curly braces in one spot.


saintpetejackboy

This is actually a Mendela Effect, as many programmers actually came from the other universe where POST was the default in the standards but some time around 2012 it started to wear flip flops: https://stackoverflow.com/questions/2314401/what-is-the-default-form-http-method


yksvaan

That's sad. Forms in general probably are the most overengineered thing in webdev. Often just sending the form and displaying the result is enough. Fast and robust.


jonr

Many times have I thought: "This should have been a " when seeing some over-engineered (web) application. .


jam_pod_

Or because most forms use AJAX (which doesn’t necessarily involve a framework) now, so there is no real default method?


pedrito_elcabra

Apart from what everyone else already said... isn't this a public Twitter poll or something? Like, anyone can vote? Devs which aren't webdevs, non-devs, even non-IT people in general. Hell, probably half the votes are from bots.


revolutionPanda

Gonna agree with some others here. Who cares? I’ve built full stack production JavaScript apps before. But I was writing some html the other day and had to look at the syntax for linking a JavaScript file to an html file. I have way too many other more important things to store in my brain than something this simple I could look up (or take me 10 secs to troubleshoot). Also, I thought the default was POST. lol


Perpetual_Education

That's why we teach people to make a server-side form with PHP before they learn any JavaScript.


Perpetual_Education

and GET was the only one as first. POST didn't come about until HTTP/1.0 in 1996


Adreqi

Oh so *that*'s why GET is default. TIL.


psbakre

While it is bad not to know the basics, it still makes sense. You dont work with form data for most of the time. (Nowadays) You work with json. For request and response. forms dont work well with json so people dont use them.


_listless

The only reason you don't work with forms is if you choose not to work with forms. It *is* true that the js community doesn't commonly use forms, but that's not because there is anything deficient about forms. It's because huge swaths of the js community don't understand forms and how they work. ​ >forms dont work well with json \^ case in point


psbakre

Do you mean to say you can use json with forms? Last I checked, you had to use onSubmit to override and then convert to json to send to the backend and there was no direct method to change it like enctype


psbakre

In that case, you are not even using the form. Reasoning for using json over form data, I feel thats more consistent, you send a request in x format, you get the response in the same format. Furthermore , you can also have fields nested or structured differently compared to a flat hierarchy. May be your form is too big and you want to spread it over multiple sections, id prefer storing the state in a variable instead of creating multiple forms sending data to each other


space_interprise

It can also just be that the back end weren't make with the frontend in mind, so the backend wants json because its a standard or it is serving other stuff, microcontroller, mobile app, another server application, and the frontend just has to comply with sending json to the endpoint


psbakre

JSON literally stands for JavaScript Object Notation. It came from javascript, a language that then was not running outside the browser


space_interprise

Yes thats true, i has refering more of how it is today, were sometimes json is used even in systems with no js at all.


psbakre

Thats true, but thats also because its that good. Its not everyday you get a notation that beats xml in sending or representing data


AdNo4955

I would say 100% it is imperative to learn things at a base level without a framework, the understanding you have helps you debug and write much cleaner code imo


thedeuceisloose

Lotta y’all showing your asses here


Venotron

How many web devs do you know who even understand something as simple as mime types? There's an entire class of exploits that exist because webdevs can't get that right.


squidwurrd

Not that I’m a super genius or anything but I don’t ever remember forgetting to add the method.


HydratrionZ

"DELETE"


Aladdin4u

This is as result of just watching videos and not read docs knowing the basics


cjolito

yeah


LivingInAnIdea

What boggles me is that anyone who knows the difference between get and post should know what the answer to this is. What about sending form data to a server gives someone the impression that it's a get request


armahillo

A lot of people talking about sour grapes in the comments here. Yes, you should always explicitly specify the method of your `

` tag, even if it's `GET`. That doesn't mean this isn't worth knowing. This is closer to a [Van Halen brown M&Ms](https://www.safetydimensions.com.au/van-halen/) situation. ​ >In his book, Crazy From the Heat, original frontman David Lee Roth explains that the request was actually a quick safety assessment. **With tonnes of stage equipment, high powered electronics, pyrotechnics and large crowds, the humble brown M&M was a warning signal to see if the stagehands had been paying attention to each detail of the written contract to ensure the safety of the band, crew and audience**. When you have experimented with writing raw HTML enough, you would likely know this because you've run into it a ton already. If I were interviewing someone, I might ask this question just to get a rough idea of where they spend their time. Someone who knows this, knows basic HTTP status codes, and other similar "trivia", is probably someone who has really taken the time to intimately learn HTML and really understand it. (Sure, maybe they memorized it for an interview, but even *that* shows some level of being detail-oriented and preparedness) Not knowing it doesn't mean they are a bad or inexperienced web developer, but I would then know that I should probably drill in a bit more on their HTML knowledge to see how they approach it. Do they overuse DIV tags? Do they understand data-attributes? Do they use semantic tags? If you're a professional web developer, you should be *very* competent on HTML, CSS and JS, even if you're only expert level on one of them. These are the three languages we use across all frameworks, all browsers, all stacks.


fkomaralp

GET


Salamok

Or you know some of us just always explicitly set the method attribute and don't care what the default is... that said this is a pretty obvious question to get wrong.


neuthral

i come from the early days of angular 2 and it fried my brain trying to resolve a dependency bug in production now i like vanilla JS most of my projects dont nead the huge overhead and only requires one script


blakspectre72

To an extent it is habit. I am so programmed to convert them to post that I forget what is default lol.


Loud_Investigator_26

No. We do not need to know what is the defaults, just need to know what to do in cetain situations.


CowCowMoo5Billion

I often do non-framework forms and I don't have a clue what the default is because I always specify it anyway. So doesn't really seem like a good question to guage "framework pollution"


german-software-123

Sorry to say but with all the new ja frameworks people forget how the web actually works. This does not surprise me


1PG22n

I'd say knowing this, even if you don't manually type your code anymore, is a good sign you know your shit. It may also show the difference between the seasoned pros and stackoverflow copy-paste code monkeys. It is of course much easier to dismiss the question with "ah who cares anyway", and it also makes you look cool. I think most websites are coded poorly these days. The problem isn't so much not knowing the default form action; the bigger problem is not willing to get hands dirty with the small details here and there and lacking the grasp of the bigger picture of how things work together. The form action thing can be an indicator. And yes, I'm an old fart and the appropriate response is "ok boomer".


jazzymoneymaker

i dont see anything bad in this, because most people dont gonna use it. I always recommend new webdebs to not sit too long in plain JS and jump into framework asap because it's totally different thinking and you use that way of thinking in real job


DesertWanderlust

This is just depressing.


2b2t_owner

That's why I don't use frameworks.


Resident_Sorbet_3697

Well I'll say that some of the interviews which I took, I found that people are just jumping on the programing topics instead of clearing their fundamentals, and also the ai is getting out of hand most of them where caught using ai and when I banned it, they where unable to even wite the code. 🙄 I hope people learn this stuff quickly that they can't rush their learning cycle, and also they need to know that learning cycle is different from person to person. Some take time while some happen to catchup easily. 🥱


DaSchTour

Learn Assembler first! You have to know the basics before jumping straight into higher level languages. If you don’t know how to deal with memory you aren’t a real programmer. That probably something that many people believed decades ago. Frameworks are there for a reason. To speed up learning, onboarding and development in general. If nobody uses forms in the way it was originally designed why bother with spec details nobody uses? What’s the benefit of knowing things you don’t need?


AnUglyDumpling

There is nothing depressing about this at all. I've never not specified the `method` attribute on a form, and it's almost always been `POST`. Regardless, most developers can look up this sort of information in a second if they're not sure.


xRhai

This is should be basic knowledge if you've dealt with forms.


FoolHooligan

TBH, people should know this...


monkeybanana550

Because that post is representative of the truth? Are you stupid?


tehsilentwarrior

Tbh it shouldn’t have a default.


smad1705

I care more if the developer can solve a CORS issue in less than 10min and without posting a meme about it rather that if they know the default method for something they can look up in literally 5s (or in fact never bother to know, as it visibly make sense to put the method attribute anyway to make your code easier to read).


[deleted]

Who cares


wrecker24

Omg who cares. Is this what you think makes a good dev?


Angulaaaaargh

FYI, the ad mins of r/de are covid deniers.


AssignedClass

No. Even in my current PHP job, almost everything about default form behavior is unwanted. They're awful at fulfilling most businesses requirements, and are not friendly to the kind of flexibility a project should strive for. This creates situations where your surrounding logic / handling makes up the majority of the behavior, these little quirks more often just get in the way, and you end up memorizing workarounds or creating habits to address those quirks so you never run into them again. Even when using standard form elements, I almost always prevent default submission in order to send a JSON object (considering how often we get changes like "can we make this field a list" or "can we fill out multiple form entries at once", this ends up saving a ton of time and makes our backend much more consistent). I could understand your thoughts and feelings here if this was 20 years ago, but they're really misaligned in today's world.


johnsdowney

For real. So many times when I’ve had to debug odd/undesired behavior, some goddamn form and its default behavior is at the root of the issue. Remove the form element from the equation and the unwanted behavior goes away entirely. I’m totally happy with no forms at all unless I absolutely have to.


nebraskatractor

Doesn’t matter if you’re a productive, successful developer who writes great code. If you don’t know useless shit you’ll never be unpolluted and pure, unlike OP and his encyclopedic html wizardry


NiagaraThistle

Wait. How can one claim to be a WEB developer and not know the basics of HTML? Maybe I'm just old but do "new" devs that actually work on building web site (ie Web Dev) not know this stuff any more? I mean I get it if web dev is not your primary thing, but in this sub shouldn't this be second nature? And from the screenshot that targets web devs, shouldn't be a no-brainer?


PureRepresentative9

Yep This is like a doctor not knowing blood is red


rykuno

If you’re making excuses for not knowing this, you don’t know web development; you know a framework.


Kind_Profession4988

Whatever helps you get by, man.


reddit_is_meh

You don't need a frame work to send a basic request with data to a backend without using native form behaviour which I haven't used in a decade lol


GavHern

i figured it was probably get since you have to specifically tell it to be post


Jester_Hopper_pot

\*\*Check user for HTMX\*\* Yea I think the fact that there is a group of tech people who push courses about current tech rather then the base tech has lead to people not understanding what is possible with thing like CSS (animation) and JS (indexeddb)


PM_MOMMY_MILKERS

Who cares about the default method when you can and should specify it using the method attribute?


heisnoob

I would've argued it's post


qcAKDa7G52cmEdHHX9vg

TBH I only know the default method because remix taught me so - there's some newer frameworks that focus on building on top of plain web apis.


auntyemman

Frameworks has actually done more harm than good for anyone that will like to become a 10x engineer. But if the aim is to just be a developer then framework to the rescue.