5 ms·
One class, or volcano, of bugs is sacredly kept only for the poor souls whos ancestors believed writing from right to left was the greatest idea ever (possibly
by avip 8y ago
One class, or volcano, of bugs is sacredly kept only for the poor souls whos ancestors believed writing from right to left was the greatest idea ever (possibly after Monotheism). Try to write in multiple columns format in an RTL lang, then come back speaking of bugs. Then try a mixed RTL/LTR in a bulletin list. One would have thought bidi would be a solved issue in 2019, yet it consistently breaks every text editor ever made on earth.
- jacquesm 8y agoThat one should be #1 on that list of 'assumptions programmers make', with #2 being that a byte is 8 bits.
- erikpukinskis 8y agoThose don't seem equivalent. One affects a billion or so people. The other will only cause trouble in rare cases, no?
- Cogito 8y agoThe assumption that 'a byte is eight bits' is less specific than 'a character is one byte is eight bits' but I think captures it pretty well and affects at least all the people who are affected by RTL writing, I would think. If anything, the one character -> eight bits problem was so large huge amounts of work has been put into developing and using libraries that abstract the representation of text away from byte streams.
- quietbritishjim 8y ago"one byte is eight bits" is extraordinarily different from "one character is eight bits". In fact, by conflating them you are implicitly making the assumption that one character is one byte, which is exactly what your comment is really warning against.
- Cogito 8y agoI agree with you, but was trying to illustrate an example from the class of 'one byte is eight bits' style assumptions. Hopefully I made it clear that 'one character -> one byte -> eight bits' is an assumption that can cause a lot of pain. The simplest usage of non-standard character bytes I can think of from the top of my head is in SMS (as described in that interesting article that was submitted these last few weeks sometime) where the standard used 7-bit character bytes in order to get longer messages, and then struggled to deal with international character encodings. Maybe it's drawing a long bow, but I think this specific example is of the same class of assumptions that jacquesm was describing when they said "a byte is 8 bits", and clearly this is a problem that will not "only cause trouble in rare cases".
- oblio 8y agoFor all intents and purposes, a byte should be 8 bits. Standardization is good. All those ancient systems should just die, at this point.
- rkangel 8y agoThen add a dollar to every microwave, washing machine, fridge, doorbell or other device with a hint of processing that uses a small embedded processor. Optimising transistor gate count for simplistic application is absolutely worth doing, even if you end up with an architecture that doesn't happen to be the same as expected by people who have only ever programmed for x86.
- oblio 8y agoThat's absolutely ridiculous. Don't tell me that if we really wanted to move 7 bit or whatever other wacky architectures to 8 bits, their price would go up by 1 dollar... x86 is far from the only 1 byte = 8 bits architecture... PowerPC, SPARC, Itanium, ARM, MIPS, heck, I'm having a hard time remembering major non 8 bit-multiple architectures.
- rkangel 8y agoI was exaggerating a little for effect, but not dramatically so, once you take the multiplicative effect between BOM cost and price on the shelf. To give you one example of a non-8 bit architecture, I used to work on CSR Bluetooth devices. For a while, the third most popular architecture was a little known thing called XAP, because it was in all of the 1-2 billion chips that CSR had made. XAP is a 16 bit processor in every way you can be a 16 bit processor: both the size of a byte (minimum addressable memory size) and the size of a word (size used for compilation) was 16 bit. You couldn't sub-address any larger types to serialise data. Also, the code space was separate from data space, and so function pointers were 24 bit (2 words). This meant that a lot of casting that developers take for granted wasn't possible (e.g. store a pointer in an int). All of these choices meant that the XAP was very low gate count, and so very power and cost efficient for a surprisingly capable little processor.
- gipp 8y agoI had to do exactly this for my ketubah for my wedding, can confirm it was a nightmare. Had never done RTL before, let alone both on one line. Took fully half an hour just to make 4 signature lines with labels