Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
EmmyOk
Aug 11, 2013

Undergrads who are just graduating keep posting about getting hired as software dev for legitimate companies but I used to be a demonstrator for them and they're morons, never should have done a postgrad.

Adbot
ADBOT LOVES YOU

Absurd Alhazred
Mar 27, 2010

by Athanatos

EmmyOk posted:

never should have done a postgrad.

Words to that effect were a Grad School and Academia Chat Thread title for a reason. :suicide101:

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer

EmmyOk posted:

Undergrads who are just graduating keep posting about getting hired as software dev for legitimate companies but I used to be a demonstrator for them and they're morons, never should have done a postgrad.

well if you can't be a computer programmer I guess it's time to hunch your posture and work on that mma career

EmmyOk
Aug 11, 2013

LeftistMuslimObama posted:

well if you can't be a computer programmer I guess it's time to hunch your posture and work on that mma career

Gonna have to give up on getting all the girls

Hammerite
Mar 9, 2007

And you don't remember what I said here, either, but it was pompous and stupid.
Jade Ear Joe
I created a little web page to help me out with some hobby stuff, and I needed some scripting on it. When I came to test my code, I was surprised to find that by button handlers were running twice when I clicked on the button.

Turns out this happened because I'm not very imaginative, and I'd named my function called on page load to attach handlers and the like "onload". If a function with this name exists, it gets called automatically, for ridiculous JavaScript reasons. So since I was also explicitly assigning that function to get called on page load using JQuery, it ran twice on page load and consequently each each button handler got attached twice.

Thank you very much, JavaScript!

brap
Aug 23, 2004

Grimey Drawer
window.onload runs when the page loads, yes.
All your global variables are implicitly tacked on to window.

Hammerite
Mar 9, 2007

And you don't remember what I said here, either, but it was pompous and stupid.
Jade Ear Joe

fleshweasel posted:

window.onload runs when the page loads, yes.
All your global variables are implicitly tacked on to window.

Right, I said this:

Hammerite posted:

for ridiculous JavaScript reasons

Pollyanna
Mar 5, 2005

Milk's on them.


Hammerite posted:

I created a little web page to help me out with some hobby stuff, and I needed some scripting on it. When I came to test my code, I was surprised to find that by button handlers were running twice when I clicked on the button.

Turns out this happened because I'm not very imaginative, and I'd named my function called on page load to attach handlers and the like "onload". If a function with this name exists, it gets called automatically, for ridiculous JavaScript reasons. So since I was also explicitly assigning that function to get called on page load using JQuery, it ran twice on page load and consequently each each button handler got attached twice.

Thank you very much, JavaScript!

We had a bug at work where the same POST/DELETE request (don't ask) was getting run twice, and resource IDs embedded in the HTML were getting out of sync and loving up our front-end. Turns out that it's because input and button elements had an onclick method attached to them that submitted the form they were associated with, so they were submitting the same form twice. :downs:

I am the only engineer on the team that has notable Rails experience, by the by. :sigh:

Space Kablooey
May 6, 2009


Pollyanna posted:

We had a bug at work where the same POST/DELETE request (don't ask) was getting run twice, and resource IDs embedded in the HTML were getting out of sync and loving up our front-end. Turns out that it's because input and button elements had an onclick method attached to them that submitted the form they were associated with, so they were submitting the same form twice. :downs:

I am the only engineer on the team that has notable Rails experience, by the by. :sigh:

Wait, the form was being submitted on onclicks on the inputs?

Pollyanna
Mar 5, 2005

Milk's on them.


HardDisk posted:

Wait, the form was being submitted on onclicks on the inputs?

Yes. From what I recall, it was so it could support some sort of AJAX-y autosave function whenever you type into a text box. Or maybe that was something else, because that doesn't actually make sense. gently caress if I know what it was trying to do.

Incidentally, one of the major features we have in the pipeline for the application is that the users are closing the window without hitting save and losing their stuff, please change it so that everything autosaves all the time thanks.

Space Kablooey
May 6, 2009


Pollyanna posted:

Incidentally, one of the major features we have in the pipeline for the application is that the users are closing the window without hitting save and losing their stuff, please change it so that everything autosaves all the time thanks.

no why :suicide:

Carbon dioxide
Oct 9, 2012

Form engines are literally the worst part of coding for the web.

Bruegels Fuckbooks
Sep 14, 2004

Now, listen - I know the two of you are very different from each other in a lot of ways, but you have to understand that as far as Grandpa's concerned, you're both pieces of shit! Yeah. I can prove it mathematically.

Pollyanna posted:

Yes. From what I recall, it was so it could support some sort of AJAX-y autosave function whenever you type into a text box. Or maybe that was something else, because that doesn't actually make sense. gently caress if I know what it was trying to do.

Incidentally, one of the major features we have in the pipeline for the application is that the users are closing the window without hitting save and losing their stuff, please change it so that everything autosaves all the time thanks.

Welcome to hell. I've seen that very same request gently caress up many projects.
Pick your poison:

- The onunload handler that makes multiple synchronous ajax calls and runs like 5000 lines of code.
- The onbeforeunload handler that shows an annoying message box and blocks any javascript from running while it's showing.
- A post every minute that saves the state of the application, and deletes itself if you really close, but if you don't, it resumes the state.
- Let's put the content of every form in localstorage and clear it when you close the window.
- Let's make this poo poo realtime like google docs and make it so every time you do something, it's saved for everyone, but let's also not understand what websockets are and try to do this by polling a slow-rear end service that takes a second to respond for each request and wonder why it's slow.

tyrelhill
Jul 30, 2006

Hammerite posted:

Right, I said this:

Totes, a part of JS programming (at least on a browser) that is probably older than you are is at fault here.

Soricidus
Oct 21, 2010
freedom-hating statist shill

tyrelhill posted:

Totes, a part of JS programming (at least on a browser) that is probably older than you are is at fault here.

I'm glad we all agree about this.

brap
Aug 23, 2004

Grimey Drawer
If the form takes more than 1 minute to fill out, yeah, it should probably be saved as you go. I felt bad for one of our clients when we essentially shipped them an enormous web form they could easily spend 15 minutes filling out if they weren't just typing it in as fast as they could from a handwritten copy. Feature request: saves.

I feel as though there is a short list of general fuckups that developers of line-of-business apps make because they're doing what's easy instead of what would be useful for their customers. One of them is this kind of "save what the gently caress I'm doing" stuff. Another is "make it so I can view old versions of the data", which devs preclude by performing destructive operations on data as a first resort.

Hammerite
Mar 9, 2007

And you don't remember what I said here, either, but it was pompous and stupid.
Jade Ear Joe

tyrelhill posted:

Totes, a part of JS programming (at least on a browser) that is probably older than you are is at fault here.

I'm 30, glad we agree this is bad of Javascript though

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

Hammerite posted:

I'm 30, glad we agree this is bad of Javascript though

They were only 9 years off..

The solution to the problem is to not use JavaScript. It's the solution to all problems with JavaScript.

ToxicSlurpee
Nov 5, 2003

-=SEND HELP=-


Pillbug

leper khan posted:

They were only 9 years off..

The solution to the problem is to not use JavaScript. It's the solution to all problems with JavaScript.

Good luck with that. How much stuff out there is legacy stuff heavy on ancient Javascript that nobody wants to pay to replace?

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

ToxicSlurpee posted:

Good luck with that. How much stuff out there is legacy stuff heavy on ancient Javascript that nobody wants to pay to replace?

I mean worst case I can go write mumps for a medical device company. At least it isn't JavaScript..

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

I feel like JS gets too much hate. I mean, it's not great, and you've got to know lots of gotchas...but once I got past that hump I think it's alright.

ToxicSlurpee
Nov 5, 2003

-=SEND HELP=-


Pillbug

Thermopyle posted:

I feel like JS gets too much hate. I mean, it's not great, and you've got to know lots of gotchas...but once I got past that hump I think it's alright.

I'm learning it now because of my job and it's legitimately the only language I genuinely hate.

return0
Apr 11, 2007
I quite like JS tbh.

Internet Janitor
May 17, 2008

"That isn't the appropriate trash receptacle."

leper khan posted:

The solution to the problem is to not use JavaScript. It's the solution to all problems with JavaScript.

Just to clarify here are you advocating the use of a bespoke language which compiles into JavaScript or are you advocating the abolishment of web browsers?

Gul Banana
Nov 28, 2003

Thermopyle posted:

I feel like JS gets too much hate. I mean, it's not great, and you've got to know lots of gotchas...but once I got past that hump I think it's alright.

it's the lack of choice
javascript is wayyy too high-level to be the core ABI of an application platform. thanks to historical accidents we've been stuck with that, as well as its actual design mistakes (which were major)

like if the web is going to be "computers 2.0" then this thing is in the position of assembly. imagine if instead of being able to access registers the hardware just gave you garbage-collected hash tables..

qntm
Jun 17, 2009
If you think JavaScript is so bad that you can't possibly imagine Mumps being any worse, you need your head examined.

Internet Janitor
May 17, 2008

"That isn't the appropriate trash receptacle."
JavaScript's inextricable linkage to the browser stack is precisely equivalent to the reason C still exists.

The takeaway lesson is don't implement a language in a hurry and choose semantics simply because they make writing a compiler or interpreter easier.

Amberskin
Dec 22, 2013

We come in peace! Legit!

qntm posted:

If you think JavaScript is so bad that you can't possibly imagine Mumps being any worse, you need your head examined.

MUMPS was born in a PDP-7, a machine that topped 64 KWords of memory. The comparison is not fair

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

Amberskin posted:

MUMPS was born in a PDP-7, a machine that topped 64 KWords of memory. The comparison is not fair

Someone just said that they'd rather program mumps than JS...

john donne
Apr 10, 2016

All suitors of all sorts themselves enthral;

So on his back lies this whale wantoning,

And in his gulf-like throat, sucks everything

That passeth near.
Javascript is mostly fine with a few warts.

It's the frameworks and libraries that are built with javascript that are the true horrors.

HappyHippo
Nov 19, 2003
Do you have an Air Miles Card?

Thermopyle posted:

I feel like JS gets too much hate. I mean, it's not great, and you've got to know lots of gotchas...but once I got past that hump I think it's alright.

I agree. It's a bad language and I certainly wouldn't defend it, but the griping seems a bit over the top sometimes.

This opinion may be influenced by the fact that I've only used javascript for personal projects. I'd imagine it would be much worse if I had to work with other people's code.

xzzy
Mar 5, 2009

I think it's important to make it clear whether it's javascript you like, or jQuery. :v:

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer

Thermopyle posted:

Someone just said that they'd rather program mumps than JS...

i do program mumps and it's way less painful than js, but also you can't really do anything with it that you would use js for. you are not gonna escape js on your front end by using an esoteric backend. we have js on our front end.

also lol that this discussion started because someone is upset that a window event handler is fired when the window event occurs as though that's some arcane js bullshit and not like the explicit point of events in any language.

Pollyanna
Mar 5, 2005

Milk's on them.


Carbon dioxide posted:

Form engines are literally the worst part of coding for the web.

I won't argue against this. In fact, I think you might be right :suicide: Especially when people try and implement complicated functionality using nothing but motherfucking forms. I've outright said that I don't work with Rails forms and barely know how they work, and there's really only one other engineer that likes using them - this is the same person that was trying to do real-time AJAX responses/updates via Turbolinks or whatever.

Bruegels Fuckbooks posted:

Welcome to hell. I've seen that very same request gently caress up many projects.
Pick your poison:

- The onunload handler that makes multiple synchronous ajax calls and runs like 5000 lines of code.
- The onbeforeunload handler that shows an annoying message box and blocks any javascript from running while it's showing.
- A post every minute that saves the state of the application, and deletes itself if you really close, but if you don't, it resumes the state.
- Let's put the content of every form in localstorage and clear it when you close the window.
- Let's make this poo poo realtime like google docs and make it so every time you do something, it's saved for everyone, but let's also not understand what websockets are and try to do this by polling a slow-rear end service that takes a second to respond for each request and wonder why it's slow.

None of the above - if I remember correctly, we have it so that whenever something loses focus, it posts to the server. :downs:

fleshweasel posted:

If the form takes more than 1 minute to fill out, yeah, it should probably be saved as you go. I felt bad for one of our clients when we essentially shipped them an enormous web form they could easily spend 15 minutes filling out if they weren't just typing it in as fast as they could from a handwritten copy. Feature request: saves.

I feel as though there is a short list of general fuckups that developers of line-of-business apps make because they're doing what's easy instead of what would be useful for their customers. One of them is this kind of "save what the gently caress I'm doing" stuff. Another is "make it so I can view old versions of the data", which devs preclude by performing destructive operations on data as a first resort.

These are basically spreadsheets where information is being entered one cell at a time. So maybe it counts, but I mean, even then...

ToxicSlurpee
Nov 5, 2003

-=SEND HELP=-


Pillbug

xzzy posted:

I think it's important to make it clear whether it's javascript you like, or jQuery. :v:

I'm convinced that jquery is sorcery. Everything I've written in it looks like gibberish and I'll be totally unable to explain why it works but it does.

Bongo Bill
Jan 17, 2012

Of all the problems with Javascript, namespace issues with the window events is way down on the list. I don't hate it most.

Hughlander
May 11, 2005

Amberskin posted:

MUMPS was born in a PDP-7, a machine that topped 64 KWords of memory. The comparison is not fair

As opposed to C...

Sinestro
Oct 31, 2010

The perfect day needs the perfect set of wheels.

Hughlander posted:

As opposed to C...

C is a lot less ambitious.

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

Internet Janitor posted:

Just to clarify here are you advocating the use of a bespoke language which compiles into JavaScript or are you advocating the abolishment of web browsers?

While I would prefer the latter (at least for interactive applications), I will accept the former.

Adbot
ADBOT LOVES YOU

qntm
Jun 17, 2009

Sinestro posted:

C is a lot less ambitious.

C manages to be pretty horrific despite its lack of ambition.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply