Anonymous
/help@GroupButler_bot
Group Butler
Start me to get the list of commands
⚛ Hz
I think a suitable DSL is also important, no one like using plain c++ to design..
⚛ Hz
The DSL should have data binding and style ability
Anonymous
Guyz
Anonymous
Anybody know how to remove autolike from Facebook
Anonymous
It's not a question to be asked here
Anonymous
But it's very urgent
Anonymous
Pls help me if anybody have idea about it
Anonymous
Anonymous
Hello!
⚛ Hz
For example, Android use XML to layout,and Data binding is a plug-in
Anonymous
Guys, I'm sorry for break the conversation, but... There are a telegram group for game development in C++?
NinuX
Anonymous
Oh, I was looking for that but i did not find nothing, I am a newbie game developer (but I am not a so newbie developer), and I want to find more C++ game developers to make a channel or group to share resources like architectures, tests, documentation and so on.
Anonymous
/help@GroupButler_bot
Group Butler
Start me to get the list of commands
Anonymous
Sorry for that.
yadel
Please what is your editor software in this environment?
Anonymous
yadel
Thanks bro
Anonymous
Anonymous
Guys, if I have a struct like "Position" and it has an int X and an int Y, and I have also another struct like "Acceleration" and it also has an int X and Y, it is ok to create two structs with the same items or just create one struct? There are a way and it is ok to create just one struct with n names?
Mat
Welcome :)
Mat
harry
Mat
It's not the name that identifies a struct
Buck
Hello😁👋👋
Buck
⚛ Hz
The name of struct is only for human...for reading and debugging
Anonymous
Anonymous
Vector2D
https://www.sfml-dev.org/documentation/2.4.2/classsf_1_1Vector2.php
Anonymous
⚛ Hz
So you should use different struct for different purpose
Mat
Anonymous
Anonymous
Something like "Physic_Component" is okey?
⚛ Hz
3 structs:physic_component, position, acceleration
⚛ Hz
And you can use nested struct declaration, if need
⚛ Hz
It will provider more readable and shorter code :)
Anonymous
Oh, sorry bro, i don't understand, do you mean that I should use 3 structs or just 1 struct that has all about these structs (that are the same)?
⚛ Hz
See this pattern
https://stackoverflow.com/questions/1815677/nested-structures
Anonymous
Oh, thank you bro!
⚛ Hz
Tip: you may not need to use the pointer to struct, you can just use nested struct declaration without "*"
Anonymous
Well bro. I catch it! 😁
Mat
Why do you need 3 structs for two variables?
Anonymous
Because each entity in my environment has an acceleration in the X axis and in the Y axis, same for the position, the entity has a position in the X axis and the Y axis.
⚛ Hz
For readable ,Object.position.x and Object.acceleration.x better than Object.x and Object.ax
Mat
So is the same structure
Mat
It's C or C++?
Mat
Structures or objects?
Anonymous
C++
Mat
Anonymous
I am using structures because i do not need that these values to have a behaviour.
Anonymous
Structures.
⚛ Hz
If you want to modify one's struct like add metadata to position..
Mat
So they're just the same :/
Enrico
Hi!
⚛ Hz
They are not for same purpose, although they have same structure...
Anonymous
Mat
I think is a waste, but it's just my opinion :)
⚛ Hz
Yes, it seems like OOP vs FP
Anonymous
But i will use OOP because i am making a entity object, and that object (almost obviously) has a behaviour.
Anonymous
I do not know what to do.
Mat
Objects =/= Structures
Mat
Structures are just a bunch of variables together, an object has a behavior
⚛ Hz
struct is same as class except the default visibility policy in C++..I used it to avoid the annoying public keyword, the public properties are also represented the behavior of a class. position and acceleration may have some same behavior so they can extends the Vector2D
⚛ Hz
So we have 4 classes now
Mat
You can give functions to a struct in C++?
David
⚛ Hz
Yes
Mat
Oh, so my point is invalid
David
But conceptually, I think it's better to use structs for a group of data, and classes for adding some behaviour
⚛ Hz
Yes, for readability
⚛ Hz
Nested class
Mat
https://stackoverflow.com/questions/54585/when-should-you-use-a-class-vs-a-struct-in-c
Mat
So little difference, but not an unimportant one
Mat
I'm learning right now
Mat
So it's only a matter of how you'll access the variables and functions inside