No comments in the code

>No comments in the code
>Comments in the code
>Documentation in the code
How enlighten are you?

Attached: file.png (600x315, 350K)

Other urls found in this thread:

github.com/thi-ng/geom/blob/master/geom-svg/src/examples.org
twitter.com/NSFWRedditGif

my code is the comment

No comments in the code. Reading the code and knowing what it is supposed to do is enough

code in the documentation

>Comments in code
>Documentation
>Examples
This does it all.

no comments, extremely verbose yet descriptive function and variable names

i'm retarded so i leave keywords to remember the time that i wrote the code, no one runs my programs or read my code anyway.

>code works
>...why?
>code doesn't work
>...why?

this.

no code in documentation

>tfw you document the hell out of all of your code because you won't remember what it did last time you see it.

No comments
Single letter variable names

All of my source files are readable through the emacs org-mode, as each function is pretty exaustively commented. This is what knuth said to be the literate programming, and I'm glad it exists. My colleagues sometimes compliment with me on how readable everything is.

based

intentionally misleading comments, 30 characters long randomly generated variable names

Sparse comments in the code mostly to remind me what I did to make something work when I was on drugs + documentation for other things.

>see the code you did few years ago
>"holy shit who did this its awful"
>view history

Attached: slide.png (400x750, 187K)

How do you do this user? I use emacs org mode for a lot of stuff and I didn't know you could do something like this

also add static typing

emacs org mode allows you two very cool things - inlining code in your org files, and even executing it. With a bit of fiddling you can make your file look like a regular source file with a bunch of comment blocks, which make the magic happen as soon as you activate the org-mode on the window with your file. Sort of like this guy's sources: github.com/thi-ng/geom/blob/master/geom-svg/src/examples.org

>images in source code

>Documentation via the type declarations

Attached: ad0bc659bbf1812ee92b6a14998b8984.jpg (680x490, 110K)

ed

i write brief descriptions of what a function is supposed to do, its compromises, and maybe what it actually does (fuckall usually). i can't be remembering the shit i did months ago in some 1000 lines of spaghetti enterprise shit that I can't rewrite for clarity's sake

Automatically generated documentation based on comments. The ExDoc way.

>Code in the documentation

Attached: Literate_Programming_book_cover.jpg (258x386, 13K)

I do not comment unless I have to hand the code in, where I state the most obvious things.

Comments are truly useless, I do not get why anyone would spend time on them.

Code full of apologies for implementing it like this, ideally with copious swearing

does ANYONE even use literal haskell

>no code

sw is liability

regex is the exception, I approve comments for regex

Documentation is generated from comments specially marked comments in code. I try to leave comments in any function longer than a few lines so i can skim the comments rather than reading the entire function to remember what it does.

Many of my comments are just "do this" as a summary, but I also try to include "assumes X" comments where necessary.

>Documentation IS the code

Attached: 1512826410292.jpg (923x860, 261K)

>"assumes X" comments

assert()

"A Haskell program is guaranteed free of any side-effects because nobody ever will ever run it"

Either unemployed or you write full code, no shortcuts.

I use assertions where applicable, but often the assumptions are more complex than can easily be verified in an assertion.

have intercourse

like what? you can't execute comments. Why have complex assumptions in comments instead of assertions / tests whatever. How can you work that way? I would be suspicious about bad abstractions / domain modeling, if you can't break down and codify

>includes help function with argument in code, one of which is a help argument that lists all the help functions
>Each function accepts help argument and returns documentstion on that argument
>readwrites to hidden .text file changing the value from 1 to 0 if any of these help functions are called
>help calls are directed to another text file if that value if 0, which gives seemly correctly but slightly incorrect information that start writing random brackets to lines in the index.js file

So you just the standard stuff in the Org guide, ch 14? It's all that stuff "working with source code"?
Seems like it could be pretty useful. It wants lisp so you can't use c-c c-c to execute/compile code, can you? It looks like you have to tangle the file first to export the blocks and compile the result. How do you tell it to tangle blocks by default?

This is all very interesting to me user

Mostly documentation comments for functions (or classes, if that applies), few comments inside them.

Not him but from what I read it works at least with Python and Bash as well. Not sure about compiled languages.

No code

No documentation

I've worked in defense where we wrote a lot of code around average people. Now working at a FAANG, where no one writes any comments and everyone is expected to be competent enough to understand the code.

I have to say, I used to like comments but I don't anymore. However, a helpful README goes a long way, and comments can save a lot of time and context switching on APIs that will be used by other services.

Comments instead of code

Attached: 1558556133134.png (400x620, 275K)

After a little digging I got the compiled languages working. It provides a trivial main encapsulation so you can just run snippets, too

>How do you tell it to tangle blocks by default?

You can set default src block options in the main properties drawer somehow.

anyone got that male vs female pic where the girl over comments everything and adds emotes?

A function that takes in a complex object or several parameters that require a set state, possibly intended as an internal helper function, and only designed to be called after proper initialization of the object wouldn't want to perform error testing or state checking when it can be assumed that things are properly done

>Comments in the variable names

int makeSureThisNumberDoesntGoUnderZeroAlsoMakeSureToTestAgainstNiggerNumbers = 69;

>AI building code from comments
The highest level

>//TODO: fix it later

Attached: 1539164070816.png (1000x667, 1011K)

>extremely verbose yet descriptive function and variable names
literally me plus anally long comments because my dumbass forgets why I did something pretty fast

I comment every line of code.

Attached: 1551071445534.jpg (327x239, 10K)

code is documentation

No code
No comments
Only documentation

>Comments in code

If I see more than a few comments in code I'm ready for it to be a wild ride into shit design.

Break your methods down into their simplest component, name your shit what it actually is, and your code will make sense immediately.

If you find yourself commenting what sections of a method do, break that fucking method out into separate methods until they're responsible for one fucking thing.

The only time you should need to comment is when you're doing something that looks truly atrocious for a good reason (rare).

>
do the needful kindly kind sir

A quine composed of documentation for which reading it causes the source code to be printed.

when i write something for myselft, nothing
when i write something for others, the full thing

Other than the mandatory documentation explain what each method/class does, I only write comments if it's not clear what clear what the code is doing or to explain why I'm doing certain things in a particular way.

>Descriptive names on everything
>Methods and classes broken down properly
>Readme attached to the project giving a very brief overview of what it does, and how to run it
>Documentation somewhere else describing the relevance of the project to the business and design decisions around it

Perfect.

>The only time you should need to comment is when you're doing something that looks truly atrocious for a good reason (rare).

Not so uncommon if you're working on an very restrictive platform and you need to fix something or add a feature to a codebase that's getting very close to the platform's limits. You either rewrite large portions of the codebase or do something "atrocious".

Minimal comments only where necessary that explain why, not what. Overly verbose function and variable names (probably even too verbose, still working on that). Ton of asserts everywhere (this alone has probably saved me countless hours of debugging and head scratching).

I don't code, I just write documentation and file bugs.

Get on my level, codemonkeys.

captchas in the comments