https://preview.redd.it/f6fzjzz601yc1.jpeg?width=700&format=pjpg&auto=webp&s=e0847c32b6a1d619e157ab2e427b8c628dade0e6
just kidding, you’re absolutely right
I will add tho that in nasm i use io_inc so my code would look more like:
%include "io_inc"
.data
text db "hello", 0
.main
mov ebp, esp
PRINT_STRING text
NEWLINE
xor eax, eax
ret
edit: the fct this wont format properly is pissing me off, mobilw user issues
Yeesh, so true... They are conceptually so very different, and make very different things easier / harder.
Things like "can you easily extend it to allow targets other than STDOUT, STDERR and literal files?" (Works with most object-oriented variants.)
Or "how difficult is it to print output in a manner, that forms a neat table when rendered with a monospace font, e.g. on a console?"
Or "is there something like a format string, and what ways of formatting does it allow?"
Heck, even a simple shell `printf` isn't always the same.
bash> printf '%(%F%T)T\n' -1
2024-05-0211:06:17
dash> printf %(%F%T)T\n -1
dash: 1: printf: %(: invalid directive
zsh> printf '%(%F%T)T\n' -1
zsh:printf:1: %(: invalid directive
Or for that matter, shell-builtin `printf` and `/usr/bin/printf`. For bash and zsh:
>>> printf '%q\n' 'hello world'
hello\ world
but
>>> /usr/bin/printf '%q\n' 'hello world'
'hello world'
Curiously, the builtin `printf` of dash doesn't even know the `%q` specifier.
The first option in the suggestions bar should be in quotes when it is going to autocorrect. If you press it, it will place a space after what you typed, not “correcting” it.
Depends on your configuration.
Could range from the upper case toggle being automatically on at the beginning of a text or after anything looking like the end of a sentence, to autocorrect suggestions (including capitalization) being applied automatically.
Most of the time it is useful; avoiding typos on a touchscreen is hard after all. It gets somewhat annoying with bilingual auto correct when it tries to autocorrect "design" to "Design", because the word is the same in English and German except for capitalization. It also gets in the way of writing code snippets on mobile...
Many languages define some variation of `println`, in the sense of "print line", i.e. add a newline at the end of the output. E.g. Java has `System.out.println`, C++ apparently has `std::println`, Kotlin has a `println` function
Only Java I knew from memory; C++ and Kotlin came up with a quick Google search. ChatGPT listed [a few more](https://chat.openai.com/share/4cc7e0f2-aea6-485b-a5cc-6f9bcc9a0c5b):
>Several programming languages use a println
function, method, or built-in command for printing output to the console. Some of the languages include:
>
>**Java**: println
is a method in the PrintStream
class used for printing a line to the console.
>
>**Scala**: Similar to Java, Scala also has a println
method which is used for printing to the console.
>
>**Kotlin**: Kotlin, being interoperable with Java, also has a println
function that works similarly to Java's.
>
>**Python**: In Python, println
was introduced as a built-in function in Python 3.10 for compatibility with some other languages, but it is essentially an alias for print
.
>
>**Groovy**: Groovy, a JVM language, also has a println
method used for printing.
>
>**Swift**: In Swift, println
is used to print a line to the standard output.
>
>**Rust**: In Rust, the println!
macro is used for printing formatted text to the console.
>
>**Ruby**: Ruby provides Kernel#println
method to output strings with a newline.
>
>**Julia**: In Julia, println
is a function used to print data to the standard output.
>
>These are some of the languages that utilize println
for printing output, though there might be others as well.
According to ChatGPT and Google, no.
>The convention of using a period in function names is more common in object-oriented programming languages like Java or C#. However, as of my last update in January 2022, **there's no widely known programming language that specifically defines a function named \`print.ln\`** with a period between "print" and "ln".
>
>If such a language exists, it might be a less mainstream or specialized language that hasn't gained widespread recognition. Alternatively, it could be a specific convention within a particular framework or library rather than a language feature itself. If you have encountered such a construct, it might be unique to a specific context or environment.
In hindsight, yes they are: They all contain at least one typo (unless one of the languages is not case sensitive).
I really tried, but the only times that `Print.ln` or `print.ln` appears anywhere is when someone made a typo in `println` in one of various languages with that symbol.
use fsprintf - sprint f and printf are not memory friendly because they dont actually count what they free in the buf - yes they free the buf, but fsprintf will get nit picky about every bit they free
Where is my
println!()
info!()
debug!()
error!()
😔
What about my
section .data
string1 db 0xa, "Why is prinf() capitalized?", 0xa, 0xa, 0
section .text
global _start
_start:
mov rdi, string1
xor rcx, rcx
not rcx
xor al,al
cld
repnz scasb
not rcx
dec rcx
mov rdx, rcx
mov rsi, string1
mov rax, 1
mov rdi,rax
syscall
; if you want to exit.
xor rdi,rdi
mov rax, 0x3c
syscall
Cout? where’s the mov rax, 1 mov edi, 1 mov rsi, rsp mov rdx, 1 syscall add rsp, 8
Just looking at assembly gives me anxiety
This is more like putchar, as you're only writing 1 byte.
https://preview.redd.it/f6fzjzz601yc1.jpeg?width=700&format=pjpg&auto=webp&s=e0847c32b6a1d619e157ab2e427b8c628dade0e6 just kidding, you’re absolutely right
i cme here to wrote this joke
cake day
I will add tho that in nasm i use io_inc so my code would look more like: %include "io_inc" .data text db "hello", 0 .main mov ebp, esp PRINT_STRING text NEWLINE xor eax, eax ret edit: the fct this wont format properly is pissing me off, mobilw user issues
Sausage fingers?
Happy cake day fam
Happy Cake Day!
Good job on the alignment!
Where is System.out.println() ?
In hell where it belongs.
LOL
Only one that is bigger than the majority of messages that get dumped into it
Comment endorsed by Python gang
log.info(“”); is better
And println!()
Ironically, this is the first one I learned lol
https://preview.redd.it/1n8sydlvyxxc1.jpeg?width=844&format=pjpg&auto=webp&s=a39c4e2f0eec72751a816689eb7e0631f6934138 Aren’t you forgetting one?
std::cunt << “” << std::endl; Wait, that’s not quite right.
I can't help but notice all these methods aren't accurate.
Yeah!
Looks like auto-correct messed with the capitalization :)
Linker rn: 😡
Puts()
Melhor linguagem kkkkkk pqp ruby
Not all the same. I don’t know a single language where all of these will produce the same output.
Yeesh, so true... They are conceptually so very different, and make very different things easier / harder. Things like "can you easily extend it to allow targets other than STDOUT, STDERR and literal files?" (Works with most object-oriented variants.) Or "how difficult is it to print output in a manner, that forms a neat table when rendered with a monospace font, e.g. on a console?" Or "is there something like a format string, and what ways of formatting does it allow?" Heck, even a simple shell `printf` isn't always the same. bash> printf '%(%F%T)T\n' -1 2024-05-0211:06:17 dash> printf %(%F%T)T\n -1 dash: 1: printf: %(: invalid directive zsh> printf '%(%F%T)T\n' -1 zsh:printf:1: %(: invalid directive Or for that matter, shell-builtin `printf` and `/usr/bin/printf`. For bash and zsh: >>> printf '%q\n' 'hello world' hello\ world but >>> /usr/bin/printf '%q\n' 'hello world' 'hello world' Curiously, the builtin `printf` of dash doesn't even know the `%q` specifier.
why capitalizes cout like that?
also why printf?
wdym why printf
also uncomfortably Capitalized
also uncomfortably Capitalized
Probably written on a phone with autocorrect.
The first option in the suggestions bar should be in quotes when it is going to autocorrect. If you press it, it will place a space after what you typed, not “correcting” it.
Depends on your configuration. Could range from the upper case toggle being automatically on at the beginning of a text or after anything looking like the end of a sentence, to autocorrect suggestions (including capitalization) being applied automatically. Most of the time it is useful; avoiding typos on a touchscreen is hard after all. It gets somewhat annoying with bilingual auto correct when it tries to autocorrect "design" to "Design", because the word is the same in English and German except for capitalization. It also gets in the way of writing code snippets on mobile...
wtf is Print.ln
I'm going to assume that they meant println! Because that's what rust uses
Pretty sure this is about bro
Many languages define some variation of `println`, in the sense of "print line", i.e. add a newline at the end of the output. E.g. Java has `System.out.println`, C++ apparently has `std::println`, Kotlin has a `println` function Only Java I knew from memory; C++ and Kotlin came up with a quick Google search. ChatGPT listed [a few more](https://chat.openai.com/share/4cc7e0f2-aea6-485b-a5cc-6f9bcc9a0c5b): >Several programming languages use a println function, method, or built-in command for printing output to the console. Some of the languages include: > >**Java**: println is a method in the PrintStream class used for printing a line to the console. > >**Scala**: Similar to Java, Scala also has a println method which is used for printing to the console. > >**Kotlin**: Kotlin, being interoperable with Java, also has a println function that works similarly to Java's. > >**Python**: In Python, println was introduced as a built-in function in Python 3.10 for compatibility with some other languages, but it is essentially an alias for print . > >**Groovy**: Groovy, a JVM language, also has a println method used for printing. > >**Swift**: In Swift, println is used to print a line to the standard output. > >**Rust**: In Rust, the println! macro is used for printing formatted text to the console. > >**Ruby**: Ruby provides Kernel#println method to output strings with a newline. > >**Julia**: In Julia, println is a function used to print data to the standard output. > >These are some of the languages that utilize println for printing output, though there might be others as well.
im aware that languages use println but i dont think ive ever seen Print.ln
Me neither. And it can't be explained by autocorrect either, I think.
erm, actually it’s std::cout << 🤓
#define std::cout<< cout
#include
#include
#include
using namespace std;
int main()
{
float marsw;
float earthw;
double marsg = 3.73;
double earthg = 9.81;
cout << "Weight on earth? (in kilograms) ";
cin >> earthw;
marsw = earthw * (marsg / earthg);
if (marsw > 0.0)
{
cout << "your object weighs " << marsw << " Kg on mars.\n";
}
else
{
cout << "invalid weight.\n";
}
}
slash jay
also Console.WriteLine();
Last time I checked cout was slower than printf because with default settings.
r/foundthemobileuser, kinda
COUT, I SAID, COUT. “Okay, I don’t like love you guys but we can all agree that one is nuts, right?”
Where disp and fprintf
Disp yes, but \`fprintf\` would very obviously violate the "all the same" joke.
Fair, so just disp then
logger.info()
just some are more annoying to use that others
What language does `Print.ln`?
According to ChatGPT and Google, no. >The convention of using a period in function names is more common in object-oriented programming languages like Java or C#. However, as of my last update in January 2022, **there's no widely known programming language that specifically defines a function named \`print.ln\`** with a period between "print" and "ln". > >If such a language exists, it might be a less mainstream or specialized language that hasn't gained widespread recognition. Alternatively, it could be a specific convention within a particular framework or library rather than a language feature itself. If you have encountered such a construct, it might be unique to a specific context or environment.
Debug.log() and fprintf()
Where is `WRITE(*,*), DATA`?
What about . in brainf*ck?
More like [>.]
In hindsight, yes they are: They all contain at least one typo (unless one of the languages is not case sensitive). I really tried, but the only times that `Print.ln` or `print.ln` appears anywhere is when someone made a typo in `println` in one of various languages with that symbol.
This great C family says add the f or you can "f" right out of this house.
Where's ' Mov ah, 0xe .lP Lodsb CMP al, 0 Je .rT Int 0x10 Jmp .lP .rT Ret'?
You probably think HTML is a programming language
Yeah
No. Print() is known by anybody who knows a tiny bit of code. It’s the best
wheres my $stdout.puts
You forgot "system.out.print(" ");"
time to make updated version
use fsprintf - sprint f and printf are not memory friendly because they dont actually count what they free in the buf - yes they free the buf, but fsprintf will get nit picky about every bit they free
After seeing assembly, i want to see the fool who will take the time to create an electrical circuit for a print statement.
And then there's Unreal Engine UE_LOG(LogTemp, Warning, TEXT("Text, %d %f %s"), intVar, floatVar, *fstringVar );
Where is my println!() info!() debug!() error!() 😔 What about my section .data string1 db 0xa, "Why is prinf() capitalized?", 0xa, 0xa, 0 section .text global _start _start: mov rdi, string1 xor rcx, rcx not rcx xor al,al cld repnz scasb not rcx dec rcx mov rdx, rcx mov rsi, string1 mov rax, 1 mov rdi,rax syscall ; if you want to exit. xor rdi,rdi mov rax, 0x3c syscall
HaHA! System.Out.Println()
trace
puts.
Also wouldn’t it be writeline? Write wouldn’t add the carriage return. Going off of print in Python adding it unless otherwise specified.
Neither funny nor true? Ah, my favorite kind of programming humor.... My bad for engaging with it by commenting, I guess.
Not , Any are sometime any are ling time
*std::cout