|
code:
|
# ? May 12, 2011 01:45 |
|
|
# ? Jun 7, 2024 02:50 |
|
Hammerite posted:http://falconpl.org/index.ftd?page_id=facts Wow, check out that performance, it's three times faster than Perl at executing an empty loop!
|
# ? May 12, 2011 01:55 |
|
Hot Dog Day #55 posted:Obviously, rewritten from memory. I didn't even realize that last portion was possible (C++). In C, else if works because an if/else block is treated as a single statement for the purpose of needing braces. This program will output "yes" for example code:
|
# ? May 12, 2011 05:28 |
|
tractor fanatic posted:In C, else if works because an if/else block is treated as a single statement for the purpose of needing braces. Huh, I did know that, but hadn't considered that was what was occurring on the else switch. I feel a bit sheepish posting that now.
|
# ? May 12, 2011 11:18 |
|
Hammerite posted:http://falconpl.org/index.ftd?page_id=facts quote:Scripting languages are mainly designed to work with abstract data, as (floating point) numbers or strings.
|
# ? May 12, 2011 11:48 |
|
I'm working with a team who is writing a java app that has two very simple parts. The first piece polls a database at a regular interval and generates a report on various data. The second piece is a webservice that serves the report as well as exposing some methods that will update data based on the contents of the report. It's fairly simple. Except that in order to accomplish this they split it into two distinct programs that each contain the same jars. The webservice lives in a tomcat container. The poller is a standalone java app. When I asked why they didn't just include the poller in the tomcat container as a timer class they replied "we couldn't figure out how". Does this count as a horror?
|
# ? May 12, 2011 12:30 |
|
Is there any reason for doing var someString = ["qwe","rty"].join(''); instead of var someString = "qwe"+"rty"; in Javascript? e: actually, the code I'm looking at is more like var someString = ["qwe","rty", "ui"+"op"].join(''); Wheany fucked around with this message at 12:57 on May 12, 2011 |
# ? May 12, 2011 12:55 |
|
Wheany posted:Is there any reason for doing Or in fact doing var someString = "qwertyuiop"; Let me guess, advert code?
|
# ? May 12, 2011 13:00 |
|
Wheany posted:Is there any reason for doing Not really. It's not what you were asking about, but I could kind-of see doing ['hello', name + '.', 'how are you?'].join(' ') because it would mean you wouldn't have to remember to put spaces in all the right places.
|
# ? May 12, 2011 13:01 |
|
Zombywuf posted:Or in fact doing var someString = "qwertyuiop"; It uses variables, so it cannot be just "qwertyuiop". And it's not advert code, just poo poo. If I had to guess, it's either an optimization or the coder didn't know you could just use a + to concatenate strings.
|
# ? May 12, 2011 13:20 |
|
Okay, for some reason the layout of an element is different in IE 8 than in other browsers, let's invesigate... Hmm, that is quite a DOM tree. I'll try the console:code:
e: Here is the CSS path with ids and classes removed: html body div div table tbody tr td div div div div div table tbody tr td div div div div div div div div div div div div div table tbody tr td a input Wheany fucked around with this message at 15:32 on May 12, 2011 |
# ? May 12, 2011 15:20 |
|
Wheany posted:Is there any reason for doing join used to be more efficient, not sure if it is anymore. http://www.google.com/search?hl=no&client=opera&hs=zKY&rls=nb&channel=suggest&q=javascript+concatenate+string+vs+join&aq=f&aqi=&aql=&oq=
|
# ? May 12, 2011 16:05 |
|
All Hat posted:join used to be more efficient, not sure if it is anymore. Surely this statement is meaningless without an indication of whose javascript engine you are talking about? I mean, I'm assuming this is something that might vary between browsers.
|
# ? May 12, 2011 16:53 |
|
It might be based on this 2008 article. Older IEs seem to perform better using join(). Given the radical changes to how modern Javascript engines work, it's likely that the results might be different now.
|
# ? May 12, 2011 17:08 |
|
IE6 has a better worst case run time when using .join than concatenating with the + operator, but, at least in my testing, you had to be working with 500+ parts to really notice. I'm assuming there was also some horrific memory leak where every intermediate string in the concatenation chain had to be created and didn't go away. Sometimes I prefer joining on an array just because I think it ends up looking a bit cleaner when you have enough variables going around. Also, it's easier to type a comma than a plus if you're feeling lazy.
|
# ? May 12, 2011 17:46 |
|
Wheany posted:Okay, for some reason the layout of an element is different in IE 8 than in other browsers, let's invesigate... Hmm, that is quite a DOM tree. I'll try the console: Dunno seems like the browser should scream some warning if the node path gets past like 20 levels, or at least there should be some plugin that does that
|
# ? May 12, 2011 17:47 |
|
Melted_Igloo posted:Dunno seems like the browser should scream some warning if the node path gets past like 20 levels, or at least there should be some plugin that does that Rule #1 of web development: Browsers don't scream about *anything*.
|
# ? May 12, 2011 18:25 |
|
Monkeyseesaw posted:Rule #1 of web development: Browsers don't scream about *anything*. They cry themselves to sleep instead.
|
# ? May 12, 2011 19:33 |
|
Geekner posted:They cry themselves to sleep instead. Browsers aren't smart enough to cry about the atrocities they commit, they just do whatever they can to make something out of what they're given. If that happens to be, for example, the full path to one of the backend databases, well, they're just happy that they could display something for you.
|
# ? May 12, 2011 19:56 |
|
Hammerite posted:Surely this statement is meaningless without an indication of whose javascript engine you are talking about? I mean, I'm assuming this is something that might vary between browsers. ya, sure. but that article McGlockenshire links to is probably where array joins instead of straight concat comes from in most cases.
|
# ? May 12, 2011 20:17 |
|
Wheany posted:Is there any reason for doing If ui, op are variables and are numbers or potentially are integers, it would add them first and coerce it into a string. Which may or may not be what you wanted.
|
# ? May 12, 2011 20:35 |
|
Monkeyseesaw posted:Rule #1 of web development: Browsers don't scream about *anything*. code:
|
# ? May 12, 2011 20:58 |
Biowarfare posted:
More concisely: ON ERROR RESUME NEXT
|
|
# ? May 12, 2011 21:02 |
|
nielsm posted:More concisely: Hey this is what I used to do to get my vbscripts to work!
|
# ? May 12, 2011 21:40 |
|
Biowarfare posted:
If I ever write a language this will be a compile-time error.
|
# ? May 12, 2011 22:09 |
|
All Hat posted:ya, sure. but that article McGlockenshire links to is probably where array joins instead of straight concat comes from in most cases. But has this really been an issue anywhere ever? I mean has the performance of string concatenation ever mattered except for benchmarks?
|
# ? May 12, 2011 22:21 |
|
yaoi prophet posted:If I ever write a language this will be a compile-time error. code:
|
# ? May 12, 2011 22:24 |
|
Wheany posted:But has this really been an issue anywhere ever? I mean has the performance of string concatenation ever mattered except for benchmarks? Yep, it is where I work, and it's a pretty hosed up scenario.
|
# ? May 12, 2011 22:34 |
|
I truly have no idea. I can't really think of a situation where concatenating >500 strings would seem like a genuinely good idea, so I suppose not.
|
# ? May 12, 2011 22:34 |
|
pseudorandom name posted:
Yeah but at least there's something.
|
# ? May 12, 2011 22:42 |
|
pseudorandom name posted:
Make it a compile time error after the optimizing compiler gets done with it.
|
# ? May 12, 2011 22:56 |
|
pre:public static int Main() try { App.Init() } catch(ex) { //nothing } finally { return 0 }
|
# ? May 12, 2011 23:02 |
|
yaoi prophet posted:If I ever write a language this will be a compile-time error. Error: Failed to understand purpose of exceptions. Initiating auto-pilot.
|
# ? May 12, 2011 23:10 |
|
Hughlander posted:Make it a compile time error after the optimizing compiler gets done with it. That would require whole program optimization, and even then I could probably come up with a control flow that your compiler couldn't follow.
|
# ? May 12, 2011 23:27 |
|
All Hat posted:I truly have no idea. I can't really think of a situation where concatenating >500 strings would seem like a genuinely good idea, so I suppose not. Probably just about every corporate intranet that should be using a dedicated database/CMS setup but isn't.
|
# ? May 13, 2011 00:13 |
|
pseudorandom name posted:That would require whole program optimization, and even then I could probably come up with a control flow that your compiler couldn't follow. yeah but if you can outthink the compiler to that degree you'd probably realize that catch all do nothing is a terrible idea.
|
# ? May 13, 2011 04:50 |
|
You'd be surprised by how ingenious incompetents can be.
|
# ? May 13, 2011 06:41 |
|
"Wheany" posted:But has this really been an issue anywhere ever? I mean has the performance of string concatenation ever mattered except for benchmarks? Can help when you're heap-spraying, though I suppose that's technically a bad thing.
|
# ? May 13, 2011 09:32 |
|
Best way to separate content and presentation using CSS? <td class="bold"> e: Not a horror, but pretty dumb anyway.
|
# ? May 13, 2011 09:45 |
|
|
# ? Jun 7, 2024 02:50 |
|
.bold {font-style:italic;}
|
# ? May 13, 2011 09:55 |