Open loglot opened 11 months ago
explain this then
I meant comments within the code, starting with //
I meant comments within the code, starting with //
Look! It's comments within the code! There's even a //
before them!
My comments usually begin with "uhm..." or "by the way". Can we use these as a comment indicators?
btw this contains the number of seconds per day
const const const x = 86400!
uhm... this calculates the seconds for an amount of days
fn y(z) {
return z*86400!
}
also todo but whenever you use todo it gives you a warning, you'll never do it
code.wwpsmdfosajluaahniavw
todo: fix broken code
if (;Foo=Bar) {
console.log("Foo ≠ Bar")
}
Output
WARNING: It will never happen code.wwpsmdfosajluaahniavw:26:-1
Foo ≠ Bar
Shouldn't it rather tell ERROR: Refusing to accept imperfect program
?
Just to be clear, if you want to add comments, just write some code that would be interpreted as an implicit string.
This function adds too numbers together
function add (a, b) => {
return a + b!
}
Technically, it would be interpreted like this:
"This function adds too numbers together"!
function add (a, b) => {
return a + b!
}
Be careful not to accidentally put code into your comments.
print a welcome message to the console
function greet () => {
return "Hello!"!
}
This would be interpreted as such:
print "a welcome message to the console"!
function greet () => {
return "Hello!"!
}
You could also do
If(true === false) {
c = Hello there, this is a comment!
}
however, the following might not work
If(true === false) {
c = Hello there, this is a comment! I like this comment
}
you could also do
print print a welcome message to the console
function greet () => {
return "Hello!"!
}
however, be carefull
print print print will print a comment that starts with print into the console
print print a welcome message to the console
...
print print print print will print a comment that starts with print print into the console
print print print will print a comment that starts with print into the console
print print a welcome message to the console
...
and so on untill
print print print print print print print print print print print print will print a comment that starts with print print print print print print print print print print print into the console
print print print print print print print print print print print will print a comment that starts with print print print print print print print print print print into the console
print print print print print print print print print print will print a comment that starts with print print print print print print print print print into the console
...
Comments are a relic of ancient programming languages, noone uses them, and whoever does just isn't good at programming