TodePond / DreamBerd

perfect programming language
https://dreamberd.computer
Other
11.04k stars 340 forks source link

Remove comments #325

Open loglot opened 11 months ago

loglot commented 11 months ago

Comments are a relic of ancient programming languages, noone uses them, and whoever does just isn't good at programming

TodePond commented 11 months ago

explain this then Screenshot_20230818-230844

loglot commented 11 months ago

I meant comments within the code, starting with //

mybearworld commented 11 months ago

I meant comments within the code, starting with //

Look! It's comments within the code! There's even a // before them!

Comments in the HTML code. With a // before.

stohrendorf commented 11 months ago

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!
}
ktlknss commented 11 months ago

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
stohrendorf commented 11 months ago

Shouldn't it rather tell ERROR: Refusing to accept imperfect program?

TodePond commented 11 months ago

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!"!
}
loglot commented 10 months ago

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
...