CodingjQuery

 

Press Ctrl+Enter to quickly submit your post
Quick Reply  
 
 
  
 From:  Peter (BOUGHTONP)  
 To:  ALL
34725.1 
quote: Xen
For the trivial little nonsenses I work on it would be infinitely more hassle than it's worth.


How about some examples of trivial little nonsenses you've done in JavaScript?
0/0
 Reply   Quote More 

 From:  Drew (X3N0PH0N)  
 To:  Peter (BOUGHTONP)     
34725.2 In reply to 34725.1 
msg:34726.1

0/0
 Reply   Quote More 

 From:  Peter (BOUGHTONP)  
 To:  Drew (X3N0PH0N)     
34725.3 In reply to 34725.2 
msg:34725.1
0/0
 Reply   Quote More 

 From:  Drew (X3N0PH0N)  
 To:  Peter (BOUGHTONP)     
34725.4 In reply to 34725.3 
msg:34726.6

0/0
 Reply   Quote More 

 From:  Ben (BENLUMLEY)  
 To:  Peter (BOUGHTONP)     
34725.5 In reply to 34725.1 
i spent about half an hour at work arguing this with someone on monday.

i won, and then he admitted i was right, and it was faster.
0/0
 Reply   Quote More 

 From:  Mikee  
 To:  Ben (BENLUMLEY)     
34725.6 In reply to 34725.5 
What's faster?



[Mwah]
0/0
 Reply   Quote More 

 From:  Peter (BOUGHTONP)  
 To:  Drew (X3N0PH0N)     
34725.7 In reply to 34725.4 
Yeah, see you could do that with half as much code and twice as readable, meaning less time developing and more time bouncing.

javascript code:
document.getElementById('hoist').innerHTML = '[extra code]' + document.getElementById('hoist').innerHTML;
javascript code:
$j('#hoist').prepend( '[extra code]' );



javascript code:
document.getElementById('me').childNodes;
javascript code:
$j('#me>*');

By the way, that's basic CSS selectors, not some random new language, (can also do $j('#me').children() if you really wanted).

Which is something I don't think anyone's mentioned: jQuery isn't some fancy new thing to learn: it's just CSS selectors plus standard functions.
0/0
 Reply   Quote More 

 From:  99% of gargoyles look like (MR_BASTARD)  
 To:  Mikee     
34725.8 In reply to 34725.6 
jQuery (compared to roll your own JS I presume)

some things never change
0/0
 Reply   Quote More 

 From:  Mikee  
 To:  99% of gargoyles look like (MR_BASTARD)     
34725.9 In reply to 34725.8 
there's faster



[Mwah]
0/0
 Reply   Quote More 

 From:  Peter (BOUGHTONP)  
 To:  Mikee     
34725.10 In reply to 34725.9 
Yeah, that sort of test isn't a valid benchmark though.
(For proper testing, you need a real world application, rather than a series of isolated tests)


Also, the significance of 4ms vs 12ms is... well, it's not significant, not until you start doing a lot of iterations - and if you've got that many lookups in a performance-sensitive action, you're probably doing something wrong.

(why are the values rounded to 4/8/12/etc?)


Plus, actually writing code is much faster with jQuery, so if there end up being performance issues, you actually have time to identify and fix them.
0/0
 Reply   Quote More 

 From:  Drew (X3N0PH0N)  
 To:  Peter (BOUGHTONP)     
34725.11 In reply to 34725.7 
There's no need for it to be readable, I don't read it. And messy as JS is, I still prefer the longhand in readability terms. At least it follows some conventions I'm familiar with.

But yeah, as I said before, I just prefer it the other way. I don't like relying on intermediary things. There'll come a time when I don't have access to it or can't use it or whatever and I'd rather be familiar witht he language itself.

Which I'm not with JS at all. I just tinker. If I ever got to the point of being fluent then I might make the educated decision to use libraries.

0/0
 Reply   Quote More 

 From:  Peter (BOUGHTONP)  
 To:  Drew (X3N0PH0N)     
34725.12 In reply to 34725.11 
Well, yeah, learn the language obviously. Then do it the easy way.

jQuery doesn't supplant JS, it accompanies it.
Well, it does replace the DOM crap, but it replaces that with CSS selectors and completely obvious functions, which is a far more sensible thing to know.
0/0
 Reply   Quote More 

 From:  Drew (X3N0PH0N)  
 To:  Peter (BOUGHTONP)     
34725.13 In reply to 34725.12 
Aye, s'fair enough.

0/0
 Reply   Quote More 

 From:  99% of gargoyles look like (MR_BASTARD)  
 To:  Drew (X3N0PH0N)     
34725.14 In reply to 34725.11 

I agree with you, for pretty much the same reasons. Plus, I'm anal. I like to be in control, and know that I can write the basic code (even if I've done it many times before). If I were in a production environment it might be different, but I'm not.

 

By the same token, I eschew PHP class libraries. But, again, my coding is not complex enough to need the crutch.

 

Perhaps we can be codechums?


some things never change
0/0
 Reply   Quote More 

 From:  JonCooper  
 To:  ALL
34725.15 
I was leaning (in principle) towards agreeing with you both - I tend not to trust anything I didn't make myself, cos i know what goes where and I know how it all fits together and how/why it works

but then I considered tools, I didn't make my welder, I didn't make my electric drill, I didn't make any of the spanners I have (and a spanner is simple, I could make one)

and I could extend that thinking to my PC, I'd claim to have built it myself, but did I really? or did I just assemble a bunch of stuff others had made? - It is mine, there is no other exactly like it anywhere, but I really didn't actually make any of the bits inside

so, maybe trying to see this jQuery thing as another tool, not really so different to the keyboard / mouse / screen / HD - though a software tool rather than a hardware thingy

blimey, what a ramble ...

Jon
0/0
 Reply   Quote More 

Message 34725.16 deleted 24 May 2015 18:41 by 53NORTH

 From:  Drew (X3N0PH0N)  
 To:  99% of gargoyles look like (MR_BASTARD)     
34725.17 In reply to 34725.14 
(hug) codechum

0/0
 Reply   Quote More 

 From:  JonCooper  
 To:  Al JunioR (53NORTH)     
34725.18 In reply to 34725.16 
I do not know what a "fleshlite" is, I suspect it's a typo, but I like the image it creates

Jon
0/0
 Reply   Quote More 

Message 34725.19 deleted 24 May 2015 18:41 by 53NORTH

Reply to All    
 

1–19

Rate my interest:

Adjust text size : Smaller 10 Larger

Beehive Forum 1.5.2 |  FAQ |  Docs |  Support |  Donate! ©2002 - 2024 Project Beehive Forum

Forum Stats