Quantcast
[ 3 / biz / cgl / ck / diy / fa / g / ic / jp / lit / sci / tg / vr / vt ] [ index / top / reports / report a bug ] [ 4plebs / archived.moe / rbt ]

/vt/ is now archived.Become a Patron!

/g/ - Technology


View post   

[ Toggle deleted replies ]
File: 329 KB, 414x411, THIS IS NO LONGER HARMLESS.png [View same] [iqdb] [saucenao] [google] [report]
44281929 No.44281929 [Reply] [Original] [archived.moe] [rbt]

>program uses more than 20 LOC per function on average

>> No.44281936
File: 33 KB, 198x247, one level removed.jpg [View same] [iqdb] [saucenao] [google] [report]
44281936

>program is written in a programming language

>> No.44281946
File: 509 KB, 453x484, 1396371271211.png [View same] [iqdb] [saucenao] [google] [report]
44281946

>program uses a license other than the GPLv3

>> No.44281959
File: 98 KB, 330x326, jobs.png [View same] [iqdb] [saucenao] [google] [report]
44281959

>program's GUI doesn't use rounded corners

>> No.44281972
File: 248 KB, 2060x2570, 1407907110539.jpg [View same] [iqdb] [saucenao] [google] [report]
44281972

>program doesn't adhere to the word of God

>> No.44282015
File: 213 KB, 640x359, linus-eff-you-640x363[1].png [View same] [iqdb] [saucenao] [google] [report]
44282015

>program breaks my program

>> No.44282023
File: 226 KB, 407x484, babbage.png [View same] [iqdb] [saucenao] [google] [report]
44282023

>program resides in the same memory unit as the data it manipulates

>> No.44282075
File: 222 KB, 640x453, Young_theodore_kaczynski[2].jpg [View same] [iqdb] [saucenao] [google] [report]
44282075

>computer program

>> No.44282149
File: 2.71 MB, 3456x2304, Lennart_poettering_foss.in_2007[1].jpg [View same] [iqdb] [saucenao] [google] [report]
44282149

>program consists of clean, minimal, well-commented, auditable code

>> No.44282153
File: 88 KB, 194x212, avin a gigle.png [View same] [iqdb] [saucenao] [google] [report]
44282153

>program isnt written in scheme

>> No.44282165

>>44282153
>program isn't written in assembly

>> No.44282313
File: 30 KB, 720x479, 10155820_571892692926475_9029597453532717638_n.jpg [View same] [iqdb] [saucenao] [google] [report]
44282313

>program doesn't use proper hardware acceleration

>> No.44282318
File: 354 KB, 377x455, r u a daemon.png [View same] [iqdb] [saucenao] [google] [report]
44282318

>program doesn't just do one thing and does it well

>> No.44282341

>>44282313
>program is a hardware-accelerated text editor

>> No.44282359
File: 206 KB, 1300x842, 2352 - and arch comic fuck get hipster losers out the wannabes windows.png [View same] [iqdb] [saucenao] [google] [report]
44282359

>program is easy to install

>> No.44282364
File: 66 KB, 802x533, laughinggents.jpg [View same] [iqdb] [saucenao] [google] [report]
44282364

>>44282341
>text editor is atom

>> No.44282382

>>44282364
America has ruined Linus. He gradually became a hambeast.

>> No.44282392

>>44282382
That's how he gained citizenship.

>> No.44282400
File: 20 KB, 196x268, NOT SECURE.jpg [View same] [iqdb] [saucenao] [google] [report]
44282400

>program has more than a handful of contributors

>> No.44282423
File: 39 KB, 300x240, dijkstra.jpg [View same] [iqdb] [saucenao] [google] [report]
44282423

>program is O(n^2)

>> No.44282433

>program has a brand name and logo despite being relatively trivial, and has a website with 3-column layout filled with buzzwords and an embedded Vimeo video, and no manual page

>> No.44282434
File: 876 KB, 355x325, 1409788861058.gif [View same] [iqdb] [saucenao] [google] [report]
44282434

>>44281946
lol'd.

>> No.44282447
File: 50 KB, 1080x1080, red-hat-linux-7[1].jpg [View same] [iqdb] [saucenao] [google] [report]
44282447

>program is not bugdoor'd for the NSA

>> No.44282457
File: 79 KB, 848x480, Watashi wa shinken ni anata-tachi wa kore o jikkō shinai koto o nozomu (私は真剣にあなたたちはこれを実行しないことを望む - I seriously hope you guys don't do this)‮.jp.jpg [View same] [iqdb] [saucenao] [google] [report]
44282457

>program is made with <3 and javascript

>> No.44282508
File: 15 KB, 460x276, i_frown_upon_you.jpg [View same] [iqdb] [saucenao] [google] [report]
44282508

>programmer doesn't drive race cars

>> No.44282544

>>44282508
>programmer doesn't fly MIGs

>> No.44282563
File: 281 KB, 660x759, john-mccarthy2[1].jpg [View same] [iqdb] [saucenao] [google] [report]
44282563

>program is not self-aware

>> No.44282583

>>44282447
rhinocerous boxing with a t-rex.jpg

>> No.44282948
File: 41 KB, 232x326, Hero of Alexandria.png [View same] [iqdb] [saucenao] [google] [report]
44282948

>program is not entirely mechanical

>> No.44282976

>>44281929
>Splitting up functions into one-time subfunctions just to get under some arbitrary LOC limit
>Bloating the total line count, which is directly related to bug count

>> No.44283667
File: 34 KB, 400x600, 3379485_bruce-lee-jeu-de-la-mort.jpg [View same] [iqdb] [saucenao] [google] [report]
44283667

Program is written in language that imposes or encourages a specific style, a specific paradigm or other artificial restrictions.

>> No.44284716
File: 99 KB, 950x534, Bill-gates1[1].jpg [View same] [iqdb] [saucenao] [google] [report]
44284716

>program is open source

>> No.44285511

C-C-C-COMBO BREAKER

>> No.44285577

>>44282976
whatever study you're alluding to only applies to harmful languages

>> No.44285624
File: 129 KB, 450x311, Jonathan-Blow.png [View same] [iqdb] [saucenao] [google] [report]
44285624

>breaking up your program into tiny functions

>> No.44285669
File: 444 KB, 843x694, reynholm.png [View same] [iqdb] [saucenao] [google] [report]
44285669

>Program is simple to use and not overly complicated at all

>> No.44285699

>>44282318
>r u a daemon.png
bretty nice

>> No.44285713
File: 11 KB, 480x360, hqdefault.jpg [View same] [iqdb] [saucenao] [google] [report]
44285713

>language doesn't have proper modules/packages

>> No.44285814
File: 34 KB, 413x395, 1395233677126.jpg [View same] [iqdb] [saucenao] [google] [report]
44285814

>program doesn't have extensive unit tests

>> No.44285876
File: 28 KB, 320x356, ayywood.jpg [View same] [iqdb] [saucenao] [google] [report]
44285876

>program isn't written in .js

>> No.44285888
File: 23 KB, 379x243, theoderaadt.jpg [View same] [iqdb] [saucenao] [google] [report]
44285888

>70% of code is not comments bitching about how your more popular and objectively superior competition does things

>> No.44285890
File: 58 KB, 616x699, slip_into_something_more_comfortable.jpg [View same] [iqdb] [saucenao] [google] [report]
44285890

>programmers shitpost on 4chan instead of writing code

>> No.44285984

>>44285890
i'll get fucken burnt out if I work on my fizzbuzz all the time

>> No.44285987

> program is very fast only one line of code 80, 000 characters

>> No.44286009

>>44282976
> not breaking up functions into subfunctions for easier testing
> increase code complexity to reduce LOC

>> No.44286015
File: 42 KB, 366x524, Hans_Reiser_2005.jpg [View same] [iqdb] [saucenao] [google] [report]
44286015

>she comes here again
>i'll fuckin do it

>> No.44286017

>>44282359
>program needs to be compiled from source unless you have access to the AUR

>> No.44286023
File: 52 KB, 680x792, vivian_shiggy.png [View same] [iqdb] [saucenao] [google] [report]
44286023

>>44286015
le edgy murder joke ecks dee

>> No.44286039

>>44282976
>not composing programs from mathematically proven pure functions
>not using anonymous functions

>> No.44286041
File: 2.73 MB, 427x220, that_fucking_duck.gif [View same] [iqdb] [saucenao] [google] [report]
44286041

>>44286017
>not having access to the AUR
>not using community repositories when you simply have to be too casual to use Arch

>> No.44286044
File: 37 KB, 435x580, Hans_Reiser_mug_shot_(2006).jpg [View same] [iqdb] [saucenao] [google] [report]
44286044

>programmer hasn't murdered his wife

>> No.44286056
File: 120 KB, 1280x720, tickle_pervert_2.jpg [View same] [iqdb] [saucenao] [google] [report]
44286056

>>44286044
>>44286015
>not reading the thread

>> No.44286058

>>44282976
>Bloating the total line count, which is directly related to bug count
I'm sure that 100 line function would have far less bug potential than the 200 line properly split apart version.

>> No.44286085

>>44285876
lmaaayyyowoood

>> No.44286086
File: 1.58 MB, 200x150, kermit_the_frog.gif [View same] [iqdb] [saucenao] [google] [report]
44286086

>program contains comments in any language other than English

>> No.44286132
File: 158 KB, 900x1200, chocolate_ice_cream.jpg [View same] [iqdb] [saucenao] [google] [report]
44286132

>>44286086
>program contains disgusting American English, and complains from Americans too stupid to understand those written by more intelligent Brits with their larger vocabularies and stronger grasp of grammar and information-conveyance

>> No.44286154
File: 192 KB, 300x300, 1396275745714.png [View same] [iqdb] [saucenao] [google] [report]
44286154

>program is written by someone who doesn't know the difference between indentation and alignment

>> No.44286163
File: 396 KB, 464x381, loli_gets_pounded_from_both_sides.gif [View same] [iqdb] [saucenao] [google] [report]
44286163

>>44286132
>complains

>> No.44286190

>>44286154
The only correct answer to "tabs or spaces?" is "both".

>> No.44286205
File: 8 KB, 680x680, bigger_bait.png [View same] [iqdb] [saucenao] [google] [report]
44286205

>>44286190

>> No.44286213

>>44286056
>no shitposting in the shitposting thread

>> No.44286219

>>44286205
tabs indent
spaces align

there's no discussion to be had

>> No.44286228
File: 746 KB, 400x378, blunter_than_green.gif [View same] [iqdb] [saucenao] [google] [report]
44286228

>>44286213
>the
>singular

>> No.44286234
File: 22 KB, 1585x1527, 12369878972.png [View same] [iqdb] [saucenao] [google] [report]
44286234

>>44286205
>I don't like it
>it must be bait

>> No.44286254
File: 791 KB, 637x496, yuyu_slap.gif [View same] [iqdb] [saucenao] [google] [report]
44286254

>>44286219
>>44286234
>I enjoy writing awful code which renders and flows incorrectly for everyone
I bet you use fucking 3-space indents too, you disgusting inbred.

>> No.44286266

>>44286132
You're one of those people who file bug reports because the developer doesn't conform to your ever so slightly different language preference, aren't you?

>> No.44286282
File: 91 KB, 600x920, Linus_Torvalds.jpg [View same] [iqdb] [saucenao] [google] [report]
44286282

>>44286219
>programmer used fixed width fonts

>> No.44286292
File: 36 KB, 500x335, rob.pike.jpg [View same] [iqdb] [saucenao] [google] [report]
44286292

>>44286254
>>44286219
>>44286190
>>44286154
>He doesn't just gofmt his code

>> No.44286310

>>44286254
1 tab and 3 space identation reporting in. My code always renders and flows properly for every editor I've tried. How? It's always easy to tell which indentation belongs to piece of code.

>> No.44286312

>>44286254
explain how tab-indented, space-aligned code could show incorrectly in a monospaced font

protip: you can't

>> No.44286316

>>44286266
>preference
When you Clapburgers think that phrases like "I could care less" are valid English to mean that you don't care about something, you've lost all authority on the subject of language. They're not 'preferences', you're simply just wrong.

>> No.44286384

>>44286316
>generalizing
You Europeans sure get mad when you have to talk to anyone else, huh? You can step off of the soap box now, this isn't /int/.

>> No.44286394

>>44286384
>generalizing
Liberal please go

>> No.44286402

>>44286384
could-care-lesser detected

>> No.44286415

>>44286292
Anyone else think he looks like the BSD pufferfish?

>> No.44286425

>>44286394
>>>/pol/

>>44286402
>>>/b/

>> No.44286434

>>44286384

You spelled "Yuropoors" wrong.

>> No.44286435
File: 46 KB, 903x600, 0x600.jpg [View same] [iqdb] [saucenao] [google] [report]
44286435

>program's original author doesn't take monthly vacations

>> No.44286498
File: 317 KB, 1034x809, addison-color.jpg [View same] [iqdb] [saucenao] [google] [report]
44286498

>program uses non-native GUI elements

>> No.44286534

>>44286435
>programmer isn't fatty fucking faggot fatass sellout

>> No.44286549

>>44286534
>consumer gets mad about vidya games

>> No.44286623
File: 952 KB, 2982x2808, firefox_logo-only_RGB.png [View same] [iqdb] [saucenao] [google] [report]
44286623

>program doesn't release memory

>> No.44286649

i love memes
upvoted

>> No.44286658
File: 146 KB, 893x969, 1411253398245.jpg [View same] [iqdb] [saucenao] [google] [report]
44286658

>program has a gender gap

>> No.44286676
File: 406 KB, 1276x756, 2011-11-24_203356_885783.jpg [View same] [iqdb] [saucenao] [google] [report]
44286676

>>44286534
>being this mad

>> No.44286686
File: 826 B, 120x160, behind_this_post.gif [View same] [iqdb] [saucenao] [google] [report]
44286686

>>44286658

>> No.44286741

>>44284716
Microsoft is a strong supporter of open source though.

>> No.44286775
File: 243 KB, 452x456, 1409797262454.png [View same] [iqdb] [saucenao] [google] [report]
44286775

>>44286741

>> No.44286846

>>44286775
http://www.theregister.co.uk/2012/04/03/microsoft_linux_kernel_contributions/

I remember when /g/ wasn't full of /v/ kids.

>> No.44286856

>>44282392
nope that was earned via a backdoor

>> No.44286944

>>44286846
And I remember when they made an open standard which they then mutilated in their own implementation, breaking compatibility with competing FOSS.
I also remember how Windows is not compatible with any Unix file systems by default, and how it claims that a disk used on Linux is dirty and must be formatted or scanned for FS errors before it is written to.
I also remember the propaganda they released against OpenOffice.
I also remember how they promoted the fuck out of DirectX to lock games development to Windows.
I also remember how they threatened OEMs that wanted to have Linux installed on their prebuilts.
I also remember how Ballmer called FOSS a cancer.

Now please tell me what Microsoft really contributed to FOSS, because I would love to know.

>> No.44286964

>>44286944
All of those things aren't as strong of points as you think they are, and some of them are stretched.

>> No.44286981

>>44286775
MS supports any open source that promotes adoption of their commercial products.

>> No.44286998

>>44286944
Grow up kiddo

>> No.44287002

>>44286944
lmao, that cool kid finisher, he thinks he's destroying anon

>> No.44287008

>>44286964
Name me one good libre piece of software developed under the Microsoft name.

>> No.44287020

>>44287008
Your mum lmao

>> No.44287032

>>44287002
Fuck you, I legitimately want to know.

>> No.44287037

>>44286163
holy fuck. I didnt expect those animations

>> No.44287041

>>44287008
linux lmao>>44287008

>> No.44287059

>>44287008
>yfw the Linux kernel is controlled opposition by microsoft

>> No.44287064

>>44286944

Ballmer was also very nasty to chairs. I wonder what he'll throw when he realizes he wasted $2 billion on the Clippers--the chairs in the Staples Center are bolted to the floor.

>> No.44287141
File: 61 KB, 448x700, 1409290016695.jpg [View same] [iqdb] [saucenao] [google] [report]
44287141

>>44287064
>mfw ballmer throws the Staples Center

>> No.44287143

>>44287008

Singularity? Oh, you said "good."

>> No.44287193
File: 11 KB, 249x189, tip top.jpg [View same] [iqdb] [saucenao] [google] [report]
44287193

>>44287141

>> No.44287308

>>44287141

lel..."BALLMER SMASH!!!"

>> No.44287391

>>44286944
quality post. I liek u

>> No.44287746

>>44286775
You're an idiot. MS are one of the top contributors to the Linux kernel.

>> No.44288114

>>44286846
those were because they were legally required to do so, though.

>> No.44288117

>>44282457
>localization done with google translate

>> No.44288193
File: 19 KB, 183x232, lehappymerchant.png [View same] [iqdb] [saucenao] [google] [report]
44288193

>program doesn't require you to purchase a license

>> No.44288931

>>44286163
sauce game?

>> No.44288990

>>44283667
So any language that isn't Lisp.

>> No.44289067
File: 119 KB, 722x654, splash.png [View same] [iqdb] [saucenao] [google] [report]
44289067

>>44281929
The philosophy of "do one thing and do it well" only applies to functions that comprise a program.

The actual program should be extendable and customizable, like Emacs.

>> No.44289096

>>44282341
>try to open a 10 megabyte log file in notepad
>locks the computer up

>> No.44289475

>>44289096
the GNU coreutils dont have this problem

>> No.44289485

>thinking LOC isn't a useless fucking metric

>> No.44289868

>>44282341
What's the problem? What wrong with sublime?

>> No.44290073

>program does any system calls

>> No.44290298

>>44286846
this is only for compatibility their own products, they contribute nothing to linux as an OS
so no, it doesn't count as "contribution" at all

>> No.44290471

>>44289067

No, it also applies to whole utilities when it comes to UNIX. Hence the creation of a standard input and output and piping between them instead of making a few huge command with thousands of flags each.

>> No.44290561

>>44290471
I meant it's only a good idea with functions.

Functions are also easier to manipulate and embed into other functions.

Imagine if sed or awk could be called on a C buffer from inside of a different program. I think it already can, but it's nowhere near as elegant as calling an actual function.

Am I correct? Calling awk inside of a C program isn't as easy as calling malloc in a C program, right? Imagine if it was. That's what I get to experience and I won't go back.

>> No.44291235

>>44290561
Given some generic code to programmatically set up pipes then it could be indistinguishable from a normal function call.

>> No.44291269

>>44291235
So, it's not like normal function calls by default. That sucks.

Sh is just a shitty glue language to halfway do what I just said in an inelegant and error-prone manner.

>> No.44291479
File: 42 KB, 355x483, 1316137727837.jpg [View same] [iqdb] [saucenao] [google] [report]
44291479

>program isn't written in Swift or Obj-C

>> No.44291520

>>44291269
Shells can be ignored completely. A shell is just an interpreter for a programming language that happens to have short syntax for file/process-related stuff.

When a C program executes external programs, there's no shell involved. The C program is using system calls directly, just as a shell would. They are peers.

>> No.44291547

>>44290561
Programs are functions in some OSes. That's one of the reasons why the Unix-haters hated Unix.

>> No.44291559

>>44291520
Just to make sure I understand, will you give an example of calling a C program from a different program on data from the calling C program?

I imagine a good example would be calling grep on a text buffer.

How would this look?

>> No.44291562

>>44291479
>Swift: it's anything but!

>> No.44291586

>>44291547
That's one reason I also dislike UNIX. Programs being functions is a great idea.

I don't know of any modern operating systems that do that.

>> No.44291717

>>44291559
Not him. I do this several times on my IRC bot.
https://github.com/rhaps0dy/meCh/blob/master/mod/sed.c
For example, call sed and don't reimplement it.

>> No.44291782

>>44291717
That looks exceedingly complicated. Thank you for the example.

>> No.44291801

>>44291586
>Programs being functions is a great idea.

That's a horrible idea. C calling conventions are far more universal, standardized, efficient and easy to use than command-line calling conventions.

All you have to do is look at this moron's code >>44291782 and compare it to, say, the PCRE api

>> No.44291846

>>44291782
Yes, it's more complicated than calling a function. You'd need to wrap it in a reusable function, but it isn't something used often and I haven't put thought into it.

>> No.44291854

>>44291801
>>44291846
Imagine if you could use programs as functions, like this:

(setq text "This is some text in a string.
It has more than one line.

The above line was a blank line.")
(grep "is" text)


That's leagues better.

>> No.44291939

>>44291854
You can do a function that implements this in C. I'm going to write it now.
It's a bad idea to implement it in the OS, calling a function is quite different from creating a process and reading its output.

Even just calling that program's main would not work, you can only return a number, and there is no pointer to files as buffers. At least not one you'd want the userland accessing.

>> No.44291940

>>44291854

BUT YOU CAN. This is what abstraction is about.

Write reusable child process wrapping code once then you can put whatever lightweight API over it you like.

>> No.44292044

>>44291717
Cool stuff mang. Gonna study that further when I'm not on my phone.

>> No.44292076

what is the best way to draw software diagram so i can look at the big picture?

reccomend me something friends

>> No.44292150 [DELETED] 

>>44288931
koropatta
it's a ds game but you can play it on desumeme or whatever it's called, it's in japanese though and the english patch isn't very complete

>> No.44292191

>>44288931
coropata
it's a ds game but you can play it on desumeme or whatever it's called, it's in japanese though and the english patch isn't very complete

>> No.44292253

>>44286312
>using a monospaced font

>>44286219
Elastic tabstops indent, elastic tabstops align.

>> No.44292287

>>44291717


why do people create 50 lines functions

don't you like readability? Don't you like modularity? Don't you fucking like writing good stuff?

get fucked and take your 100 line behemoths with you.
dd
thanks

>> No.44292397

>>44292253
proportional fonts for programming is a meme m8 ur not supposed to actually use them day to day

>> No.44292530

>>44292397
What a throwback to 70s teletypes. Do you also use ed?

Proportional fonts are proportional because the spacing makes individual letters more distinct, thereby making the text easier and faster to read. If there were any reason to use monospace fonts, we would for everything; they're a hell of a lot easier to implement both in printers and software.

Come on, the Romans had this figured out many hundreds of years ago.

'Traditional' tabstops need to go as well. They can't cope when the text around them changes beyond their extent (8 units, 4 units, whatever). And don't get me started on using spaces to indent.

>> No.44292537

>>44291939
>>44291940
This method is very inelegant in comparison to what I showed.

>> No.44292575

>>44292530
I use only spaces to indent. I don't like tabs.

I also use a monospace font for most things.

I did use ed for a few months.

>> No.44292588

>>44291939
>>44291854
https://paste.installgentoo.com/view/63d74181

Not thoroughly tested but should work.
It's gonna be useful for me.

>> No.44292590

>>44292530
Monospace fonts are convenient when your program has significant whitespace.

>> No.44292595

>>44292397
>muh terminal cursor addressing
>muh screen session
>muh bram moolenaar being too dumb to implement proportional type rendering

>> No.44292626

>>44292590
That's what tabs are for.

>> No.44292692

>>44291854

Treating programs as functions is what's known as a leaky abstraction:
>1000x more overhead
>can run async
>completely different address space
>flag passing is non-standardized
>requires file descriptors for comm., which can fail for a variety of reasons
>program you want to call might not even exist on target system.

In the end, you're 'elegant' solution is doing a ton of work to write a slow, shitty replacement for your linker.

>> No.44292695

>>44281929
ayyyyyyyyyyyy lmao
>topkek

>> No.44292697

>>44292595
that's funny because I actually dislike all of TUIs, screen/tmux, vim and all the rest. I just liek good mono fonts okay? :*(

>> No.44292723

>>44292595
>muh nooduls
>muh minimalism
>muh vidja

>> No.44292759

>>44292692
If you couldn't tell, I like Lisp.

>It runs quickly, depending on how well you optimize it.
>Lisp has no problem with async.
>Argument passing works fine.
>A program you want to call in a C program may not also exist. Lisp has very easy ways to download and install the package in the environment on the fly, however.

I don't see the problem, but, given your viewpoint, I'm sure you'll be able to find one.

>> No.44292880

>>44292759
someone had to implement whatever lisp you use. just because that wasn't you doesn't mean the low-level parts and stacked abstractions don't exist

>> No.44292895

>>44292595
>muh terminal cursor addressing
Cursor addressing is awesome.

>> No.44292912

>>44292880
Lisp has been implemented in Lisp many times. Lisp has also been implemented in hardware and assembler language.

I don't see why you need to do things the C way. The C way looks painful and time wasting.

>> No.44292929
File: 25 KB, 743x382, DOOOOOOM.png [View same] [iqdb] [saucenao] [google] [report]
44292929

>program isn't heavily parallelized

>> No.44292973

>>44292895
no. it's created masses of autists with warped & stunted idea about what good ui can be

>> No.44292998

>>44291854

Every program should have been a library, with the actual executables only being frontends so you can execute the functions. Then you could actually combine programs in a meaningful way instead of the hacky bullshit that is the Unix shell.

>> No.44293007

>>44292998
Exactly. I don't understand why anyone would argue against this.

>> No.44293020

>Program not designed by Apple Inc. in Cupertino, California

>> No.44293034

>program is not -Wall -Wextra and lint(1) clean

>> No.44293078

>>44293034

>Program compilation is spammed with warnings from headers of included external libraries

>> No.44293121

>>44292912
You have a real blind spot regarding abstraction. A so-called "C way" could take any shape someone cares to implement. In the end, everything has to boil down to the same set of system calls on the desktop and server platforms we use.

>> No.44293125

programming isn't technology

>> No.44293139

>>44293121
C has very poor abstractions, as evidenced by how complicated it is to do something as simple as call a program from within another.

>> No.44293151

>so this is how you greentext? sorry im new here haha

>> No.44293182

>>44292575
You should use tabs for indentation and spaces for alignment because it allows for tabs of any width without fucking up your code when someone else reads it.

It's the only professional way of doing it.

Like >>44286219 said, there's no discussion to be had.

>> No.44293242

>>44292973
>no. it's created masses of autists with warped & stunted idea about what good ui can be

Yeah, all those mousefaggots who thought they knew better and traded 100+ keys for an average of 3 along with a viewport constrained X-Y coordinate delta generator that is reliant on context that may or may not be standardized.

>> No.44293313

>>44293182

Just fucking use spaces. Have a decent editor that turns tabs into spaces and allows you to backspace 4 spaces at a time(Visual Studio, vim, I'm sure emacs and Eclipse and everything have the same options). Then you won't even know you're using spaces.

If you only use spaces then you're sure the code looks the same on every computer, and you don't accidentally get diffs that just change tabs into spaces and vice versa when collaborating with other devs.

The tab character only causes trouble in code. It's not "professional" at all.

>> No.44293355
File: 94 KB, 680x758, 1401665803152.jpg [View same] [iqdb] [saucenao] [google] [report]
44293355

>program has not AbstractBeansFactoryFactory

>> No.44293356

>>44293139
Even in C you can abstract and reuse code you don't like looking at, you silly kunt. I give up.

>> No.44293365

I am of the opinion that if it works without glaring security holes, and there is nothing else that does the same thing more quickly, then its good enough.

>> No.44293369

>>44293139
Did you read my fucking post or not?
>>44292588
It's THAT easy to call another program in C, and your lisp implementation uses something more complicated than that for sure.

>> No.44293401

>>44293313
>You don't even have to know you're using spaces.
Okay.

>If you only use spaces then you're sure the code looks the same on every computer
How is that any better?
Some people want denser code, some people want to see their levels of nestedness.

>You don't accidentally get diffs that just change tabs into spaces and vice versa when collaborating with other devs.
This can also happen at an equal frequency when using tabs and spaces.

>> No.44293435

>>44293313
>appeasing shit tools by deviating from the one approach that makes sense is somehow a good thing

>> No.44293447

>>44293356
It's significantly less convenient.

C isn't even homoiconic. Does it even have separate namespaces?

Then you have to ignore the fact that the standard library is almost fucking useless with all of the arcane and fairly unnoticeable errors it can cause.

>> No.44293458

>>44292895
Actually, it's a bad hack that has spawned massive heaps of stupidity like termcap so that programmers can achieve proper behaviour on users' 250,000-line VT100 emulators.

>>44292723
You have me confused with someone who cares about the appearance of their text editor. It seems more like monospace-using Arch+Vim ricer who are concerned with that. I just care about readability.

>> No.44293494

>>44293458
>I just care about readability.
enjoy your misaligned comment boxes because variable length

>> No.44293507

>>44293447
>isn't even homoiconic

fuck off, you dilettante

>> No.44293513

>>44293369
So what if my lisp implementation uses something more complicated?
That's not my concern.
All I care about, is that it IS that easy for me.

>> No.44293521

>>44293507
don't be a fucking homophobe.

>> No.44293540

>>44286658
Man, stop doxing this grill.

>> No.44293549

>>44293494
Comment boxes?

>> No.44293580

>>44293549
That thing you used to type out the post you just made.

>> No.44293610

>>44293580
Why would 'misalignment' in the 4chan comment box bother me?

And the font is the sans-serif font by default.

>> No.44293620
File: 14 KB, 333x237, 2014-09-22-050844_333x237_scrot.png [View same] [iqdb] [saucenao] [google] [report]
44293620

>>44292191
thank you

>> No.44293702

>Program is Not Responding

>> No.44293743

>>44293702
>Program refuses to stop responding

>> No.44295262
File: 14 KB, 471x411, 1387402504905.png [View same] [iqdb] [saucenao] [google] [report]
44295262

>Program isn't based on feelings.

>> No.44295518
File: 6 KB, 251x201, dijkstra.jpg [View same] [iqdb] [saucenao] [google] [report]
44295518

>program uses goto

>> No.44295686

>>44295518
Unconditional jumps are quite useful though.
I think the way C doesn't allow you to jump stack frames is pretty good.

>> No.44295723

>>44293513
>shows running a program as function call in lisp
>q: what about error handling, asynchronous behaviors, different address spaces, etc?
>"oh you c plebs, working so hard around your shitty language."

I think I'm beginning to understand why everything written in Lisp is either utter shit, e.g. Emacs, or needs to be completely rewritten in a real language once it reaches general use, e.g. Reddit and everything ever written by Paul Graham.

>> No.44295740
File: 127 KB, 792x600, dijkstra 2.jpg [View same] [iqdb] [saucenao] [google] [report]
44295740

>>44295686
Nice try Linus, and no, that they are useful (according to you) doesn't mean they are better.

>> No.44295748

>>44295723
>Emacs
>Shit
Oh, you probably use Vim, right?

>> No.44295766

>>44295686
Enjoy your spaghetti code

>> No.44295819

>>44295740
>>44295766
int function()
{
if (!test1)
goto error;

if (!test2)
goto error;

/*
* Main work here
*/

return 0;

error:
cleanup();
return 1;
}

is better than
int function()
{
if (test1) {
if (test2) {
/*
* Main work here
*/

return 0;
}
}

cleanup();
return 1;
}

>> No.44295870

>>44295819
goto are evil.

int function()
{
if (!test1)
return cleanup(); // >impliyng cleanup() returns int.

if (!test2)
return cleanup();

/*
* Main work here
*/

return 0;
}

>> No.44295880

>>44295819
Why? Because it waste too much lines or something?

>> No.44295886

>>44295870
>Code duplication

>>44295880
Prevents unnecessary indentation.

>> No.44295899

>>44295886
>Prevents unnecessary indentation.
And that is good because..., you waste less characters or something? lmao

>> No.44295910

>>44295870
shouldn't that be
if (!test1 || !test2)
return cleanup();


I'm a newfag to C so I don't know if that is right.

>> No.44295914

>>44295819
>not int cleanup_var __attribute__((cleanup(cleanup));

>> No.44295927

>>44295899
With 8-space tabs, shit will get pushed off the side of the screen very quickly.
https://www.kernel.org/doc/Documentation/CodingStyle

>>44295910
Yeah that's right, but normally you would need to print an error message depending on which test failed, preventing them from being part of the same statement.
I didn't include that in my example for brevity.

>> No.44295932

>>44295927
>Not using GNU style.

>> No.44295943
File: 90 KB, 650x650, vomit.jpg [View same] [iqdb] [saucenao] [google] [report]
44295943

>>44295932
We aren't all Lisp hackers, mate.

>> No.44295956

>>44295932
>GNU style

don't even joke about that

>> No.44295958

>>44295927
>With 8-space tabs, shit will get pushed off the side of the screen very quickly.

But programmers no longer use shitty screens or those machines that write the code automatically in a paper.
I know that cause "arrow code", but often arrows aren't spaghetti code, unlike Linux which abuse goto.

>> No.44295986

>>44295932
Allman style is better

>> No.44295989
File: 104 KB, 450x600, Tanenbaum.jpg [View same] [iqdb] [saucenao] [google] [report]
44295989

>monolithic kernels

>> No.44295995

>>44295927
>The limit on the length of lines is 80 columns and this is a strongly
preferred limit.
This may be true for Linux but it is not always true outside of Linux. This is 2014, it's actually possible to scroll over.

>> No.44295997

>>44295989
kek, I was just about to post that

>> No.44296021

>>44295995
>>44295958
>it's actually possible to scroll over
Side scrolling is a cancer.
I don't want to have to run the thing I'm working on in full screen just so I can see the end of your statements.

Linux's style makes it much easier to have a bunch of stuff open at the same time.

>> No.44296022

>>44295956
Lisp hacker was here. GNU style is best style.

>> No.44296068

>>44296021
>cancer
But in this case >>44295870 and even in the example you provided >>44295819 there wouldn't be a need to do side scrolling, unless you do shitty ebin one liners, which are cancer.

>> No.44296100

>>44296021
Code that exceeds 80 columns is not the norm. You won't see it very often and when you do, it's rare enough that scrolling over is totally nothing. Don't tell me that you're one of these fragile autist programmers who break down at the sight of code that is not "proper".

>> No.44296183

Are 8 space tabs the standard in ANY software besides fucking emacs?

I've only ever seen 4 space tabs

>> No.44296223

int function()
{
if (test1) {
if (test2) {
for (int i = 0; i < ARRAY_X; ++i) {
for (int j = 0; j < ARRAY_Y; ++j) {
if (array[i][j] == 'x') {
printf("Point (%d,%d) is special for some reason\n", i, j);
}
}
}
return 0;
} else {
fprintf(stderr, "Test 2 failed\n");
cleanup_test2();
}
} else {
fprintf(stderr, "Test 1 failed\n");
}

cleanup_test1();
return 1;
}


While this example is over the top, and extremely retarded, using goto allows you to keep all of the error checking and cleanup in one place, while it's just all over the place here.

>> No.44296282

>>44286846
>thinks Microsoft supports open source
>claims those who say otherwise are "kids"
>clearly too young to know about Embrace, Extend, Extinguish
Get the fuck off my lawn, you weaboo faggot

>> No.44296329

>>44296223
>While this example is over the top, and extremely retarded

Indeed, that's really retarded, so it's not a fair example.

http://koblents.com/Ches/Links/Month-Mar-2013/20-Using-Goto-in-Linux-Kernel-Code/
This is a fair example, but all the linux devs contributors don't like it because "it's unlelegant".

>> No.44296343

>>44296183
CLI *nix text editors

>> No.44296400

>not using 'if' and 'goto' to attain the functionality of a 'while' loop.
It's like you fags aren't even using archaic programming languages from 40+ years ago.

>> No.44296446

>>44292530
Program source is not prose though, they have more in common with tabular data, and you often have to edit inside some kind of block structure.
So having things neatly and consistently aligned helps readability.

>> No.44296473

>>44296400
But programming languages from 40+ years ago have while loops too

>> No.44296489

>>44296400
>doesn't know about FORTRAN
NIGGER

>> No.44296525

>>44296489
I was in fact referring to fortran as I have to deal with that pile of shit every day.

>> No.44296536

>>44296400
>Not knowing about LISP.

>> No.44296584

>>44296525
but FORTRAN has while

>> No.44296643

>2014
>Not being able to predict how your assembly is going to come out
#include <stdio.h>

int main()
{
int i = 0;
looping:
if (++i > 100)
goto out;
if (i % 3)
goto buzz;
printf("Fizz");
buzz:
if(i % 5)
goto num;
printf("Buzz\n");
goto looping;
num:
if (!(i % 3))
goto newline;
printf("%d", i);
newline:
printf("\n");
goto looping;
out:
return 0;
}

>> No.44296670

>>44295819
PROC function = BOOL:
IF TYPE1 thing = value; do stuff; test 1
THEF do more stuff(thing); TYPE2 thing 2 = value 2; test 2
THEF do even more stuff(thing, thing 2); test 3
THEN everything worked; TRUE
ELSE clean up; FALSE
FI

The "thing" and "thing 2" are to show that declarations in the IF and THEF parts can be used in subsequent parts of the conditional expression. WHILE conditions on loops have the same property.

>> No.44296688

>>44295870
Try something like this without gotos:
int func(void)
{
mutex m
char *buf;
FILE *f;
size_t sz;
int ret;

if (!(f = fopen("file", "r"))) {
return -1;
}

sz = filesize(f);
if (!(buf = malloc(sz))) {
ret = -2;
goto cleanup_file;
}

if (fread(buf, 1, sz, f) != sz) {
ret = -3;
goto cleanup_buf;
}

lock(m);
if (update_shared_buf(buf, sz) != 0) {
ret = -4;
goto cleanup_lock;
}

ret = 0;

cleanup_lock:
unlock(&m);
cleanup_buf:
free(buf);
cleanup_file:
fclose(f);

return ret;
}

>> No.44296707

>>44296584
Not Fortran 77.

>> No.44296728

>>44296643
>2014
>compiling with optimizations off

>> No.44296873

>>44296728
.file "gotobuzz.c"
.section .rodata.str1.1,"aMS",@progbits,1
.LC0:
.string "Fizz"
.LC1:
.string "Buzz"
.LC2:
.string "%d"
.section .text.unlikely,"ax",@progbits
.LCOLDB3:
.section .text.startup,"ax",@progbits
.LHOTB3:
.p2align 4,,15
.globl main
.type main, @function
main:
.LFB11:
.cfi_startproc
pushq %r12
.cfi_def_cfa_offset 16
.cfi_offset 12, -16
pushq %rbp
.cfi_def_cfa_offset 24
.cfi_offset 6, -24
movl $1431655766, %ebp
pushq %rbx
.cfi_def_cfa_offset 32
.cfi_offset 3, -32
movl $1, %ebx
jmp .L2
.L3:
.p2align 4,,10
.p2align 3
.L4:
movl %ebx, %eax
movl $1717986919, %edx
imull %edx
sarl %edx
subl %r12d, %edx
leal (%rdx,%rdx,4), %eax
cmpl %eax, %ebx
je .L8
movl %ebx, %esi
movl $.LC2, %edi
xorl %eax, %eax
call printf
.L5:
movl $10, %edi
addl $1, %ebx
call putchar
cmpl $101, %ebx
je .L9
.L2:
movl %ebx, %eax
movl %ebx, %r12d
imull %ebp
sarl $31, %r12d
subl %r12d, %edx
leal (%rdx,%rdx,2), %eax
cmpl %eax, %ebx
jne .L4
xorl %eax, %eax
movl $.LC0, %edi
call printf
movl %ebx, %eax
movl $1717986919, %edx
imull %edx
sarl %edx
subl %r12d, %edx
leal (%rdx,%rdx,4), %eax
cmpl %eax, %ebx
jne .L5
.L8:
movl $.LC1, %edi
addl $1, %ebx
call puts
cmpl $101, %ebx
jne .L2
.L9:
popq %rbx
.cfi_def_cfa_offset 24
xorl %eax, %eax
popq %rbp
.cfi_def_cfa_offset 16
popq %r12
.cfi_def_cfa_offset 8
ret
.cfi_endproc
.LFE11:
.size main, .-main
.section .text.unlikely
.LCOLDE3:
.section .text.startup
.LHOTE3:
.ident "GCC: (GNU) 4.9.1 20140903 (prerelease)"
.section .note.GNU-stack,"",@progbits

Seems to follow my code pretty well (O3)

>> No.44297320

>>44296873
Except it completely reordered your loop, and % was turned into muls/shifts/adds
goto looping;
buzz:
if (fast_div(i, 5) == 0)
goto next;
printf("%d", i);
++i;
newline:
putchar('\n');
if (i == 101)
goto out;
looping:
if (fast_mod(i, 3) != 0)
goto buzz;
printf("fizz");
if (fast_mod(i, 5) != 0)
goto newline;
next:
++i;
puts("buzz");
if (i == 101)
goto looping;
out:

>> No.44297355
File: 114 KB, 1267x713, That Fucking Duck 2.jpg [View same] [iqdb] [saucenao] [google] [report]
44297355

>>44286041
This scene made my dick so sad.

>> No.44297453

>People think that LoC is a good metric for function readability

I'll take a well commented and 100 line function with sane variable names any day of the week. Much better than six subfunctions that are only called once.

>> No.44297508

>>44297453
Breaking it up into sub functions serves as self documentation (assuming well named functions) so you wont need as many comments, and it becomes easier to test and debug.

Only excuse for long functions is big switch statement for dispatching or initializing some lookup table/decision tree type stuff.

>> No.44297632

>>44297453
I write big functions and always find a way that I could split the functionality into more functions. That way, future functions can also have that functionality.

It also makes the large function look better.

>> No.44297710
File: 91 KB, 500x500, 1291591935743.png [View same] [iqdb] [saucenao] [google] [report]
44297710

>>44296329
>No, you've been brainwashed by CS people who thought that Niklaus Wirth actually knew what he was talking about. He didn't. He doesn't have a frigging clue.
>
>Yeah, he did, but he's dead, and we shouldn't talk ill of the dead. So these days I can only rant about Niklaus Wirth
I love Linus

>> No.44297837

>>44297710

It mostly reminds me how shitty a language C is even compared to C++, where you end up stuck with 2 bad options, deeply nesting conditionals or gotos, because there's no good way to have arbitrary cleanup code on block exits.

But hey, it's not like this has caused serious security bugs in every single major C SSL libr... oh right, it has.

>> No.44298629

>>44282423
Implying p=np

>> No.44298680

>>44297837
The first C compiler had to be small. The PDP-11 it ran on had a 64 KB address space.
That meant no seatbelts or airbags and the simplest brakes possible.

>> No.44298689

>>44282423
>program is O(500,000,000 * N) instead of O(N^2) even though N < 3,000 necessarily
>Don't worry it'll be faster in the future

>> No.44298708
File: 29 KB, 498x668, 1410062475304.jpg [View same] [iqdb] [saucenao] [google] [report]
44298708

>program is O(2^n)

>> No.44298753
File: 9 KB, 300x225, 300px-Richard_Stallman_straining_his_bowels[1].jpg [View same] [iqdb] [saucenao] [google] [report]
44298753

>program is O((n+1)!)

>> No.44298785

>>44298708
>program is O(n^n^n)

>> No.44298791

>>44298680
Yet some people still use it and say it's the best thing ever.

>> No.44298837

>>44298753
>500 if's to check the value of a single variable, to set the value of another single variable
>O(N) runtime because fuck it, it's free to check 250 more times than needed on average

>> No.44300867

>>44296584
FORTRAN != Fortran

>> No.44300998
File: 67 KB, 466x600, Untitled.png [View same] [iqdb] [saucenao] [google] [report]
44300998

>using unnecessary recursion

>> No.44301151

>>44282382

Dude, he's middle aged by now.

>> No.44302139
File: 12 KB, 277x329, x.jpg [View same] [iqdb] [saucenao] [google] [report]
44302139

>not using church numerals due to "muh performance"

>> No.44302326
File: 105 KB, 398x503, 1380836831657.jpg [View same] [iqdb] [saucenao] [google] [report]
44302326

>program uses gtk

>> No.44302661
File: 73 KB, 492x511, 1388174573749.jpg [View same] [iqdb] [saucenao] [google] [report]
44302661

>>44302326
>program doesn't use Cocoa

>> No.44302867

>>44302326
GTK+2 is the only decent toolkit. Qt is way too bloated, generally looks bad and is drilled into C++ and their own libraries for everything.
Nothing wrong with using something like IUP or wxWidgets though.

>> No.44302985

>>44281929
I inherited a legacy application with functions of hundreds of lines, and classes of thousands. Longest file was a single class, which was really just a block of procedural code wrapped in curlies, it was eleven thousand lines long.

>> No.44303934

>Program uses more than one file.

>> No.44304531
File: 52 KB, 432x324, iii_ensol_richard_stallman.jpg [View same] [iqdb] [saucenao] [google] [report]
44304531

>text editor does not include diary, shell, and email client

>> No.44304812
File: 88 KB, 500x542, 0000.jpg [View same] [iqdb] [saucenao] [google] [report]
44304812

>program uses dynamic linking

>> No.44306087
File: 38 KB, 241x251, 1308028522253.jpg [View same] [iqdb] [saucenao] [google] [report]
44306087

>program doesn't have thumbnails >>44302867

>> No.44306100

>>44306087
You fucked up and you should feel bad.

>> No.44306270

>>44304812
Since when is plan9 for static linking?

>> No.44306513

>>44306270
wot m8

>> No.44306575

>>44296688
int func(void)
{
mutex m
char *buf;
FILE *f;
size_t sz;
int ret = 0;

if (!(f = fopen("file", "r")))
return -1;

sz = filesize(f);
if (!(buf = malloc(sz)))
ret = -2;


if (fread(buf, 1, sz, f) != sz)
ret = -3;


lock(m);
if (update_shared_buf(buf, sz) != 0)
ret = -4;


switch(ret) {

case -1 :
case -2 :
unlock(&m);
case -3 :
free(buf);
fclose(f);
}

return ret;
}

>> No.44306619

>>44306270
since always

>>
Name (leave empty)
Comment (leave empty)
Name
E-mail
Subject
Comment
Password [?]Password used for file deletion.
Captcha
Action