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

Pages: 1-4041-

Tabs VS Spaces

Name: Anonymous 2009-03-10 22:42

Which do you prefer in your code?
Personally I like tabs more but they're misused for formatting instead of indentation by many which is annoying and kind of defeats the purpose.

Name: Anonymous 2009-03-10 23:03

Tabs are `4' spaces, so I am not sure what the question is.

Name: Anonymous 2009-03-10 23:04

My tabs make spaces.

Name: Anonymous 2009-03-10 23:07

tabs are waaaay better the spaces for code.  4-8 key presses to indent/un-indent vs 1 key press.  Any good editor has options to set how long the tabs are, so you can set any tabbed code to your liking(even you, 3 spacer).

Name: Anonymous 2009-03-10 23:13

>>2
>>3
faggots

Name: Anonymous 2009-03-10 23:15

Emacs indents my code automatically, so I do not bother with these trifles.

Name: Anonymous 2009-03-10 23:21

123 abc

Name: Anonymous 2009-03-10 23:31

>>4

really?
   even
      me?
         :D

Name: Anonymous 2009-03-10 23:31

Visual Studio writes my code automatically, so I don't have to bother with these trifles.

Name: Anonymous 2009-03-11 1:12

>>6
Emacs
0/10

>>9
Visual Studio
3/10

Name: Anonymous 2009-03-11 2:19

>>10
Rating posts
( ≖‿≖)

Name: Anonymous 2009-03-11 2:26

>>1
I used to be in the "tabs for indentation, spaces for formatting" camp, until I realized that I spent too much time worrying about whether my editor was inserting tabs or spaces in the places I wanted, so I switched to spaces-only.

Name: Anonymous 2009-03-11 3:45

I program exclusively in piet, so I don't have to deal with indentation.

Name: Anonymous 2009-03-11 4:39

This is why I don't indent my code; no one can agree. FIOC be damned.

Name: Anonymous 2009-03-11 4:53

i write run-length-encoded brainfuck, with no whitespace.

Name: Anonymous 2009-03-11 5:07

I code in Whitespace, with no comments.

Name: Anonymous 2009-03-11 5:33

I use Python. I can use both tabs and spaces!

Name: Anonymous 2009-03-11 5:34

>>17
Die in a fire.

Name: Anonymous 2009-03-11 6:41

I use python and vim with 'set list' (shows special characters such as tabs) and tab-size set to 7. Thus if I indent, say, a line with 'if something:' by seven spaces and the next lines with the if-block contents by one tab, python understands the indentation (since it thinks tab is 8 spaces), while I have nicely aligned code with dark blue '>' characters (set by 'listchars') showing me which code is 'indented'.

Name: Anonymous 2009-03-11 10:41

>>11
( ≖‿≖)
    ( ≖‿≖)

Name: Anonymous 2009-03-11 11:44

>>19
People like you are why programming indentation into a language's syntax is fucking dumb.

Name: Anonymous 2009-03-11 11:56

I use tabs for indentation levels and spaces for positioning within a level.

Name: Anonymous 2009-03-11 12:06

I don't indent.

Name: Anonymous 2009-03-11 12:57

>>1
formatting
indentation

How are they different?

Name: Anonymous 2009-03-11 13:48

>>24
Indentation:
int main() {
    return 0;
}


Formatting:
int shortVarName              = 1;
int veryLongAndUselessVarName = 0;

Name: Anonymous 2009-03-11 13:59

>>25
K&R style considered PIG DISGUSTING.

Name: Anonymous 2009-03-11 14:20

>>26
That's not even K&R, because K&R still put functions' braces on separate lines.


#include <stdio.h>
#include <string.h>

int main(int argc, char *argv[])
{ // <-- THIS IS ALWAYS THE RIGHT WAY, FAGGOTS.
    int i;
    size_t arg_len;

    for(i = 0, arg_len = 0; i < argc; ++i) { // <-- THIS IS OK.
        printf("%i: %s\n", i, argv[i]);
        arg_len += strlen(argv[i]);
    }

    printf("Length of arguments: %zu\n", arg_len);
    return 0;
}

Name: Anonymous 2009-03-11 14:23

VS vs vs

Which do you prefer in your code?
Personally I like vs more but they're misused for comparison instead of contrast by many which is annoying and kind of defeats the purpose.

Name: Anonymous 2009-03-11 14:46

>>27
THIS IS OK.
You're a flaming faggot, that's what I think. Do you really enjoy two closing and a single opening paren on the left side of your code? Woah, that's beyond me. No, seriously, doesn't it bother you that the function parens are lined up, but the loop ones are not?

Name: FrozenVoid 2009-03-11 14:56

#include <stdio.h>
#include <string.h>
int main(int argc, char *argv[]){int i;size_t arg_len;for(i=0,arg_len=0;i<argc;++i){
printf("%i: %s\n",i,argv[i]);arg_len+= strlen(argv[i]);}printf("Length of arguments: %zu\n",arg_len);return 0;}

___________________________________________
If there is no struggle, there is no progress.

Name: Anonymous 2009-03-11 14:57

This is a stupid thread.

Name: Anonymous 2009-03-11 15:35

>>29
Parens? Do you mean braces? And if so, please clarify what you mean. I actually prefer the BSD/Allman style, but I've occasionally used K&R, but only in C code: for C++, C#, Java, or any other braces language, I use BSD style.

Name: Anonymous 2009-03-11 15:36

>>26
Bashing my indentation style seriously offends me. Please stop.

Name: Anonymous 2009-03-11 15:40

>>30
for(i=0,arg_len=0;i<argc;++i)
Lol

Name: Anonymous 2009-03-11 15:40

i use a same-line opening brace on functions in c

Name: Anonymous 2009-03-11 15:47

>>25
Oh.

Also, I don't understand why anyone would use
while (true) {
    fork();
}

This braces placement is PIG DISGUSTING

Be consistent; use either
while (true) {
    fork(); }

or
while (true)
{
    fork();
}

Name: Anonymous 2009-03-11 15:49

>>36
It doesn't waste a whole 2 lines on braces while still clearly delimiting blocks

Name: Anonymous 2009-03-11 15:50

>>36
YOU are pig disgusting

Name: Anonymous 2009-03-11 15:51

lolling all the way to the bank

Name: Anonymous 2009-03-11 15:52

>>36
You're mom is PIGDISGUSTING. Go away with your fugly braces placement.

Name: Anonymous 2009-03-11 17:10

>>40
say that to my face fucker not online and see what happens

Name: Anonymous 2009-03-11 17:11

>>41
EXPERT INTERNET TOUGH GUY

Name: Anonymous 2009-03-11 17:47

>>42
EXPERT POST COMMENTER

Name: Anonymous 2009-03-11 21:10

>>41
What about your facefucker?

Name: Anonymous 2009-03-11 21:18

>>37
What next, are empty lines between code blocks wasteful?

Name: Anonymous 2009-03-11 21:56

I do it like this:

int main() {
    for(int i1=0;i1<=255;i1++) {
        for (int i2=0;i2<=255;i2++) {
            for(int i3=0;i3<=255;i3++) {
                for(int i4=0; i4<=255; i4++) {
                    printf("%d.%d.%d.%d\n", i1, i2, i3, i4); }}}}}

I think it's very elegant and readable. It also saves a lot of useless lines.

Name: Anonymous 2009-03-11 22:22

>>46
int main()
{ for(int i1=0;i1<=255;i1++)
  { for (int i2=0;i2<=255;i2++)
    { for(int i3=0;i3<=255;i3++)
      { for(int i4=0; i4<=255; i4++)
        { printf("%d.%d.%d.%d\n", i1, i2, i3, i4); }}}}}

is better.

Name: Anonymous 2009-03-12 1:21

>>47
LISP

Name: Anonymous 2009-03-12 1:59

>>47
I think we've found the new indentation style for the GNU project. It sure as hell beats the ugly mess they use now.


while(foo)
  { // <-- FUCK YOU, STALLMAN!
    bar();
  }

Name: Anonymous 2009-03-12 2:26

>>49
if the gnu project starts using that style and kills that info faggotry i might actually consider contributing code to the hurd.
if they make GPLv4 equivalent to the 2-clause BSD license i'll definitely contribute code.

Name: Anonymous 2009-03-12 2:28

>>50
Or you could just use BSD now. You wouldn't even need to contribute code, because it already works.

Name: Anonymous 2009-03-12 2:29

>>40
What about his are Mom?

Name: Anonymous 2009-03-12 2:33

>>51
BSD doesn't use a microkernel.
i could just use minix, but i'd rather rid the world of the evils of GNU info and copywrong.

Name: Anonymous 2009-03-12 3:37

>>53
Microkernels are terrible design.

Name: Anonymous 2009-03-12 3:39

MONOLITHIC KERNELS FTW

Name: Anonymous 2009-03-12 4:20

if they make GPLv4 equivalent to the 2-clause BSD license
This is never going to happen as long as people choose to fork the software and make it proprietary.

Name: Anonymous 2009-03-12 4:23

>>56
FreeBSD, NetBSD, OpenBSD, MirOS, DragonFly, MidnightBSD, etc. aren't proprietary. what makes you think something that hasn't happened until now is going to suddenly start happening for no reason?

Name: Anonymous 2009-03-12 4:25

>54-55
Correct. Even if the HURD were to be completed someday...would anyone actually use it?

Name: Anonymous 2009-03-12 4:31

>>57
fork the software and make it proprietary.
The fork is proprietary. The original is not

Name: Anonymous 2009-03-12 4:34

>>57
Of course they are not proprietary operating systems. I think he was just hinting at the fact that the BSD licenses allow code to be used in proprietary programs originating from code in free software programs...whereas in the GNU GPL that type of activity is not permissible.

I find GNU GPL to be a bit restrictive myself.

Name: Anonymous 2009-03-12 4:44

in the GNU GPL that type of activity is not permissible.
java, staroffice, os x, etc.

Name: Anonymous 2009-03-12 5:25

>>61
The copyright holders over the software have the implied authority to license their software under different terms to different people. If you extend the GPL Java system or OO.o and distribute the derivative, the derivate must also be free.

Name: Anonymous 2009-03-12 5:30

>>62
so letting only one evil corporation make proprietary forks is better than letting anyone do it?

Name: Anonymous 2009-03-12 7:08

>>63
It is not better as all proprietary software are harmful to the recipients of that software, but that's the way Berne Convention copyright works. The GPL is a good enough hack for its intended purpose: to ensure that free software will always remain free. "Free" in this context refers to users' authority to run the software as they wish, tinker with the software as they wish, share the software as they wish and contribute to the community.

Name: Anonymous 2009-03-12 7:19

>>64
harmful
Yeah, like how when you use Windows, your computer stabs you in the eye.

No actual users give half a fuck whether they can "tinker with the software". They just want to click the word-processor button and type a letter, not masturbate to fibanocci sequences.

You free software evangelists are so disconnected from reality it's hilarious.

Name: Anonymous 2009-03-12 7:59

>>65
Yes, it is a fact that general society fails to care for their freedom. However, it doesn't change the fact that users cannot live in freedom because they lack the authority to control their own computer. It doesn't change the fact that users are forbidden to live as upstanding citizens. Only free software allows society to live in freedom.

Yes, it is true that users are completely ignorant about computer programming. That doesn't change the fact all they need is the authority to tinker with the software in order to live in freedom. You seem to forget that users can hire a programmer to extend or implement software to include a word-processor buttons and to type letters.

Name: Anonymous 2009-03-12 8:02

GNU considered harmful

Name: Anonymous 2009-03-12 11:32

Join us now and share the software;
You'll be free, hackers, you'll be free.
x2

Hoarders may get piles of money,
That is true, hackers, that is true.
But they cannot help their neighbors;
That's not good, hackers, that's not good.

When we have enough free software
At our call, hackers, at our call,
We'll throw out those dirty licenses
Ever more, hackers, ever more.

Join us now and share the software;
You'll be free, hackers, you'll be free.
x2

Name: Anonymous 2009-03-12 20:37

>>65
Well, why the hell do you think distributions like "Ubanto" exist? So the "HURR DURR" population of computer users can click on the word processor butan and write letters.

Name: Anonymous 2009-03-13 22:56

>>66
8/10. It was going well, but then you posit the idea that somehow, Windows users don't have authority over their machines. I assume you mean this in the personal sense, because the administrator of the machines should have the authority over it in the business sense, as opposed to the user.

A child could see through that statement as trolling. Back off a little next time and you could get the full 10/10.

Name: Anonymous 2009-03-14 4:15

>>70
If slavery was legal, then some people will choose to sell themselves into slavery. Choosing to put yourself into slavery isn't freedom. First, the slave must get out of that situation of servitude before the slave is considered free. Likewise, choosing to accept proprietary software isn't freedom. The reason is that users are expected to live in helplessness. Users choose to give up their authority to run software for any purpose (freedom 0). Users also choose to choose to give up their authority to tinker with their software (freedom 1). The user must first appeal for help from the master of the system whenever there needs to be some change in the user's system. How does one live in freedom when one needs permission to conduct some private business?

The people operating the machines are not necessarily the computer users. I operate automated teller machines at my bank to make use of the bank's services. I am operating the bank's computer system and not MY OWN computer system. When I go visit a friend's house and ask to use their computer, it is not MY system that I will be operating; I'll be operating my friend's system. Of course I must first ask permission to do some things on their system.

When it comes to my own personal machines, I will have to give up my freedom in order to use proprietary software; I will no longer have full authority over my machines. The good news, however, is that I can reclaim my freedom when I get rid of proprietary software.

Name: Anonymous 2009-03-14 12:30

>>71
You can't knock the rating up by beating the dead horse. That's not how it works.

Name: Anonymous 2009-03-15 1:25

>>72
I would ask you to present the logic that shows how I am wrong. Please educate me so that I will learn

Name: Anonymous 2011-02-03 7:24


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