If you're doing device drivers in an interpreted language, you're a fucking moron.
I guess that's why OpenFirmware never really caught on. The IEEE withdrew the standard for it, because those "fucking morons" at the OFWG didn't reaffirm the standard. Maybe they wised up to your level?
You still have to know to put the pointer in the list, which inserts inline code on many paths. (Maybe not as heavy as a call to free() or delete, but it is more code.
A better strategy for some apps is to have "arenas" that you allocate from for certain phases of processing. When you're done with objects from that arena, just forget the pointer (a'la Java, where you just drop your references to an object), and when that phase of processing completes, just reset the entire arena in a single step.
Methods/functions/procedures don't always have more overhead than a nested-if. If they're only called from a few places, they'll get inlined everywhere. If they're called from many places, the reduction in codesize may end up giving a net benefit in program cache behavior.
In the end, it's unlikely that you'd measure a run-time difference in anything but the most time consuming parts of your code. Given that, it seems like the focus should then rest on the speed of development and the ease of maintenance, as opposed to the cycle count of the functions themselves.
It gets even more important when bar(); is something more like the Linux kernel's "BUG" macro, that expands out with __FILE__ and __LINE__ macros in it.
You see, sometimes you can subtly format your code such that the physical layout highlights the similarites and regularity of the code, and the text that remains highlights the differences. (Also, tools like "rectangular cut-n-paste" work well with code like that....) Automatic reformatters don't see that subtle layer of structure and destroy it.
That's why I'll only use them as a phase of cleaning up some horribly tab-damaged sh*t.
no, for me, it's when you are 15 levels of branches and loops deep and you have all the white space on the left...
If you're nested that deeply, then perhaps it's time to reconsider your coding style. More than 4 or 5 levels is a serious warning. There are these great new inventions called "functions" and "procedures" that might help.
I personally prefer to have two or three tall, thin windows. I can't do that if the text is wider than 80 columns.
For all my stuff I'm an 80-column bigot. If your line of
code is that long, break it up into shorter segments. For instance, even chained "if" clauses can be wrapped onto multiple lines. It's much clearer that way, at least to me.
There are times when wider-than-80 is appropriate. For instance, tabular data works well in a wide format. Typical code, however, rarely suffers at the hands of 80 columns.
In some cases, the wrongness is simply horrible grammar. For instance, I can't tell what this actually means, since it isn't even a complete sentence: "In header files whether functions are declared or defined?"
You know, if you're going to ask a subtle question (what's the difference between declaration and definition, and which one belongs in a header file?), you need to word it so it's unambiguous.
They mention in the article that the current system, put in place in 1981, was designed to last 30 years. That's 2011. Now they say they'll run out by the end of the decade. That's 2010. Wow, a whole year short of plan?
Also, it sounds like with very minor tweaks, they could get another 30 years out of the system. Beautiful!
If car makers could step back from their ego slightly, and use more than one "division" character for each division, you'd get even more encoding space. The "division" is basically a subcategory of manufacturer, and is encoded in the 3rd digit. For US VINs, a 'G' in the second position is GM. A '2' in the third position means 'Pontiac'. What if they used more characters there to also mean Pontiac? Ditto for GMs other divisions? Heck, what if we used multiple 'make' designations for GM? Why only "G"?
Most of the time, I hate "rich, interactive" websites. I want the freakin' thing to sit still and give me the information I came for.
Yeah, the web will be rich alright. Nice, rich manure.
Really, my complaint isn't with plugins, per se. It's with the lack of restraint that web designers have in using them. Some web sites, such as Homestar Runner, wouldn't exist without Flash. Most other places I see it used, it adds nothing to the site except a layer of complexity, or it pummels me with advertisements.
I think you mean "highest gear possible," right? As in, lowest RPM for the given speed.
I do the same on my car. After having it this long, I know where all the shift points are, and I let off the gas just ahead of where it might shift just to trigger the shift a little early. Then, once it's shifted, I give a little gas back so that I can keep accelerating (albeit more slowly) in the higher gear.
Actually, if your gas mileage goes UP suddenly, that too can be a warning sign. My gas mileage went up when my transmission was going out and when my alternator died.
My dad used to work in the factory where they build the 3800. A scary proportion of the guys there had 30+ years seniority. For many of those guys, a big portion of those years were spent building that engine. Probably has something to do with it.
He told me about this 3800 that GM bought back from a cab company in New York. The engine had well over 300,000 miles on it. GM bought it back to do failure analysis on it. Afterwards, they built a display out of it in the entrance to the plant.
*sigh* Buick City in Flint is no longer. "Buick City is Dead! Long live Buick City!"
(Yes, I'm from Flint. Yes, I recognize some of the areas Michael Moore uses in his films. Courtland Center Mall (featured in F9/11) is not far from my dad's place. I eat coneys there when I go home.)
Damn it, caught me also. I just posted a very similar post (only I don't have the noxious upgrade), mentioning similar stats. (I too have a 3.4" pulley, a CAI and a computer upgrade.) And, my next car will be a GTO...:-)
One thing that bears mentioning: The EPA stats are based on emissions in a set of short tests. I would imagine a larger, heavier car having more consistent mileage than a smaller car, since it will be less susceptible to many variables.
For instance, small hills, wind, AC--those will be eaten up by the momentum of the vehicle and the relatively larger power-plant. In contrast, a smaller vehicle with a lesser power plant will have a much higher range of loading due to these inputs.
One downside a larger car will see is a greater penalty for stop-n-go driving. Accelerating and decelerating all that mass eats up a lot in the 0.5*m*v*v. But again, the EPA estimate takes that into account already, indicating it'll probably be most accurate for cars most similar to the boats moored out in the parking lot at the time they set the standard.
Oh, and FWIW, it'll still do 97 MPH in second gear, even with all those miles on it. (Thanks to a computer from ZZ Performance, and a few other upgrades.) That 3800 Series II is a damn fine engine.
I own a 1997 Pontiac Grand Prix GTP (supercharged 3.8L V6). The window sticker claims "18 city, 28 highway." It's been damn near dead-on.
When I lived within 10 miles of work (Richardson/Dallas TX area), I was getting 17.6, according to the onboard computer. When I drove it on long trips on the highway--i.e. drive it up to Michigan from Texas--I'd start out getting around 30, and it'd drop to about 28.6 by the end of the trip. If I really feathered the accelerator when entering the freeway after a rest-stop, I could sometimes keep it at 30 for the trip, but that's pushing it.
In the 215,000 miles I've driven the car (I still have it and I drive the heck out of it), the gas mileage hasn't strayed much. It went up for awhile when my transmission was going out, by virtue of the fact I only had 1st gear half the time. Repairing that brought my mileage back down, in return for actually being able to accelerate. My highway mileage went as high as 32, right before my alternator died. (It was probably already dead, actually.) Repairing that brought me back to par. When my catalytic converter went, my mileage dropped to around 15-16 MPG. Fixing that brought it back up.
Right now, I live in Arlington, TX, and I have a fairly long commute back over to northeast Dallas. I drive the car hard, though, and get about 19 - 20 MPG (closer to 19). Given that my current driving mix is between highway and city, though, that's about right.
I guess that's why OpenFirmware never really caught on. The IEEE withdrew the standard for it, because those "fucking morons" at the OFWG didn't reaffirm the standard. Maybe they wised up to your level?
--JoeYou still have to know to put the pointer in the list, which inserts inline code on many paths. (Maybe not as heavy as a call to free() or delete, but it is more code.
A better strategy for some apps is to have "arenas" that you allocate from for certain phases of processing. When you're done with objects from that arena, just forget the pointer (a'la Java, where you just drop your references to an object), and when that phase of processing completes, just reset the entire arena in a single step.
--JoeMethods/functions/procedures don't always have more overhead than a nested-if. If they're only called from a few places, they'll get inlined everywhere. If they're called from many places, the reduction in codesize may end up giving a net benefit in program cache behavior.
In the end, it's unlikely that you'd measure a run-time difference in anything but the most time consuming parts of your code. Given that, it seems like the focus should then rest on the speed of development and the ease of maintenance, as opposed to the cycle count of the functions themselves.
Just a thought.
--JoeIt gets even more important when bar(); is something more like the Linux kernel's "BUG" macro, that expands out with __FILE__ and __LINE__ macros in it.
I find tools like GNU indent to be handy for fixing grossly misformatted code. I don't like what they do to the subtlties of good code formatting.
For instance, suppose I'm doing the same operation with different parameters. Something like this (with periods to show the spaces):
Now what happens if I run this through the typical code autoformatter? I get something like this:
You see, sometimes you can subtly format your code such that the physical layout highlights the similarites and regularity of the code, and the text that remains highlights the differences. (Also, tools like "rectangular cut-n-paste" work well with code like that....) Automatic reformatters don't see that subtle layer of structure and destroy it.
That's why I'll only use them as a phase of cleaning up some horribly tab-damaged sh*t.
--JoeTo fix the formatting: GNU indent
To print it nicely when you're done: vgrind
You're welcome.
--JoeI believe 132 was also the limit imposes by dot matrix printers in "condensed" mode. I recall the old "green-bar" paper having a similar column count.
If you're nested that deeply, then perhaps it's time to reconsider your coding style. More than 4 or 5 levels is a serious warning. There are these great new inventions called "functions" and "procedures" that might help.
</snarky>
--JoeI personally prefer to have two or three tall, thin windows. I can't do that if the text is wider than 80 columns.
For all my stuff I'm an 80-column bigot. If your line of code is that long, break it up into shorter segments. For instance, even chained "if" clauses can be wrapped onto multiple lines. It's much clearer that way, at least to me.
There are times when wider-than-80 is appropriate. For instance, tabular data works well in a wide format. Typical code, however, rarely suffers at the hands of 80 columns.
--JoeAt least they didn't do it by Dutch Oven...
I'm sorry, but the original Compuserve spec and software actually states that the soft-G is the correct pronounciation of GIF.
I bet you also pronounce /bin and /lib as "bine" and "libe" (long I instead of short I).
As someone else pointed out the JPEG format is "jay-fiff", not "jiff".
--JoeIn some cases, the wrongness is simply horrible grammar. For instance, I can't tell what this actually means, since it isn't even a complete sentence: "In header files whether functions are declared or defined?"
You know, if you're going to ask a subtle question (what's the difference between declaration and definition, and which one belongs in a header file?), you need to word it so it's unambiguous.
--JoeThey mention in the article that the current system, put in place in 1981, was designed to last 30 years. That's 2011. Now they say they'll run out by the end of the decade. That's 2010. Wow, a whole year short of plan?
Also, it sounds like with very minor tweaks, they could get another 30 years out of the system. Beautiful!
If car makers could step back from their ego slightly, and use more than one "division" character for each division, you'd get even more encoding space. The "division" is basically a subcategory of manufacturer, and is encoded in the 3rd digit. For US VINs, a 'G' in the second position is GM. A '2' in the third position means 'Pontiac'. What if they used more characters there to also mean Pontiac? Ditto for GMs other divisions? Heck, what if we used multiple 'make' designations for GM? Why only "G"?
So what's the issue again?
--JoeI hear ya. I need to re-install the click-to-play thingy, since I'm tired of dismissing those popups.
Can't you just wipe them, verify them, and install them in someone else's machine eventually? (After the approx 1wk period, that is?)
Having a separate drive makes it easier to not nuke the customer's data files. See the bit where he mentions "backup folder."
Most of the time, I hate "rich, interactive" websites. I want the freakin' thing to sit still and give me the information I came for. Yeah, the web will be rich alright. Nice, rich manure.
Really, my complaint isn't with plugins, per se. It's with the lack of restraint that web designers have in using them. Some web sites, such as Homestar Runner, wouldn't exist without Flash. Most other places I see it used, it adds nothing to the site except a layer of complexity, or it pummels me with advertisements.
--JoeI think you mean "highest gear possible," right? As in, lowest RPM for the given speed.
I do the same on my car. After having it this long, I know where all the shift points are, and I let off the gas just ahead of where it might shift just to trigger the shift a little early. Then, once it's shifted, I give a little gas back so that I can keep accelerating (albeit more slowly) in the higher gear.
--JoeActually, if your gas mileage goes UP suddenly, that too can be a warning sign. My gas mileage went up when my transmission was going out and when my alternator died.
My dad used to work in the factory where they build the 3800. A scary proportion of the guys there had 30+ years seniority. For many of those guys, a big portion of those years were spent building that engine. Probably has something to do with it.
He told me about this 3800 that GM bought back from a cab company in New York. The engine had well over 300,000 miles on it. GM bought it back to do failure analysis on it. Afterwards, they built a display out of it in the entrance to the plant.
*sigh* Buick City in Flint is no longer. "Buick City is Dead! Long live Buick City!"
(Yes, I'm from Flint. Yes, I recognize some of the areas Michael Moore uses in his films. Courtland Center Mall (featured in F9/11) is not far from my dad's place. I eat coneys there when I go home.)
--JoePS. To the other poster: I personally haven't had a mullet since 1992, and don't plan to grow one ever again. ;-)
Damn it, caught me also. I just posted a very similar post (only I don't have the noxious upgrade), mentioning similar stats. (I too have a 3.4" pulley, a CAI and a computer upgrade.) And, my next car will be a GTO... :-)
One thing that bears mentioning: The EPA stats are based on emissions in a set of short tests. I would imagine a larger, heavier car having more consistent mileage than a smaller car, since it will be less susceptible to many variables.
For instance, small hills, wind, AC--those will be eaten up by the momentum of the vehicle and the relatively larger power-plant. In contrast, a smaller vehicle with a lesser power plant will have a much higher range of loading due to these inputs.
One downside a larger car will see is a greater penalty for stop-n-go driving. Accelerating and decelerating all that mass eats up a lot in the 0.5*m*v*v. But again, the EPA estimate takes that into account already, indicating it'll probably be most accurate for cars most similar to the boats moored out in the parking lot at the time they set the standard.
--JoeOh, and FWIW, it'll still do 97 MPH in second gear, even with all those miles on it. (Thanks to a computer from ZZ Performance, and a few other upgrades.) That 3800 Series II is a damn fine engine.
I own a 1997 Pontiac Grand Prix GTP (supercharged 3.8L V6). The window sticker claims "18 city, 28 highway." It's been damn near dead-on.
When I lived within 10 miles of work (Richardson/Dallas TX area), I was getting 17.6, according to the onboard computer. When I drove it on long trips on the highway--i.e. drive it up to Michigan from Texas--I'd start out getting around 30, and it'd drop to about 28.6 by the end of the trip. If I really feathered the accelerator when entering the freeway after a rest-stop, I could sometimes keep it at 30 for the trip, but that's pushing it.
In the 215,000 miles I've driven the car (I still have it and I drive the heck out of it), the gas mileage hasn't strayed much. It went up for awhile when my transmission was going out, by virtue of the fact I only had 1st gear half the time. Repairing that brought my mileage back down, in return for actually being able to accelerate. My highway mileage went as high as 32, right before my alternator died. (It was probably already dead, actually.) Repairing that brought me back to par. When my catalytic converter went, my mileage dropped to around 15-16 MPG. Fixing that brought it back up.
Right now, I live in Arlington, TX, and I have a fairly long commute back over to northeast Dallas. I drive the car hard, though, and get about 19 - 20 MPG (closer to 19). Given that my current driving mix is between highway and city, though, that's about right.
So all in all, I'd put the EPA estimate dead on.
--JoeYou're right. I realized that after I click "post." Ah well.