Leave a comment

Comments 24

momentsmusicaux March 3 2013, 11:29:41 UTC
The slides about performance are very interesting ( ... )

Reply

andrewducker March 3 2013, 11:39:50 UTC
Arrays are slower than objects because going to myObject.Thingy is converted into direct access of a memory location at compile time, whereas myObject["thingy"] means scanning through an array to find something with the key "thingy".

I'm totally with you on the naming of things. I like long, explanatory, names for things. Maintainability is vital.

Reply

khbrown March 4 2013, 02:15:12 UTC
I couldn't see the video, but aren't there important differences between PHP, which is only OO if you want to be, compared to Ruby, where everything is an object.

As I understand it PHP has two main datatypes: scalars and associative arrays. This can cause complications when coming from a Perl background. In Perl $array[-1] gives the last element in an array, whereas in PHP $array[-1] is a legitimate hash key.

Reply

spacelem March 4 2013, 09:25:21 UTC
I like nice short names, mostly because many of my parameters mathematical parameters with names like r, c, d, e, beta_w, beta_b, gamma, sigma, m, and I do not want to be writing

death_rates[i] = natural_mortality_rate*total_population[i] + disease_induced_mortality_rate*infective_population[i];
when I could be writing

death_rates[i] = d*N[i] + e*I[i];
which is not only easier to understand, but actually mirrors my equations.

The ternary operator is also brilliant for writing things like

infect_matrix[i] += N[i] ? beta_w * S[i] * I[i]/ (float) N[i] : 0.0;
or

prevalence = N_total ? (float) I_total / N_total : 0.0;Which helps to prevent divide by zero errors, whilst keeping the whole definition of what I'm getting on one line ( ... )

Reply


bart_calendar March 3 2013, 12:39:17 UTC
The reason Obama can't make a deal with congress is because he's black and it pisses them off that we have a black president.

Reply


strawberryfrog March 3 2013, 12:51:05 UTC
So, if I read it right, he says (correctly) that lookup by name in a dictionary is slower than field lookup. But he fails to mention that in javaScript, lookup by name is all you've got. Field lookup, I assume, means using index or offset generated at compile-time from the name. There's no action to take after reading this: JS is still JS and either the JIT helps you out by turning dictionaries into structs, or it doesn't.

Reply

andrewducker March 3 2013, 12:51:58 UTC
Yup, that's the point he's making - that the language doesn't make anything available to make this faster.

Reply


nancylebov March 3 2013, 15:40:23 UTC
The Python link leads to a blank spot where the ability to start the lecture should be. Other speeches lead to a screen which has the usual video controls, but nothing happens except for a green bar starting at the bottom. This is amusing for a site which promises that no glitch video streaming.

Thanks for the procrastination link. The general approach is gentle and sensible and doesn't try to tell me I ought to be more motivated. I needed that.

Reply

drdoug March 3 2013, 21:02:48 UTC
The Python thing did just the same for me, but a load of annoyed clicking in the box where I thought the presentation should be suddenly made the first slide appear, and I got the rest by clicking there too.

Reply


skreidle March 3 2013, 19:16:28 UTC
I'm a consummate procrastinator -- I should be vacuuming& mopping or showering right now, and have a not-small amount of Extremely Important Paperwork due by Thursday, which I've barely started, and which will certainly take multiple days, but I'm reading LJ instead -- but I don't have performance- or critique-anxiety. Dunno.

Reply


Leave a comment

Up