Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

why C is shit

Name: Anonymous 2012-08-03 1:03

int a = 0xFFFFFFFF;
*( (char *) &a ) = 0x0F;


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: Anonymous 2012-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 ℤ.

Name: Anonymous 2012-08-03 2:26

a &= ~0xF0;

0/10

Name: Anonymous 2012-08-03 3:02

>>3
Obfuscated and doesn't work if the low byte of a isn't all-ones.

Name: 4 2012-08-03 3:03

The lowest nibble actually, but you get the point.

Name: Anonymous 2012-08-03 3:13


a = ((a/256)*256)+255;

Name: Anonymous 2012-08-03 3:33

We can do better now.
I'm still waiting for BitC on LLVM

Name: Anonymous 2012-08-03 3:33

We can do better now.
I'm still waiting for BitC on LLVM

Name: Anonymous 2012-08-03 4:06

We can do better now.
It's called Lisp.

Name: Anonymous 2012-08-03 4:38

What you really want is this:
(let ((a #xffffffff))
  (setf (ldb (byte 8 0) a) #x0f))

Name: Anonymous 2012-08-03 5:58

>>1
This is not the way to do it in C.

The way to do it in C is a = (a & ~0xFF) | 0x0F;.

The shit you wrote does something entirely different on a big-endian architecture.

Pls go back to haskal and don't try to use C ever again, thxbye.

Name: Anonymous 2012-08-03 6:06

>>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: Anonymous 2012-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.

Name: Anonymous 2012-08-03 6:29

>>13
The problem is that C encourages arm-cutting with its inconsistent syntax and base types.

Name: Anonymous 2012-08-03 6:31

Xah Lee is a fucking fag.

But C is undefined shit.

Name: 11 2012-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: Anonymous 2012-08-03 7:23

If C is a chainsaw, Haskell is a spoon. (Its possible to chop wood with spoons, it just takes time)

Name: Anonymous 2012-08-03 7:27

is the only way to do it in C
No it's not. It's infact particularly bad coding style that you're showing here.

Name: Anonymous 2012-08-03 7:28

If C is a chainsaw, Lisp is a self-replicating, sentient robot that can evolve laser cutting hands in one generation.

Name: Anonymous 2012-08-03 7:49

If C is a chainsaw, C++ is a swiss army guillotine.

Name: Anonymous 2012-08-03 8:11

If C is a chainsaw, Python is a toy gun.

Name: Anonymous 2012-08-03 8:22

If C is a chainsaw, then BBcode is my doubles.

Name: Anonymous 2012-08-03 8:39

If C is a chainsaw, assembly is a diamond scalpel.

Name: Anonymous 2012-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.

Name: Anonymous 2012-08-03 8:51

>>24
Horribly misguided.

Name: Anonymous 2012-08-03 9:18

>>24
Go is fucking shit, kill yourself google kike

Name: Anonymous 2012-08-03 13:10

>>23
A diamond scalpel would probably break the first time you tried to use it, if not before then.

Name: Anonymous 2012-08-03 13:28

LINUS TORVALD JOLLY ASSES

Name: Anonymous 2012-08-03 13:37

>>26
You just hate it because you can't stand anything good.

Name: Anonymous 2012-08-05 22:20

C may be is flawed, but at least it's better than C++.

Name: Anonymous 2012-08-05 22:26

>>30
Sepples is garbage, but it is useful garbage.

Name: Anonymous 2012-08-05 22:34

>>27
The edge is made of diamond, not the entire thing you fucking aspie.

Name: Anonymous 2012-08-05 22:41

>>32
Okay, only the edge will break. I don't see how that's much (if any) better.

Name: Anonymous 2012-08-05 23:03

>>32
I truly love seeing your butthurt feelings and rage.

Name: Anonymous 2012-08-05 23:25

>>33
Have you never heard of a diamond saw?

Name: Anonymous 2012-08-05 23:32

>>35
A scalpel is not a saw.

Name: Anonymous 2012-08-05 23:36

>>36
www.asds.net/_NewsPage.aspx%3Fid%3D1366%26terms%3Dsynthetic+&cd=5&hl=en&ct=clnk&gl=us&;client=firefox-a" target='_blank'>http://webcache.googleusercontent.com/search?q=cache:SXAr7WQnASIJ:www.asds.net/_NewsPage.aspx%3Fid%3D1366%26terms%3Dsynthetic+&cd=5&hl=en&ct=clnk&gl=us&;client=firefox-a

IHBT

Name: Anonymous 2012-08-06 0:09

>>37
There's a reason that page doesn't exist outside of Google's cache anymore.

Name: Anonymous 2012-08-06 23:45

lel

Name: Anonymous 2012-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

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List