Definder - what does the word mean?

What is oneliner?

Oneliner in programming jargon is used to describe code that is written in only one line. Usually such code is unreadable and a spaghetti code, written for sole purpose of exercise or in competition with others to write the shortest code possible (code golfing). It is also possible to "cheat in a oneliner": some programming languages have special characters that can be used instead of a new line (usually semicolon ";" ). Such oneliner is boring and doesn't show any obscure knowledge in a language of choice.

Example oneliner in python:
print("You've rolled:",__import__("random").randint(1,6))
Where cheated one would look like this:
import random; print("You've rolled:", random.randint(1, 6))
And the normal program would look like:
import random
print("You've rolled:", random.randint(1, 6))

All of the example codes above do a one thing: simulate a dice roll.

- I've written this oneliner, but now I don't know what it does.

👍25 👎11


oneliner - meme gif

oneliner meme gif

oneliner - video

loading

Oneliner - what is it?

Same as: one-liner, one liner
Oneliner in programming jargon is used to describe code that is written in only one line. Usually such code is unreadable and a spaghetti code, written for sole purpose of exercise or in competition with others to write the shortest code possible (code golfing). It is also possible to "cheat in a oneliner": some programming languages have special characters that can be used instead of a new line (usually semicolon ";" ). Such oneliner is boring and doesn't show any obscure knowledge in a language of choice.

Example oneliner in python:
print("You've rolled:",__import__("random").randint(1,6))
Where cheated one would look like this:
import random; print("You've rolled:", random.randint(1, 6))
And the normal program would look like:
import random
print("You've rolled:", random.randint(1, 6))

All of the example codes above do a one thing: simulate a dice roll.

- I've written this oneliner, but now I don't know what it does...

👍25 👎11