User:Guest-1052/coding: Difference between revisions
Jump to navigation
Jump to search
Guest-1052 (talk | contribs) (add Milk.JS release) |
Guest-1052 (talk | contribs) No edit summary |
||
(One intermediate revision by the same user not shown) | |||
Line 25: | Line 25: | ||
}; | }; | ||
setTimeout(_=>{milk.spoiled=true},50500) } | setTimeout(_=>{milk.spoiled=true},50500) } | ||
</syntaxhighlight> | |||
Java but Javascript!! ! ! ! !! ! ! !! ! ! ! ! ! ! | |||
<syntaxhighlight lang="js"> | |||
"use strict"; | |||
/* | |||
This is how you can make Javascript look more like Java: | |||
1. use CamelCase for naming variables instead of snake_case | |||
2. Use curly brackets to define blocks of code, even if they contain only one statement | |||
3. Use semicolons to terminate statements | |||
4. use doubles quotes instead of single quotes for strings | |||
5. use strict mode | |||
6. make the code into one big function called main() | |||
*/ | |||
function main(){ | |||
window.w.chat.send("Im using this more java looking javascript syntax to send this message"); | |||
}; | |||
main() | |||
</syntaxhighlight> | </syntaxhighlight> |
Latest revision as of 09:39, 21 October 2023
Oh, hello there.
I made this page just to share my code. And document me coding in programming languages like assembly.
PS: Im horrible at Assembly, but i will try and learn more of it, because its really fun.
I also might document some newer coding news like how WebGPU is better than WebGL and how fast it is.
And how ChatGPT isnt the best programmer.
Code
Hmmm...
class Main{
public static void main(String args[]){
System.out.println("Hello World!");
}
}
It has been released... MILK.JS. DO BUYMILK()!
buymilk= function()
{
milk={
drink:_=>{console.log("slurp slurp");if(milk.spoiled==true){console.log("dies")} delete milk},
throwaway: _=>{delete milk},
spoil:_=>{milk.spoiled=true},
check:_=>{if(milk.spoiled==true){console.log("Your milk isnt spoiled")} else{console.log("Your milk is spoiled :(")}},
spoiled: false
};
setTimeout(_=>{milk.spoiled=true},50500) }
Java but Javascript!! ! ! ! !! ! ! !! ! ! ! ! ! !
"use strict";
/*
This is how you can make Javascript look more like Java:
1. use CamelCase for naming variables instead of snake_case
2. Use curly brackets to define blocks of code, even if they contain only one statement
3. Use semicolons to terminate statements
4. use doubles quotes instead of single quotes for strings
5. use strict mode
6. make the code into one big function called main()
*/
function main(){
window.w.chat.send("Im using this more java looking javascript syntax to send this message");
};
main()