#development
1 messages · Page 63 of 1
or the code changed entirely
a "bot" is nothing more than a vessel, an interface to communicate with discord
the code inside is entirely hidden from the user
Your bot can join a server, create a webhook and leave.
Since the bot created the webhook it can still respond to interactions on the webhook.
You could in theory create a lot of features with that.
Just no guild info
Hey does topgg moderators dm you?
doesn't interactions require the command to be registered?
also can i not host a GA asking people to leave a review on the bot? im just asking them to leave a review be in good or bad, not forcing any sort of number on anyone
Well, deletions can be completely disabled or locked down. An idea for how deletions can be locked down: No channel deletions or anything else similarly destructive or kicking/banning users, can only delete messages posted by bot
I have a D.js Select Menu, I await the interaction (works fine)
After the response has been sent I show a modal, I want to reply to the modal by editing the message of the select menu and closing the modal.
modal.reply makes a new response
selectmenusubmit.update doesn't close the modal
selectmenusubmit.update "reply to this interaction has already been sent or deferred"
What method should I use?
D.js version 14.0.3
Commands couldn't be done. But a select menu with a list of "commands" would work
Got this DM, tryna make sure its legit
-scam: send steam scams to all users
or that ^
Well, most scams are being done my selfbots
someone pls help, ty
yes, and discord has one hell of headache on that issue
so i can do GA asking for people to leave a review?
topgg mods wont say "hi I am a mod"
DM request limit, limited API for everything
Do abide by Top.gg's Terms of Service. You can find our full Terms of Service at https://top.gg/terms. Do not include any spam, offensive, or unrelated content in your reviews. Nobody likes reviews that are meant to offend people. Make sure ...
they shared this link
Fellintron is a mod in this server, but make sure their user ID matches the one from this server
returns to my point: bots cant reliably use dm now, gaming bots that use it die
gaming bots can verify, back to my other point
Then it's not a scam, it's legit
what if they dont want to?
totally fake /j
:p
i copied their user ID, and it showed yours?
and yeah respond to the dm ASAP please :)
yeah it's me you don't have to worry
but whats totally fake?
/j means joking
simply dont answer to the hook twice
Well, making most of the bots that can't scale because of the ID requirements scale is better than making none of the bots scale
modal.reply already acks the interaction, any further edit has to be done to the message itself
not the hook
I can’t believe you’ve been arguing about this for so long. It’s not gonna change, verify with your ID or don’t verify at all
I know it's not going to change, I was just presenting another way to fix the problem that the minority of bots are facing, not like discord is going to take this advice anyways
tbh, ID's are easy and cheap to obtain. If a bot owner doesnt want to get an ID, or are unwilling to supply that to a huge company like stripe the bot probably wouldn't scale far anyway.
The minority are mostly people who care a bit about privacy, or live in third world countries.
I'm not exactly sure, but IDs probably aren't as easy to get in some countries
Someone who is privacy conscious probably would support protecting the privacy of users right? which is what this is for.
You're not acting as a user as a bot developer, you kind of have to forfeit some privacy when developing things with another company.
I cant comment on people who are not able to work with stripe, stripe doesn't support a lot of countries.
There are valid ways around that though.
Such as finding someone else who will verify the bot.
At the end of the day, discord has to do whats best for the platform and their users. which is the goal of the verification system.
Not all people want to forfeit some privacy, but I think the people who won't give an ID because of privacy are very little compared to the people in third world countries
You're free not to supply your ID, discord is free to limit your bot's reach
Simple trade rules
If you are really dedicated to making an application on discord without supplying an ID that can be used in more than 100 guilds at once I do think its possible, with some heavy limitations.
You could in theory make a bot that has a single command.
That command could create a channel, lock the channel so users cant send messages in it, and create a webhook.
Then on the webhook you send a message with help information, and a select menu to run something like a command.
once setup, the bot leaves the server.
Your application can still interact with the webhook, and you can still receive interactions with select menus or buttons on messages sent by that webhook.
it could scale as far as you want.
One message removed from a suspended account.
One message removed from a suspended account.
hi faith
One message removed from a suspended account.
Not me… smh
how do let users get params (:id) like in express with the node:http library?
aka recognize /lol/hello/ok as /lol/:word/ok, word = hello
are u trying to replace express with node http?
in some ways, yes
don't
there's more than a simple facade, you're in for a lot of headache trying to make an http server using raw api
well you'd use regex to extract that data
could I technically split the url into an array by / and get the params index value by that?
that too
split uses regex in js iirc
worth to note u wont be able to get params by name if u use split
how would I know that its still the url that the user defined though?
regex
this is my current logic
how would I go about it here
because in this case it would return nothing
it only checks if pathname is literally in the saved urls
how would I exactly go about implementing it though?
do u know how regex works?
no, actually yes but no
you need to build an expression that compares against the url
ignoring parts that are variables
how would I know what part is a variable though with just having the request url?
by comparing with the url
you're missing the part where u iterate over each url saved in the list
no, by far
you need to literally write a regex pattern to extract the variables (and their names), then check if the supplied url matches the inverse of that regex
can probably be done with split + loop tho
any tip before i am finished?
configure cache size
to what
...to whatever resources your server has
make sure to not allow external postgres user login
am i gonna need this all
postgres comes with default settings, which obviously isn't optimized for ur server
u only need the first and last
so no admin4?
pgadmin is for managing the database, technically not needed but enable it if u want a gui
can i run that in localhost if i don't install pgadmin
pgadmin is a manager, not the database
the database will run regardless of what u install
yes yes but can i run some sort of manager on localhost
i can't explain i saw some other guys they had something very similar to pgadmin
but it wasn't it
it was simple
running on localhost
basically not an app
lmao
well i am gonna install it again an this time let's hope it does the job
yes i am aware
pgadmin doesn't do anything other than present a visual interface for the CLI
having it or not won't influence how postgres work
gotchya
this is as far as my regex knowledge goes
[A-Za-z0-9]+ will match a word
but u cant include : nor / in the match
why?
so put () around the word pattern
because those aren't part of the name of the variable
those are boundaries
ok, I am now a bit confused how to continue
I mean, I got a regex that matches var names ut what to do with it?
now u invert that regex and compare against the url
it'll compare anything but the variables
how do I invert it?
(?!pattern)
try doing it with split + loop tho, it'd probably be easier for u
split by / and iterate over each part
split both template and input urls btw, not just input
if both have the same array length, continue, else stop cuz they cant be equal
🤯 it makes sense
after that it's just comparing template[i] with input[i]
if template starts with :, save the current input index as a property
else compare if both are equal
is this kinda correct before I continue?
One message removed from a suspended account.
its not in a try it state yet
I can only put actualUrl outside the loop though, right?
actually, I can just store most of that in the urls json
why would I use bdscript to make a web server
Oh
bdscript 💀
I thought u r making bot
Creepy?
nah, just "yet another bot builder"
which end up to be constrained af and usually, harder to deal with than if u just used normal programming
lol bdscript
Why lol?
that's like so basic
cant I just check if hasParams is true and then know if I need to get params or its just a normal url?
Being basic sounds funny?
it's because bot builders don't have a good rep around here
💀
Somebody know how to avoid root perms in Termux?
I tried
how do I know which template to use? Do I put that in my other loop?
so input = reqUrl.pathname?
yes
but I need to uh w- its stored under /userinfo/:username but I dont know that its there
because there are many urls
you'll iterate over each url
ah so your code snippet just goes in a for loop with every url that has params?
with every url
why every?
and wouldnt just checking for lenght result in /userinfo/:username and /userdata/:username being the same?
yes, that's why u also check each param
because you cant know otherwise
ok, imma just not ask questions and copy the code snippet first
pay attention to it, dont simply copy blindly
like this?
u forgot to return vars
if the inner for completes, then it's a match
nvm
well, just return var after u have a match
it shouldn't be
also ur not supposed to change iterator variables
simply use for (... of ...)
these are my logs,
and the first two variables are useless
well, u started a webserver, it'll obviously never end
are u sure that's a school project?
it just means the server now runs
yes
ok, it works now, atleast it responds
for some reason the loop isnt executing at all though
probably because ur prefixing the url with /
told u how to do it, now it's ur turn to solve that
no like, the actual loop isnt running, the upper one
I dont understand why
urls:
'/lol': {
hasParams: false,
array: [Array],
type: 'GET',
code: [AsyncFunction (anonymous)]
},
'/lol/:username': {
hasParams: true,
array: [Array],
type: 'GET',
code: [AsyncFunction (anonymous)]
}
]```
loop:
did u try printing what urls is?
yes, the thing in the upper part of the message
that's a print result?
yes
well then, it's because you're returning
even
console.log(e)
}```
doesnt work
are u sure it's really entering wherever that code is?
hmm, half of the code works now
oh yeah, because I used in
of:
this works
e = urls[e]
console.log(e)
}```
e = urls[e] 
Imagine seeing this in Java
ConcurrentModificationException would like to know your location
I have a value that can be 0 to 1
If it's 0.6 I want it to be 0.4, if it's 1 I want it to be 0 If it's 0.3 I want it to be 0.7, get me?
What's the math
it wouldn't throw a CME cuz they aren't changing the collection values, just the iterator
still a fucked up habit tho
max - value
I see, thanks
Hello im trying to simply download files from my url with nodejs
When i try
file = fs.readFileSync("./x.pdf")
and res.send(file)
And when i go this slash it works but it download without extintion i mean it just downloads x not x.pdf i need to rename it how cna i fix it?
first of all, readFileSync reads a file, it doesn't "download" anything
second, what is res? the answer can change drastically depending on what that is
Oh yeah that’s right I forgor
💀
how can I get the put body of the request and forward it to the custom function to use?
req.body
read the docs
since when does node:http have docs
since eniac was built
is this it?
cant really find anything else
keep searching
do I have to use res.on('data', (d) => { console.log(d) })?
that'll just print the request itself
I have now went trough every body word on the page and found out how long my post body is
did u try pressing ctrl + space after typing .?
if ur using an IDE* it should show u all the possible attributes
- text editors aren't ides
yes
Ok, lemme cut it down, do I need to use a function? aka cube?
cube?
I have never heard of a method being called a “cube” before 💀
that tells me I have a body somewhere thats just a string
@neon leaf
https://nodejs.org/docs/latest-v18.x/api/http.html#httprequesturl-options-callback
In a successful request, the following events will be emitted in the following order:
'socket'
'response'
'data'any number of times, on the res object ('data'will not be emitted at all if the response body is empty, for instance, in most redirects)
'end'on the res object
'close'
You need to listen to the data event of the response to get the body of the request, concatenate the data, and finally use it's final value
Although you shouldn't really use the built-in node:http (or node:https) to make such requests because it's not easy to work with and are very low-level as mentioned, you should just use an existing high-level HTTP client such as Undici or Node-Fetch
but how can I send the data to a user defined function? Because its an Event it can also take 1 sec and not be sent
they for some reason need to use it for a school project
Ah, not sure why exactly the built-in modules are needed instead of dependencies but fine
You can use promises to wait for the data to be fully collected, and then send it or use it afterwards
my teacher told me that if I could somewhat remake express with node:http that I would be "hired" by him (aka I make apis for the school website and get paid)
after chitty I don't really question anymore
I'm getting worried for american IT students
That's a very ambiguous request from a teacher, but if it can be pretty simple then I guess that's not too bad
Teachers try not to give you the most random or ambiguous shit ever, or place weird constraints challenge
how would I make that a promise?
yeah but what do I do in this case of an event?
You can create a promise using the global Promise constructor and then place the event inside of it, it gives you two methods to control the promise's state, resolve to resolve the promise, reject to reject the promise; an example of this would be:
let body = '';
<Response>.on('data', (data) => {
body += data.toString();
});
await new Promise((resolve) => {
<Response>.once('end', resolve);
});
That promise will resolve only when all the data has been collected, which is when the end event is emitted, so then you can use the body variable in this case, as it holds all the data
where would I need to put that? it currently results in infinite loading
in a function
you can create a promise using the new Promise() constructor, and a function that returns a promise is the same as an async function
so put it in a function and return the promise
function bla() {
return new Promise(...)
}
then you can do await bla() elsewhere
inside the promise you can process the http response, collect the data and resolve it once the stream ends
x
does anyone use electron?
don’t ask to ask, just ask
im using electron and i keep getting this
Hastebin is a free web-based pastebin service for storing and sharing text and code snippets with anyone. Get started now.
@royal portal
Just so you know, you can’t magically require something from electron and expect it to work
There is no such thing as app in electron
You have to create a variable called app, I presume you’re looking at an online tutorial that omitted that step
there is actually, according to the docs
but using .then there makes no sense
the electron official example shows app.whenReady().then(...)
not app.on("ready")
Why would they export app tho
I remember having to create that a while back when I tried doing electron
Ig I forgor
https://www.electronjs.org/docs/latest#running-examples-with-electron-fiddle
it might have changed 🤷
Welcome to the Electron documentation! If this is your first time developing an Electron app, read through this Getting Started section to get familiar with the basics. Otherwise, feel free to explore our guides and API documentation!
I think I just got confused because I normally don’t see lowercase global vars being exported from libraries and frameworks
const Discord = require("discord.js");
const fs = require('node:fs');
const path = require('node:path');
const { Collection, Events } = require('./config.json');
const client = new Discord.Client({
ws: {
properties: {
$browser: "Discord iOS"
},
},
intents: 32767,
});
client.commands = new Collection();```
I need some help again https://sourceb.in/se0TNMndpy
It means that the messages variable can be undefined, so it's type is not feasible into the wanted number type, if you're sure that it'll be a number then you can just do messages as number
json files cannot contain functions
you're trying to load Collection from a json fille
Also what in the hell are you doing at the first part, looks like something from Yandere Dev
The infamous if else chain
The whole thing can be switched with an assignment lmao
messages = messagefetch
Yeah, although it seems like they're doing it so it becomes undefined if it's not the levels they've specified
It's better for them to just use a switch statement
there's no need for that, you can just use Array.prototype.includes
or an if (... === ... || ... === ... || ...)
The second one is yikes... Isn't a good idea in this case but yeah the array one would work better
but the second one is faster
just throw it in prettier
bam readable code
It's not "faster" at all
how
You're literally doing comparisons, just like the comparisons internally done by %Array.prototype.includes%, not any better
A switch statement should be the same performance in this case
it's a bit slower
also a switch statement is basically this
Well yes because you're working with an object that implements arrays rather than just literals
not blazingly fast 😔
Technically includes is slower even if it’s the same code because you have to advance the stack pointer to a new location 🤓👆
@radiant kraken @wheat mesa actually did a million iteration benchmark and it seems like the %Array.prototype.includes% approach is faster than the if (... === ... || ... === ...) approach
Although my offered approach, the switch statements are the fastest :^)
I feel like v8 purposely makes your code slower just to prove that using the built in api for everything is faster 😉
Oh no our tricks are exposed! 
That's the spirit, it's secret so it would be scary
This is… what the fuck
It’s SUPPOSED to be javascript, but either it’s a joke or that person genuinely has no idea what they’re doing
And judging from the fact it seems like a roblox script, I’m going to assume they are 12 years old and trying to become a script kiddie
That’s python mixed into javascript for literally no reason and no explanation
noblox is a js "self bot" lib (not against their tos)
Highly doubt that an automated bot is not against their tos tbh
Well their API docs are wide open, discussions about self bots n api on their own forums
Automatic group ranking bots etc
this is who he is

If it’s like an actual player bot (looking at the code it doesn’t seem like it) then I would assume it is
But yeah if it’s just for API stuff it’s probably fine
It's getting the group rank of a player
damn you guys are like 3 years behind the curve on memes
I remember laughing at that shit in middle school
he ain't wrong
So more like 5 years now
@wheat mesa from the looks of its uses roblox api to get the rank of the user of a group and sends it back to the bot
I saw that shit like 2-3 years ago
"sends back" is not really a thing but technically yes
u know what i mean

Sends back is correct enough

API request -> response
basically saying
rank = random shit code here
console.log(“shitty api response here”)
GET = READ
POST = WRITE
DELETE = DELETE 😒
PATCH = Frequently used to overwrite/update 
Unnecessary info 😃
Doesn’t mean that “send back” isn’t technically valid
You make a request, the server sends back a response
Which characters besides numbers have the lowest bit value?
I believe so
\0
The null terminator char
Most commonly used in memory to signify the ending of strings
text character*
Then it’s !
abcde etc
Ok hold on
I'm optimizing a script in a language that does not have memory features like JavaScript
Trying to have variable addresses tiny
(lua)
capital A?
A character is going to take up the same amount of memory no matter what
No
Double language autocorrect
Most languages either use 1 byte or 2 bytes for characters
1 byte supports all standard ASCII values, 2 is used for Unicode
Depends on the character I’m sure, v8 might pack the memory if it fits in an ASCII value or something like that
I wouldn't be surprised if its dynamic. I wouldn't be surprised if it's not.
It's actually dynamic, V8 is very aggressive on picking the type appropriate for a JavaScript value
Figured so
Eh what I was planning would do little to no change at all
Maybe a thousandth of a millisecond
Character value does not change the amount of memory it takes up unless it is a non ascii character
In which case it would likely use twice the amount of memory
World of programming 
It’s not too difficult to think about
Characters are represented as numbers
Numbers take bits to represent
The English alphabet fits all within one byte
(Each character, that is)
But since there are more than 256 characters in the world, a 2 byte standard called Unicode exists
Which can store 65536 unique values (technically more because of encoding or something like that, idk)
Tim is gonna come in and blow my mind
the js language spec represents all characters as utf-16, so 2 bytes per char, but js engine implementations do their own thing under the hood to improve efficiency
speaking of which, utf-8 is surprisingly petty inefficient memory-wise
but i think it was done purposefully to be faster to encode/decode or something
there are a lot of wasted bits
also fun fact, these are all the different string types in v8
as voltrex said, very aggressive
And people say java has long names
I’ve seen longer
🤦
that, my friend, is java
No, that's swing
technically part of the jdk!
Swing is a terrible interface api, but it does represent Java
They just added it to the jdk bcuz fuck it
guys
I'm still waiting for a decent gui lib to pop, feels like everyone accepted swing as is
yeah
even intellij didn't want to bother fucking with a new gui lib
literally built their entire ide in swing
I can't quite understand how functions work with Promises in js I just started learning a day ago
A little bit of an advanced topic for a beginner, but basically they're part of the async api built into javascript
Yeah
Oh
Promises are a little bit complex
Damn does noone start with a calculator or hello world nowadays?
I didn't know they were ok thx
I already done that and other things but
bruh what guide should I watch
None
None of them
I think this isn't in proper order yeah
Don't get stuck in tutorial hell
tutorial?
Pick a goal, break it into smaller parts and complete until you finish the whole thing
do you know what are callbacks?
nah, everyone immediately jumps to the most advanced projects as if they think they know more things than they actually do
Dunning Kruger effect moment
promises are like tasks in py afaik
or futures, or whatever its called
i dont really know py
I understood promises
But
if I don't understand how I can make an async function return a promise in js
two ways
Fine, where can I learn them, if it's not too hard for a beginner ig
async function bla() {} // this function automatically returns a promise, because its an async function
function abc() {
return new Promise(...) // this function explicitly returns a promise
}
// both are equal
await bla()
await abc()
bla().then(...).catch(...)
abc().then(...).catch(...)
The bucket fallacy
You find a beautiful, pristine mountain lake with the refreshiest water u ever drank.
The mountain is far away tho, so you need to choose a bucket to gather that water.
Beginners will choose the biggest, badassest looking bucket to carry the most water at once
They struggle to carry the full bucket tho, making them trip and fall down the mountain
Slow and steady, a code a day keeps the insanity away
I already know that
*a line of code a day keeps insanity away
Ah yes
then im pretty insane already
is there like any website that teaches you java
tons
Through application
Lmao buddy, that's a funny beginner mistake
and not just reading/watching
Don't call js java
probably
these days you can find everything
I don't recommend tutorials because you get dependant on them
every indian website
js is one of, if not the, most popular language at the moment, so yeah you will likely find tons of practical js guides/courses
All languages are the same, what you need is to know the logic
i never used any, but i heard people recommending codecademy and udemy
then what do u recommend using
Rust
Pick a goal, like, "I'm gonna make Snaker (the snake game)"
Start breaking it up, "Ok, how will I make the map?"
python and lua are soooo easy like how can a language be more beginner friendly
Well...
Python is a snake in macaroni disguise
I need the basics for that? Like I barely know the most basic things
im pretty sure js is easier than python
indentation moment
It feels easier, but can snowball very easily if u make mistakes frequently
Sorry what 💀
do you know python?
Exactly, snaker is a very simple game
not fluently, but i've seen a lot of things in python that doesnt exist in js
then port it to js
like what
But unless you focus on smaller parts, you get overwhelmed
imo, python is a terribly designed language and should only be used for scripting, not full on projects
I always make a snaker when starting a new lang
That's why I'm switching/shifting to js
wdym? It forces you to write clean code
that's true tho
Because it involves async, collections, oop, arrays, keyboard integration and random generators
unless you code using notepad
So u get a soup of concepts in a single project
js doesnt have decorators for instance
js doesnt care about indentation
also operator overloading
js sync/async concepts are simpler and straight forward, python has more options for different kind of things
python has better threading tho
threading in js is pretty limited
decorators shouldn't be an issue at all
@earnest phoenix decorators in ECMAScript when
Regarding async, yesterday I found a funny dumb thing in delphi
python seems more logical, but if you mess something up at a moment your whole thing is messed up with it
Sleep(millis) freeze the application itself, not the thread
lmao
It's a fuckin global sleep
doesnt python also have a global sleep?
native C moment
Who was the psycho that thought that'd be a good idea
bro why do you even need a promise to tell if there's an error is that like for debugging?
I hate delphi, but it pays me so I have to tolerate it
it's useful if you're writing a single threaded application
It does
depends on the context of the error
there is a very clear separation between sync code and async code, when you start going for async code, some things are indeed handled differently
await new Promise(res => setTimeout(res, Number.MAX_SAFE_INTEGER));
bam global sleep
no
its still an async sleep, so non-blocking :^)
indentation controlling scope is unclear and causes issues that are easily solved with explicitly used curly braces
smh js
Wait
0xFFFFFFFF then
What...what's the size of js "ints"?
8 bytes afaik
well in python, you can write a whole function that can be very long in two lines
everything in js is doubles
they use double
Holy
which is useless
in js you can write a 100k line program in a single line lel
Btw, 0x7FFFFFFF
triple datatype when
and if you do that they'll tell you it doesn't look like js won't they
they will tell you you're either crazy, or your code was minified
I bumped at that thing once, always thought int would go to full Fs
why do you guys always put the '}' in a new line
unsigned >>> signed
since js was made for the web, minified js is pretty normal
but nobody codes in minified js lol
they just minify it after its done
I do
I know someone who does
personal preference
"single char variables to save space"
lmao
How much "js" do you need to know before going into bot developping in js
100% js
Enough to know what ur doing
there are lots of people here who made bots with zero js knowlege lmao
they learned along the way
U don't need to go internal, but u need to be familiar with the lang
or even zero programming knowledge
You mean 100% js basics because 100% js includes literally everything
general programming/logic knowlege is more important that knowing the actual language syntax imo
because syntax is easy to learn if you know the concept of what you want to do
I think that anybody asking for advice on where to start on js needs to learn the syntax though tbf
I mean it makes sense when your language stores variable names like JS or Python
Because I see way too many people in here with "how do I fix this" and it's a basic SyntaxError
excuse me?
or people making command handlers and not understanding how parameters are passed in js
what our teacher tells us every single Tuesday and Thursday
It's true
I found out it was
If you learn programming, you automatically can use any language
global["variableName"] moment
But if u learn a language, u get stuck to it
Languages are just different flavors of 1s and 0s
Learning programming means adapting to the situation
but if you learn both, you become a god
learn programming and learn a single language in depth
Like me
you would just type and find words, click those words and view what they return

rusty
You don't need to memorize the words, that's what google's for
U just need to know what you need to do X
Then u search for it
bruh
It's like I never sent this messgae
software engineers in 2022:
googles how to split a string (because they forgot the syntax)
so true
what is .split in js
in python it's quite easy
a method to split a string
it splits
python being stupid as usual
no, it's the same
python uses that too the
", ".join(arr)
Ig so
wat
.join !== .split
Ik
you cant join a string
I remember one was inverted
you join an array lol
"a.b.c".split(".") = ["a","b","c"].join(".") = "a.b.c"
Did u see how to write a main method already?
if __name__ == "__main__":

bro why
Just why
That's python without noodle disguise
without this most async functions wouldn't work lmao
so in python you do ".".join(["a","b","c"]) ??
Yes
for what
what the fek
Check the docs if u don't believe lul
what about split? is it ".".split("a.b.c") ?
Split is normal
what?
ah
No wtf
Also iirc, no switch-cases
py doesnt have switch?
Lemme check
isnt switch like, as basic as an if?
even C has switch
yet another reason why python is a terribly thought out language
Java mobile app developer 💀
Seems like u hate it
feels like someone had the "wonderful" idea of making a language entirely controlled by whitespace and then just threw in the rest of the features as an afterthought
Turing complete YAML
lol
even the most basic things like lambdas are terrible syntax
lambda x:
you have to literally do that
so disgusting
python is just trying to be unique in areas that it shouldn't
that's my opinion
Lambda as in, equivalent to x -> { }?
at least it isnt js thats being hated on this time :^)
Yeah
Lmao
Yes
Also they made it too beginner friendly
Probably the #1 choice for beginners, which is an awful idea imo
why lol is it always being hated on in this server
Since it's so much different than every other language out there
Snake disguised as a noodle
Explode()
lmao yes
I wish I started with js
now that I see the difference
I just wanna do
this
POV u start with C++
js has historically been hated for being too easy and for having performance issues, so people would often get flamed for taking the easy way out and making a bad/slow solution in js instead of a proper solution in a different lang
but today thats mostly not the case anymore
js engines are stupid fast
js still gets some hate for its dynamic type system
from people who love static types
but now there is also typescript so they dont complain anymore
I mean, js suffers a lot from what java suffers nowadays
That is legacy support
Both langs had a dark past, but can't forego it cuz backwards compat
each language has its own fields of usage
python also has this issue where compatibility completely breaks on every single python version
python also has this issue called speed
C# and C++ are mostly used for scripting in making games
Python sacrificed it's ancestors to have a fluent language
lmao
Except it didn't work as expected so now all ancestors are dead and descendants are weirdos
a lot of langs became popular because something big pushed them
for example C# started being used by game engines
js has always been used in the web
these things keep pushing the lang forward
the use case made the lang, almost literally
actually literally for js
python was very popular for writing shell scripts
php for servers
every single webserver had to have php
python is good for scripting, but people try to make it into an all purpose language that it just isn't
Fun when u learn what php means
poop haha poop
professionally hated programming
I wonder how much knowledge you have once you've learned python, javascript, C, C++, C#, LUA, HTML/CSS and json
i never got into python because i dislike the indentation system
never got into lua either because never needed it
U get more proficient in those langs, but your overall programming knowledge improves globally
I mean not only coding languages but also HTML CSS and JSON
I'd say I've learned javascript, C++, C#, Rust, Java, and typescript to a relatively confident degree
But I'm by no means an expert
Except if u refuse to improve your technics, that is
json is like dead easy lol, its not even a language, just a storage format
Yeah json is just key:value
who said it was a language
well you included it with the others
you just hate brazil
Me when I tell my gf she's number 1 in my priorities array
racist
"included"? when there was HTML, CSS, C++ and python? lol
Lua devs: ❤️
Other devs: 💀
so true
roblox cringe
i meant this
included as in something important worth learning
I love brazil
Arrays start at 1 in lua
But 0 in almost any other language
isn't it worth learning, such an easy thing to learn to help you with js
I'll make it 1 in my language
Except delphi, because delphi starts at 0 or 1 depending on context
to fuck with people
Fuck delphi
and I'll just make 0 return null and not an error
the benefits of making your own language is that you get to do as much trolling as you wish to
yes, json is important, but i meant that json is something you learn in 5 minutes, completely different from html and css which actually take time and skill
make it a constant like -0x8DFE26A
Lua starts with 1?? 💀
I used to make mods for starbound, funny when I figured I had to use <= instead of < for indexed loop iterations
thats pretty much what arrays in C are, pointers to a random memory location :^)
thank you for making me the first element ❤️
everything is binary moment
it's what makes me love C
i love pointer arithmetic so much
I'd like C if it had a little bit more informative errors

that's called Rust
exactly
i dont like pointers, i like bitwise tho
But can u make a rose in other languages? ++i++--<<0
working with bits is so awesome, you can come up with new data formats and compress the shit out of things
In groovy u can
Friendship ended ❌ with C compiler
Me 🤝 rust compiler
gn!
❤️
im gonna make 2 new libs with some code i made for my serializer lul
true
Aaaaaaat laaaaast
My loooove has come along
just learned about bit-masking recently and i was like how did i not use this earlier
utf56 string compression and variable length float to binary
Utf what?
it's like creating your own encrypted messages
utf56
i love making my own binary files
it makes me feel that i've created my own language that everyone sees as gibberish
misleading lol
AH OK, I thought it was 56 bits per char
yup xD
xDD
you could do some serious compression if you created a character format meant exclusively for storing english characters and punctuation and nothing else
thats basically what i do
pov: ASCII
but with a dictionary
Not even ascii
Ain't that windows-something encoding?
less than one byte per char
oh wait
you'd only need what, 4 bits per char? or would it have to be 5
my utf5 is a dictionary-based encoding where the user can set a list of 30 characters they use, and those 30 characters will use 5 bits each
numbers tho
Byte rounding tho
what about huffman coding
huffman and rle are more traditional compression things, they run through your bytes and put repeating patterns into a dictionary
I’ve figured it out
Change human language to be more compressed
The best way of compression for computer scientists, no work needed!
Ain't that jap/chinese?
No lmao
Kanjis takes only 16 bits
They have massive amounts of unique characters though
chinese is the most compressed language
And can represent whole words
morse code
Sometimes even sentences
they have single characters for everything you can think of
ezpz
The sentences are compressed but since they’re character based languages, wouldn’t it end up taking more space in the long run?
the number of characters are much lower
Not characters
Although I suppose 2 bytes for a whole sentence as opposed to 1 byte for each character is a massive trade off
how many kanji chars are there
I’ve always been curious though since I don’t know how character based languages work, but how do you come up with characters for new words?
So all words are half the size of a regular word
Except for A I U E O
Which are single characters
also N
Forgot that one
There's also the extension character which I don't remember the name
Other than that, 1 char per 2 chars
imagine a chinese keyboard
It's a normal keyboard, but they use autocomplete for everything
I had a jap keyboard
i know, but imagine
3 bytes per char essentially
2
106k doesn’t fit in 2 bytes
They take 16 bits per char
that's only like what, 100 characters?
Ah
utf16 encodes those characters as surrogate pairs, meaning two 16bit special chars make up one 4byte character
utf8 can encode them as 3 or 4 bytes individually
The only encoding to defeat mysql
utf8 could be much more efficient
but for some reason they decided to make it that way
it's already good enough imo
lmao
Utf64 tho
utf32 is a massive waste of space for almost all use cases
unless your language uses 4byte characters exclusively
Btw, another fun thing that happened st my job
well true
who cares if your program is huge, at least it's fast™️
We recently updated firebird to 4
Did u know firebird now uses int128 for calculations and timestamps?
Now, did u EVER see a language that fuckin supports int128?
Rust
doesnt C and C++ support it?
C supports everything
if you code enough
But fckin, wasn't int64 enough?
no
nothing is ever enough for you
can't wait for int4294967296
What even is the max value for int128?
U could store the number of atoms in earth
twice that of int64s
2^128 (over 3.40 × 10^38)
actually not just twice
still not enough for my program
my ints kept overflowing
the range is 0 through 340,282,366,920,938,463,463,374,607,431,768,211,455

Quadruple precision floats can also represent any position in the observable universe with at least micrometer precision.
but you still get 0.3000000000001 when you try to add 0.1 with 0.2
yes
why can't there be math-accurate floats
that's even worse

