Follow Slashdot stories on Twitter

 



Forgot your password?
typodupeerror
×

Comment Re:Interesting since Aspartame spiked Sachirine (Score 1) 630

Stevia is, to me, the best tasting of the non-calorie sweeteners, and I use it in my coffee, and in my homemade grape soda.

I prefer stevia as well. But I find that I only like it in my tea and not in my coffee (although I used to like sugar in my coffee just fine). Out of curiosity, which brand of stevia do you like best? Maybe I need to switch.

Comment Re:History repeating (Score 2) 85

[...] early Apple III computers where heat would cause chips to expand out of their sockets, [...]

“It’s not wise to upset an Apple III.”
“But sir...no one worries about upsetting a Droid.”
“That’s ’cause a Droid don’t cause people’s chips to expand out of their sockets. Apple IIIs have been known to do that.”
“I suggest a new strategy, Artoo. Let the Apple III win.”

Comment Re: Tabs vs Spaces (Score 1) 428

I actually use spaces-only in my own personal code — personally, I hate tabs... BUT — on larger projects where tabs are part of the team culture, the rules listed really do work wonderfully. Everybody can have their own tabstop setting and nobody gets messed up by indentation. I agree that spaces will maintain what you want the code to look like regardless of what settings someone else's editor has, but you can get the same effect by using tabs intelligently. And finally, the example I gave with the for loop actually doesn't break readability at all — it works for tabstop of any size.

Comment Re:Tabs vs Spaces (Score 1) 428

Pretty much. And the issue is that tabs gone wrong is only visible once its viewed by someone with different settings.

Not exactly true. You can pretty easily write a tool that scans a source module for problematic mixing of tabs and spaces. Just require that all changes pass that scan before they are allowed to be checked in.

Comment Re: Tabs vs Spaces (Score 1) 428

Which only matters if all indentation, including alignment, is done with tabs. The moment you throw in a few spaces to line something up on a non-tab boundary (say, to align a second line of arguments with the first argument), then you have a mess, unless your tab width is set to exactly the value that whoever touched the code before you set it to.

What?? Nonsense. Using spaces to line something up on a non-tab boundary is exactly what avoids a mess, not creates it.

To use tabs in code, with zero problems whatsoever, follow these simple rules:

1. Use tabs only for indentation, never for alignment.
2. Tabs may never appear anywhere in the source code except as a contiguous sequence of zero or more tabs at the beginning of a line.
3. Use spaces for alignment, never for indentation.
4. Spaces may follow tabs, but tabs may never follow spaces.

All the lines in your module should match the following regex: /^\t*[^\t]*$/

If you have a for (...) loop that splits across three lines, there should be n tabs leading up to the for, and then on each of the following two lines there should be n tabs followed by 5 spaces, for proper alignment.

Comment Re:Too many pixels = slooooooow (Score 1) 263

Actually, there is no such thing as pure retina resolution. There is only retina resolution as a function of pixel density and viewing distance. So, 4k on a 32" monitor at an 24" viewing distance is retina resolution at typical viewing distance. However, 4k on a 32" monitor at much shorter viewing distance is not.

Comment Re:BCD mode (Score 1) 140

Actually, it was very useful when the 6502 was introduced. Remember, computers were slow back then. Converting a binary number to decimal was especially slow, since it involves division with remainder in a loop, once for each digit produce, and the 6502 had no hardware multiplication or division instructions.

Also — and this is even true today — if you do all your calculations in base 10 instead of binary, you get a different (sometimes more desirable) behavior of rounding. For example, financial calculations are almost always best done in base 10 rather than base 2. No self-respecting spreadsheet program does its financial arithmetic in base 2.

Comment Re:BCD mode (Score 1) 140

BCD mode is useful when you are working with numbers that you want to display to humans often. That is, you can do all the arithmetic in base 10 instead of binary. BCD is slower to work with than binary, but much faster to convert in and out of, since there's basically no conversion other than adding 0x30 (ASCII '0') to the nybble you want to display.

Working in binary, on the other hand, requires costly conversion in and out of human-readable decimal. For example, converting decimal to binary requires a costly multiplication (by 10) on each digit consumed, and converting back to decimal from binary requires a costly division (by 10) one each digit produced.

So for things like scores in games, yeah, BCD is a nice thing.

Comment Re:BCD mode (Score 2) 140

Hmm, you know what? Damn. I misremembered how it worked, and I didn't read closely enough at the link I provided. So, to stand corrected, the D flag was something you set (or cleared) proactively using the SED or CLD instruction. It actually indicated a mode you were in, rather than being a flag in the usual sense (such as a carry or a zero flag).

Slashdot Top Deals

THEGODDESSOFTHENETHASTWISTINGFINGERSANDHERVOICEISLIKEAJAVELININTHENIGHTDUDE

Working...