|
HoboMan posted:i figure jquery is good and has better defined behavior, but my biggest problem is with the .val() method. in the modern web that's actually a false assumption assuming you prefer things to fail loudly. look up youmightnotneedjquery.com for alternative of doing what it does. it'll usually be more verbose but as far as compatibility if you target IE10 and up you'll have little issue with cross compatibility. the benefit of using native Dom is if you typo selectors, generally the code will fail at some point and tell you why. Jquery code adopts the keep on trucking mentality of much of the web, so you may think you just did 5 operations on a bunch of DOM elements, but actually you just ran 5 operations on a blank selector, or bound events to a blank selector. if you're interested in learning, try to explore non jquery ways of doing things. if you just wanna hammer things together, JQuery is fine, just remember to be wary about silent failures, so be real particular about reading your code when debugging.
|
# ? Apr 29, 2016 22:54 |
|
|
# ? May 11, 2024 12:11 |
|
thank you, it looks like i would really prefer not using jquery then because elements not existing kinda makes everything break and i like things complaining about that. my target is specifically ie8 though. also: i noticed all this code assumes element.value is a thing but according to w3 spec it's actually element.nodeValue could this be my problem? can i just make up new properties by going element.myProp = "fart"; the only indications i have that this might work is this code i'm looking at, i can't find anything online HoboMan fucked around with this message at 23:13 on Apr 29, 2016 |
# ? Apr 29, 2016 23:04 |
|
i thought the web is a failure because of IE6
|
# ? Apr 29, 2016 23:16 |
|
You can put random crap on DOM objects but that doesn't mean it'll do anything. use setAttribute and getAttribute if you want to change one of the attributes on the DOM element. .value is fine. if you're targeting IE8 you should probably just be more fastidious with jquery rather than doing the DOM manually, in that territory there are far more gotchas, it's not too bad but if you don't know what to look for you'll just be wasting your time.
|
# ? Apr 29, 2016 23:20 |
|
MeruFM posted:i thought the web is a failure because of IE6 ie6 was the hitler in the axis of the web. undeniably evil, but even if you'd killed it before it had a chance to rise to power, you're still going to end up with genocidal fascists everywhere
|
# ? Apr 29, 2016 23:50 |
|
kalstrams posted:hm, thats a good call. ill check this and plugins, and maybe then i can plot obscene amounts of data at once just read it line by line instead of all at once and hopefully your plotter understands generators
|
# ? Apr 30, 2016 00:07 |
|
Vanadium posted:ohai.path shut up ruby is awful i shouldn't have to truth test whether a url has been parsed it should do the reasonable thing and throw an exception if it fails. otherwise there should be a separate url.parse that's more tightly scoped to urls that conform to "#{scheme}://#{host}:#{port}"
|
# ? Apr 30, 2016 00:08 |
|
JawnV6 posted:what CAD do you mean? VLSI DRC is tuned to be so obnoxious as to require waivers. EE CAD will let you route acute angles that will cause silkscreening issues, or run a ground trace right under a crystal. ME CAD systems have 'designer modes' with unrealizable 2d NURBS, even after being banged into a non-intersecting geometry you still need a DFM review by a tooling expert. i think solidworks still balks at an extruded figure-8's midpoint. that's exactly the sort of thing I mean: producing big visible errors on invalid markup, instead of just trying to produce some "reasonable" interpretation of the input, would have been better for everyone
|
# ? Apr 30, 2016 00:12 |
|
Barnyard Protein posted:what is the standard procedure for reviewing software design? this is a question the industry has been asking since software was first written
|
# ? Apr 30, 2016 00:13 |
|
AWWNAW posted:nothing matters hobo man
|
# ? Apr 30, 2016 00:14 |
|
Ran across this today, code:
|
# ? Apr 30, 2016 00:16 |
Corla Plankun posted:just read it line by line instead of all at once and hopefully your plotter understands generators
|
|
# ? Apr 30, 2016 00:17 |
|
Blinkz0rz posted:shut up ruby is awful i shouldn't have to truth test whether a url has been parsed it should do the reasonable thing and throw an exception if it fails. otherwise there should be a separate url.parse that's more tightly scoped to urls that conform to "#{scheme}://#{host}:#{port}" why would uri.parse throw an exception when it successfully parses a uri
|
# ? Apr 30, 2016 00:27 |
|
Doublethink posted:Ran across this today, code:
|
# ? Apr 30, 2016 00:39 |
|
Blinkz0rz posted:shut up ruby is awful i shouldn't have to truth test whether a url has been parsed it should do the reasonable thing and throw an exception if it fails. Blinkz0rz posted:otherwise there should be a separate url.parse that's more tightly scoped to urls that conform to "#{scheme}://#{host}:#{port}"
|
# ? Apr 30, 2016 01:05 |
|
weird posted:why would uri.parse throw an exception when it successfully parses a uri i've never come across a situation in any language where i used a uri.parse method for anything other than urls and you probably haven't either
|
# ? Apr 30, 2016 02:44 |
|
Soricidus posted:yeah, java does have this too though and it's probably bad if ruby doesn't ruby is loving godawful and i hate every day that i have to write it
|
# ? Apr 30, 2016 02:45 |
|
i thought it was already back out of fashion tho?
|
# ? Apr 30, 2016 03:08 |
|
Blinkz0rz posted:i've never come across a situation in any language where i used a uri.parse method for anything other than urls and you probably haven't either Blinkz0rz posted:i've never come across a situation in any language where i used a uri.parse method for anything other than urls and you probably haven't either guess you've never used ojective c
|
# ? Apr 30, 2016 03:22 |
|
HoboMan posted:so i have a javascript best practices (lol) question: should i try to do everything with jquery objects rather than just directly using dom objects when i'm messing with the html or should i prefer using dom objects over jquery or does it not matter at all? use the standard dom API as a first resort. if you need crazy jquery selectors to make your page work, you are doing something bad
|
# ? Apr 30, 2016 04:00 |
|
MALE SHOEGAZE posted:guess you've never used ojective c thank god
|
# ? Apr 30, 2016 05:00 |
|
MALE SHOEGAZE posted:guess you've never used ojective c idgi
|
# ? Apr 30, 2016 05:12 |
|
pokeyman posted:idgi someone's confused about the difference between the language and the frameworks
|
# ? Apr 30, 2016 05:17 |
|
i was gonna say 'i guess someone has never used foundation' but i figured someone would say 'idgi'
|
# ? Apr 30, 2016 05:41 |
|
jquery is a much nicer api to use than the standard dom imo e.g. JavaScript code:
|
# ? Apr 30, 2016 08:23 |
|
terrible programmer sighted: https://medium.com/@raymondchandler/down-and-out-in-the-magic-kingdom-92b0a715778f#.goh7nwgy3
|
# ? Apr 30, 2016 14:59 |
|
fritz posted:terrible programmer sighted: https://medium.com/@raymondchandler/down-and-out-in-the-magic-kingdom-92b0a715778f#.goh7nwgy3 this essay really goes places
|
# ? Apr 30, 2016 15:26 |
|
fritz posted:terrible programmer sighted: https://medium.com/@raymondchandler/down-and-out-in-the-magic-kingdom-92b0a715778f#.goh7nwgy3
|
# ? Apr 30, 2016 15:55 |
|
MALE SHOEGAZE posted:i was gonna say 'i guess someone has never used foundation' but i figured someone would say 'idgi' still don't get it???????
|
# ? Apr 30, 2016 16:01 |
|
Blinkz0rz posted:i've never come across a situation in any language where i used a uri.parse method for anything other than urls and you probably haven't either i mean if you want urls then wanting a url parsing function is fine and it is weird if ruby doesn't have one regardless. saying that the function uri.parse should actually be a url parser that throws on valid uris is braindead. you asked it to parse a uri and it parsed a uri
|
# ? Apr 30, 2016 16:07 |
|
i'm just saying that in my many years of programming i've never had to parse a uri that wasn't a url
|
# ? Apr 30, 2016 16:11 |
|
sure, but that doesn't change what a uri is. you asked it to parse a uri and it parsed a uri. getting mad that ruby doesn't have a url parsing function makes sense, but there wasn't any silent failure
|
# ? Apr 30, 2016 16:24 |
|
it's cool that you're being pedantic in the terrible programmers thread
|
# ? Apr 30, 2016 16:35 |
|
Blinkz0rz posted:it's cool that you're being pedantic in the terrible programmers thread
|
# ? Apr 30, 2016 16:41 |
|
"it's dumb that this function implements the full standard instead of only handling the particular special case i happen to care about" -- someone who is posting in the right thread
|
# ? Apr 30, 2016 16:42 |
|
Blinkz0rz posted:i'm just saying that in my many years of programming i've never had to parse a uri that wasn't a url Yeah, it would be nice if there was a built-in URL parser in Ruby. It's stupid to parse "foo.com" with a URI parsing function, though, and then get mad when it doesn't give you back stuff like the port and the scheme when that information was never provided to the parsing function in the first place. How would the parser know if the scheme is supposed to be HTTP or HTTPS (or literally anything else)? If it doesn't know the scheme then how could it possibly begin to even assume anything about the port? Ruby's not great, but it not assuming everything is HTTP on port 80 for URI's is not what I would consider one of its major flaws.
|
# ? Apr 30, 2016 16:46 |
|
Blinkz0rz posted:i'm just saying that in my many years of programming i've never had to parse a uri that wasn't a url relative paths
|
# ? Apr 30, 2016 16:59 |
|
Blinkz0rz posted:it's cool that you're being pedantic in the terrible programmers thread i'm just saying that uri.parse should not throw an exception on a valid uri (it does throw on an invalid uri), and that calling it silent failure is objectively wrong
|
# ? Apr 30, 2016 17:02 |
|
ruby is real bad
|
# ? Apr 30, 2016 17:04 |
|
|
# ? May 11, 2024 12:11 |
|
Blinkz0rz posted:it's cool that you're being pedantic in the terrible programmers thread no you're actually just extremely long
|
# ? Apr 30, 2016 17:17 |