is the only way to do it in C. You can't simply go (char) a = 0x0F; because it's ``not a valid lvalue.'' Put C back where it belongs, in the garbage. It was a DSL for building Unix no wonder that's such shit too. We can do better now.
Name:
Anonymous2012-08-03 1:08
By the way, note how stupid the naming of types is. char and int instead of byte and word. As if all characters could be represented with CHAR_BITS-bits and 16-bits where enough to encode the entirety of ℤ.
>>11 Last week i bought a chain-saw with a twisted handle. Perhaps i wasn't careful, but by accident it chopped one of my arm off, then i thought to myself “gosh, this is POWERFUL!”. This seems to be the fashionable mode of thinking among the unixers or unixer-to-be, who would equate power and flexibility with rawness and complexity; disciplined by repeated accidents. Such a tool would first chop off the user's brain, molding a mass of brainless imbeciles and microcephalic charlatans the likes of Larry Wall and Linus Torvald jolly asses. —Xah Lee
Name:
Anonymous2012-08-03 6:27
>>12
The thing about C is: if you ended up cut off your own arm with it, you're the one who cut off your own arm.
>>13
The problem is that C encourages arm-cutting with its inconsistent syntax and base types.
Name:
Anonymous2012-08-03 6:31
Xah Lee is a fucking fag.
But C is undefined shit.
Name:
112012-08-03 7:19
>>12
Xah Lee is a fucktard, though I would agree to this quote in general, though it's inapplicable here.
C has many flaws but the way you are supposed to replace the LSByte of a number doesn't involve any. It must be done the way I wrote it, it's safe, clean, readable, and easily scaled to more complex bit-twiddling operations. Moreover, it's about the only obviously standards compliant way to do it, doing shit with pointers breaks on different endianness, doing shit with shifts and divisions might actually be undefined for signed values.
So it's not a "chainsaw with a twisted handle", the handle is straight and comfortable, and anyone who bothered to skim through the Standard knows where it's located.
The problem we have here is that OP is a faggot, and didn't read anything about C, much less the Standard, and found one of the more ass-backwards ways to do kind of what he wants, in an ugly and non-portable way.
You can't make a chainsaw that somehow prevents a retard from holding it by the hand guard, then complaining that the "handle" is twisted and too close to the chain.
Name:
Anonymous2012-08-03 7:23
If C is a chainsaw, Haskell is a spoon. (Its possible to chop wood with spoons, it just takes time)
If C is a chainsaw, C++ is a swiss army guillotine.
Name:
Anonymous2012-08-03 8:11
If C is a chainsaw, Python is a toy gun.
Name:
Anonymous2012-08-03 8:22
If C is a chainsaw, then BBcode is my doubles.
Name:
Anonymous2012-08-03 8:39
If C is a chainsaw, assembly is a diamond scalpel.
Name:
Anonymous2012-08-03 8:46
C is the most widely used programming language on the planet.
You say it's shitty.
Yes, some aspects are shitty, but less shitty than _all_ the rest.
The only imperative language that could be better is Go.
Haven't tried it yet, though.
>>37
There's a reason that page doesn't exist outside of Google's cache anymore.
Name:
Anonymous2012-08-06 23:45
lel
Name:
Anonymous2012-08-07 0:05
We can do better now.
already did: it's called Javascript
the performance of raw ASM, the elegance of Scheme, and the design principles of C++
all in a modern and obscenely powerful dynamic language with flawless semantics
and yet people insist on trash like:
- C: undefined shit
- Haskell: flavor of the week ``functional'' trash
- Perl: *^&%&)&*(&*(^^%^))_++_(*^&(^*()*)_
- Python: FIOC
- Ruby: LOL RAILS ROCKSTAR xD
- Lua: 1-based and completely crippled in every aspect
- PHP: babby's first web language
- Clojure: shitmeal with jvm clippings
- Rust: the name describes it quite well. probably the only honest language here
- Go: fuck yourself
Name:
Anonymous2012-08-07 0:10
>>40 the performance of raw ASM, the elegance of Scheme, and the design principles of C++
You don't know what you're talking about.