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

Pages: 1-4041-

for(int i=0;i<1;i++)

Name: Anonymous 2012-10-29 13:02

if(1){
DoThis();
}
else{
DoThat();
}

Name: Anonymous 2012-10-29 13:09

for(int i = 0; i < 1; ++i)

if(1){
    DoSomething();
}else{
    DoSomethingElse();
}

Name: Anonymous 2012-10-29 13:14


for(int i = 0; i < 10; i++)
{
    switch(i)
    {
        case 0: doFirst();
        case 1: doSecond();
        case 2: doThird();
        case 3: doFourth();
        case 4: doFifth();
        case 5: doSixth();
        case 6: doSeventh();
        case 7: doEighth();
        case 8: doNinth();
        case 9: doTenth();
    }
}

Name: Anonymous 2012-10-29 13:37

one iteration

why.jpeg

Name: Anonymous 2012-10-29 13:42

>>4
back-to-g.tar.gz.jpeg.gay.i.love.imagereddits

Name: Anonymous 2012-10-29 13:50

>>5
tar -zxvf polecatkebabts.tar.gz

Name: Anonymous 2012-10-29 13:51

>>5
redditt? you mean "back to the imageboards", sonny... these textboards wouldn't exist without 'em

but we're all 4chan family here

Name: Anonymous 2012-10-29 13:52

for(int i = 0; i < 1; i++)
{
        if(1)
                DoSomething();
        else   
                DoSomethingElse();
}

Name: Anonymous 2012-10-29 13:53

>>7
2channel predates Futaba Channel.
world2ch predates 4chan.
4chan was the first board with image replies.

Name: Anonymous 2012-10-29 13:57

int counter = 0;
for(;;) {
    if(counter < 10) {
        DoSomethingBro();
    } else {
        break;
    }
    counter++;
}

Name: Anonymous 2012-10-29 14:18

>>10
thats how men do for-loops

Name: Anonymous 2012-10-29 14:22

>>11
No, that would be called recursion you uncultured pig. Back to Hecker Naws, ``please!''

Name: Anonymous 2012-10-29 14:30

>>12
LOL that's not fucking recursion, you shitty programmer.

Name: Anonymous 2012-10-29 14:35

>>12
recursion

nope.tiff

The following two pieces of code perform the exact same loop. Test it yourself if you don't believe me.

Loop #1

for(int counter = 0; counter < 10; counter++) {
        DoSomethingBro();
    }


Loop #2

int counter = 0;
    for(;;) {
        if(counter < 10) {
            DoSomethingBro();
        } else {
            break;
        }
        counter++;
    }

Name: Anonymous 2012-10-29 14:36

>>13
Indeed. Expert schemers such as myself have no need for iteration such as your infantile, ``for-loops.'' I'm sorry if you misinterpreted my post, English is a language far inferior to LISP in terms of expressiveness and concision.

Name: Anonymous 2012-10-29 14:38

Fact: Nothing posted in this thread so far has been recursive.

Name: Anonymous 2012-10-29 14:44

lol u tk him 2 da bar|?

Name: Anonymous 2012-10-29 14:55

bool isEqual(int a, int b) {
    if (a == b) {
        return true;
    } else if (a != b) {
        return false;
    } else {
        printf("Error");
    }
}

Name: Anonymous 2012-10-29 15:03

>>18
not using constant reference params
using braces for one-line conditionals
bool isEqual(const int &a, const int &b) {
    if (a == b)
        return true;
    else if (a != b)
        return false;
    else
        printf("Error");
}

Name: Anonymous 2012-10-29 15:08

bool isEqual(const int &a, const int &b) {
WHAT.THE.FUCK.

Name: Anonymous 2012-10-29 15:10

>>20
pass by value
pass by reference
LOOK.IT.UP.

Name: Anonymous 2012-10-29 15:11

>>21
I'm sorry I assumed it was C.

Name: Anonymous 2012-10-29 15:11

using a for instead of a while to demonstrate that a for loop is a specific case of a while loop
You faggots are like people who think using a word's original meaning and its newer meaning together is a ``pun''.

Name: Anonymous 2012-10-29 15:17

>>23
Where do you see a while loop in this thread? Nobody's talking about while loops here.

Name: Anonymous 2012-10-29 15:20

>>18,19
The error branch should also exit the process (or halt the machine in case you're making an OS), since it is obvious that if it's triggered, it must have been caused by a protection fault unless you're writing self-modifying code.
(I sincerely hope you're not writing non-self-modifying code and not protecting the memory.)

Name: Anonymous 2012-10-29 15:25

>>25

What is shared memory?

Name: Anonymous 2012-10-29 15:28

>>25

and What is operator overloading?

Name: Anonymous 2012-10-29 15:33

>>27
He is only comparing ints. You can't overload an operator of only primitive types.

Name: Anonymous 2012-10-29 15:37

>>28
Hell you can't, it is perfectly computable.

Name: Anonymous 2012-10-29 15:45

>>29
I suppose you can if you do stupid shit like
#define int MyOwnSuperGayType
but yeah, this discussion is becoming too pedantic. Why not make your own programming language while you're at it if you want to go full retard.

Name: Anonymous 2012-10-29 15:49

I can never tell apart C code from C++ code.

Name: Anonymous 2012-10-29 15:52

>>31
That's because a large number of C++ developers are faggots that think it's still a good idea to write in C while using C++.

Name: Anonymous 2012-10-29 15:55

>>16
I feel like the only person to 'get' this post

Name: Anonymous 2012-10-29 16:18

Use D

Name: Anonymous 2012-10-29 16:19

>>33
You're not some special snowflake fagstorm

Name: Anonymous 2012-10-29 16:43

>>35
Do you 'get' it?

Name: Anonymous 2012-10-29 16:54

>>36
Yes, now fuck off back to /r/programming

Name: >>18 2012-10-29 17:23

>>19-22,25-30

Holy shit, I was just making fun of the horrible code in this thread. Of course the third branch makes no fucking sense. Here's a hint: the entire function is just an awfully complicated and buggy rewording of a == b.

Name: Anonymous 2012-10-29 18:07

==D

Name: Anonymous 2012-10-29 18:17

>>38
YHBT

Name: Anonymous 2012-10-29 18:24

>>40
Is that like YOLO?

Name: Anonymous 2012-10-29 18:26

>>41
FIOC

Name: Anonymous 2012-10-29 18:37

>>18
uhhh that is needlessly complicated.... just do this:

bool isEqual(int a, int b) {
    if (isEqual(a, b)) {
        return true;
    } else {
        return false;
    }
}

Name: Anonymous 2012-10-29 20:48

if [ $dubs = true ]
then
checkem
fi

Name: Anonymous 2012-10-30 0:47

>>27
Under what circumstances could it possibly be useful to overload the comparison operators in such a way as to render them intransitive? If you've done that you've already blown your leg off and are walking around on the stump.

Name: Anonymous 2012-10-30 23:54

>>43
I especially like that your code terminates

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