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

Huffmanashi No Naku Koro Ni

Name: Cudder !cXCudderUE 2017-03-04 4:12

int kod(int *cnts, int i, int *j, int *k, int nsyms) {
int r;
if(*k > nsyms || i > *j && cnts[*j] < cnts[*k]) {
r = cnts[*j];
cnts[(*j)++] = i;
} else
r = cnts[(*k)++];
return r;
}

int huff(int *cnts, int nsyms) {
int i = 0, j = 0, k = 0;
for(i=0;i<nsyms-1;i++)
cnts[i] = kod(cnts, i, &j, &k, nsyms) + kod(cnts, i, &j, &k, nsyms);
cnts[i] = 2;
j = i-1;
k = j;
while(k) {
while(j > 0 && cnts[j-1] >= k)
j--;
cnts[i--] -= k - j;
cnts[i] = (k - j)*2;
k = j;
}
return nsyms - i;
}

Name: Anonymous 2017-07-17 5:46

>>40
I don't see how that's going to fix capitalism.

Name: Anonymous 2017-07-17 6:36

I don't see how that's going to implement diff

Name: Anonymous 2017-07-17 7:06

>>32
I don't think you understand the purpose of indentation very well.
You might think it's meaningless and have learned to get used to it, but at a glance, looking at your code to find something and identify structures becomes difficult. Then when others start reading your code they too will find it very hard to read compared to others' code.

Sure they can run ident(1), but are there really many notable benefits to foregoing indentation? All I can think of is saving file size, but that's a poor argument. Formatting your code should be an effortless part on yourself, and doesn't require you to be a ``code artisan'' to accomplish. Just think of how many people who looked at your code for 5 seconds and in the end just thought you are an amateur Apper without analyzing your techniques indepth.

So don't think it will only affect you. With almost all code people see being well formatted, it's hard to think they'll be ok with formatting some guy's code themselves just because he is kinda narcissistic.

Name: Anonymous 2017-07-17 7:07

>>43
This. dubs.

Name: Anonymous 2017-07-17 8:43

>>43
Benefits of not joining the indentation cult:
1.Lower file sizes
2.More data fits on one screen "The visual field is a scarce UI commodity"
3.Code doesn't get mangled due text filters and processing(indented code like python suffers from it well).
4.Its faster to read:
Reading indented code requires more scrolling and mental processing(comparing visual indentation with logical structure).
5.Its faster to write:
Without superficial indentation rules and policies, code writing naturally flows at the speed of typing out mental concepts(aids "Flow state"). No spacing, no indentation, no distraction: focus is always on code and not the aesthetic form it takes.
6.Its easier to debug:
Indented code error bring little context, often only a single statement.
Non-indented code errors show up as blocks of code.
7.Its terse structure allow to keep more of code in mind at the same time:with indented code you can't see it all due #2

Name: Anonymous 2017-07-17 8:47

>>45
Its faster to read
Its easier to debug
Nigga u dum

Name: Anonymous 2017-07-17 8:51

Name: Anonymous 2017-07-17 9:16

Name: Anonymous 2017-07-17 9:55

>>46
it's FV, what did you expect? he doesn't work on anything big and complex, he's just experimenting with pre-processor macros for fun. you don't need indentation to hack together an apply macro therefore it's useless for FV. the same goes for version control.

Name: Anonymous 2017-07-17 9:58

>>45
Consider the following: An excerpt of anoncoreutils, with indentation modified to mimic your ``Apping'' style. Can you understand how it works and what it does in 10 seconds?

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

int main(int argc, char **argv) {
int i;
if(argc!=2) {
fprintf(stderr,"usage: %s string\n",argv[0]);
return 1;
}
if(!strcmp(argv[1],"//"))
goto step_6;
if(!argv[1][0])
goto single_dot;
for(i=0;i<strlen(argv[1]);i++)
if(argv[1][i]!='/')
goto notslash;
goto single_slash;
notslash:
for(i=strlen(argv[1])-1;argv[1][i]=='/';i--)
argv[1][i]=0;
if(strrchr(argv[1],'/')) {
for(i=strlen(argv[1])-1;argv[1][i]&&argv[1][i]!='/';i--)
argv[1][i]=0;
step_6:
for(i=strlen(argv[1])-1;argv[1][i]&&argv[1][i]=='/';i--)
argv[1][i]=0;
if(argv[1][0])
printf("%s\n",argv[1]);
else
single_slash: printf("/\n");
} else
single_dot:
printf(".\n");
return 0;
}

Name: Anonymous 2017-07-17 10:05

>>50
Looks fine to me

Name: Anonymous 2017-07-17 10:46

>>50 Thats a waste of space
#include <stdio.h>
#include <string.h>
int main(int argc,char**argv){int i;
if(argc!=2){fprintf(stderr,"usage: %s string\n",argv[0]);return 1;}
if(!strcmp(argv[1],"//")){goto step_6;};
if(!argv[1][0]){goto single_dot;}
for(i=0;i<strlen(argv[1]);i++){if(argv[1][i]!='/')goto notslash;}
goto single_slash;notslash:for(i=strlen(argv[1])-1;argv[1][i]=='/';i--){argv[1][i]=0;}
if(strrchr(argv[1],'/')){for(i=strlen(argv[1])-1;argv[1][i]&&argv[1][i]!='/';i--){argv[1][i]=0;};
step_6:for(i=strlen(argv[1])-1;argv[1][i]&&argv[1][i]=='/';i--){argv[1][i]=0;}
if(argv[1][0]){printf("%s\n",argv[1]);}else{single_slash: printf("/\n");}}else{single_dot:printf(".\n");};return 0;}

Name: Anonymous 2017-07-17 10:53

>>52
Yeah this looks more like his style but without the syntax highlighting

Name: Anonymous 2017-07-17 10:55

Added line height for clarity for those who can't distinguish lines.

#include <stdio.h>

#include <string.h>

int main(int argc,char**argv){int i;

if(argc!=2){fprintf(stderr,"usage: %s string\n",argv[0]);return 1;}

if(!strcmp(argv[1],"//")){goto step_6;};

if(!argv[1][0]){goto single_dot;}

for(i=0;i<strlen(argv[1]);i++){if(argv[1][i]!='/')goto notslash;}

goto single_slash;notslash:for(i=strlen(argv[1])-1;argv[1][i]=='/';i--){argv[1][i]=0;}

if(strrchr(argv[1],'/')){for(i=strlen(argv[1])-1;argv[1][i]&&argv[1][i]!='/';i--){argv[1][i]=0;};

step_6:for(i=strlen(argv[1])-1;argv[1][i]&&argv[1][i]=='/';i--){argv[1][i]=0;}

if(argv[1][0]){printf("%s\n",argv[1]);}else{single_slash: printf("/\n");}

}else{single_dot:printf(".\n");};return 0;}

Name: Anonymous 2017-07-17 11:04

indent
those
dubs

Name: Anonymous 2017-07-17 12:54

>>45
Its faster to read
Its easier to debug

Weird how these are also the arguments for using indentation.
Really makes you think.

Name: Anonymous 2017-07-17 13:36

>>56
What is faster to read, 10 lines of text or 40 lines?

Name: Anonymous 2017-07-17 13:48

>>57
1. strip all newlines
2. paste code into Microsoft Notepad
3. turn off word wrapping

congratulations! you now have one line of text, which will be THE FASTEST to read

Name: Anonymous 2017-07-17 13:48

>>57
Well it's true that 10 lines would be faster to read, then.
Not faster to understand, though.

Name: Anonymous 2017-07-17 14:53

This is quicksort in APL
Q←{1≥≢⍵:⍵ ⋄ S←{⍺⌿⍨⍺ ⍺⍺ ⍵} ⋄ ⍵((∇<S)⍪=S⍪(∇>S))⍵⌷⍨?≢⍵}

Name: Anonymous 2017-07-17 15:20

>>59
..due a lack of mental capacity.

Name: Anonymous 2017-07-17 15:21

>>61
Say whatever you want, FrozenAnus. It doesn't make it true.

Name: Anonymous 2017-07-17 15:30

>>61
is this right? >>49

Name: Anonymous 2017-07-17 15:38

>>63
C macros is only one of my interests. They're probably well known because i like to showcase theoretical stuff from the void.h/void2 headers. I don't actually write programs composed from macros, unless its a demo thing.

Name: Anonymous 2017-07-17 22:28

>>64
>I don't actually write programs
Knew it

Name: Anonymous 2017-07-18 0:38

>>65
Well. Its partially correct.
I don't write "programs" i write apps or utilities. Writing big projects and committing to support them isn't for me.
I prefer to use my time rationally, not being an open source code monkey. see http://void.wikidot.com/effort-reward-curve

Name: Anonymous 2017-07-18 1:10

Write programs that do one thing and do it well.
Write programs to work together.
Write programs to handle text streams, because that is a universal interface.

Name: Anonymous 2017-07-18 10:45

>>66
then stop shitting on things that help immensely when writing big programs.

Name: Anonymous 2017-07-18 13:57

>>68
>big programs
1./prog/riders didn't write anything big(20K+ line of code)
2.Big programs are usually split into small modules.
3.The only case where this could be useful is some huge file like sqlite source amalgamation(which is never edited manually).

Name: Anonymous 2017-07-18 14:23

>>69
Big programs are anything above 15 lines, thanks

Name: Anonymous 2017-07-18 14:27

Never argue with stupid people, they will drag you down to their level and then beat you with experience.

Name: Anonymous 2017-07-18 15:05

>>70

log10(LOC) Type
9+ Enterprise-Class
8-9 Enormous
7-8 Gigantic
6-7 Huge
5-6 Large
4-5 Medium
3-4 Small
2-3 Tiny
1-2 Extra Tiny

Name: Anonymous 2017-07-18 15:14

>>60
Needs to be replaced by emoji and APL will become popular overnight.

Name: Anonymous 2017-07-18 15:31

Name: Anonymous 2017-07-18 15:35

Name: Anonymous 2017-07-18 15:38

>It's estimated that there are 111 billion lines of new software code generated by developers every year,
If they didn't indent the number would be much smaller.

Name: Anonymous 2017-07-18 15:41

>>76
If they didn't indent the number would be much smaller.
Retard.

Name: Anonymous 2017-07-18 15:44

>>76
indent
verb
ɪnˈdɛnt/


Start (a line of text) or position (a block of text) further from the margin than the main part of the text.
``type a paragraph of text and indent the first line''

synonyms: move to the right, move further from the margin, start in from the margin.
``the first line of a paragraph is indented by using the tab key''

Name: Anonymous 2017-07-18 15:48

>>66
An Apper
Wow!

Name: Anonymous 2017-07-18 15:53

>>77,78
Someone salty about their bloated indentation wasting space.

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