THE NEW Miscellaneous Talk That Doesn't Deserve A New Thread Thread Thread (Part 2)

Lua is what ROBLOX uses, right?
And what would be coding practice for Unity?
How about Godot?
Source?
Unreal?

Good code practices are usually language-agnostic and are things that you should learn as you just learn to code though I do recommend this book Game Programming Patterns by Robert Nystrom for a good introduction and to get a good idea on what a good design is

also just search good code practices and you can also just look at what other people do and see if you can gleam stuff from there

there are some good code practices that are language-specific (things like pythonic code exist), so make sure to look at specific good design for your language by utilizing specific language features

though I am also not a great person for the topic as I make so much spaghettis in my own code lmao

2 Likes

I am jealous.
I am so bad at coding, i cant even code unless told to!
And yet i want to make a series of FNAF clones starring my plushies…
(they will literally be plushies in that series and not animatronics, and the plot is they are possessed by a demon who is watching to see if any more murders happen or something idk, also the demon in question is literallly a TJOC oc called Ignited Lefty and she is in every one of the FNAF clones i want to make)

We can easily test it.
Before:

ExifTool Version Number         : 12.54
File Name                       : nail.jpg
Directory                       : .
File Size                       : 13 kB
File Modification Date/Time     : 2023:02:25 00:50:22+00:00
File Access Date/Time           : 2023:02:25 00:50:22+00:00
File Inode Change Date/Time     : 2023:02:25 00:50:22+00:00
File Permissions                : -rw-r--r--
File Type                       : JPEG
File Type Extension             : jpg
MIME Type                       : image/jpeg
JFIF Version                    : 1.01
Exif Byte Order                 : Big-endian (Motorola, MM)
Camera Model Name               : NAILSNAPPER2000
X Resolution                    : 1
Y Resolution                    : 1
Resolution Unit                 : None
Y Cb Cr Positioning             : Centered
Comment                         : This is a nail.
Image Width                     : 640
Image Height                    : 640
Encoding Process                : Progressive DCT, Huffman coding
Bits Per Sample                 : 8
Color Components                : 3
Y Cb Cr Sub Sampling            : YCbCr4:2:2 (2 1)
Image Size                      : 640x640
Megapixels                      : 0.410


After:

ExifTool Version Number         : 12.54
File Name                       : e2b47036f582e274d95f60b514a350fc5d307027.jpeg
Directory                       : .
File Size                       : 13 kB
File Modification Date/Time     : 2023:02:25 00:52:23+00:00
File Access Date/Time           : 2023:02:25 00:52:23+00:00
File Inode Change Date/Time     : 2023:02:25 00:52:23+00:00
File Permissions                : -rw-r--r--
File Type                       : JPEG
File Type Extension             : jpg
MIME Type                       : image/jpeg
JFIF Version                    : 1.01
Exif Byte Order                 : Big-endian (Motorola, MM)
Camera Model Name               : NAILSNAPPER2000
X Resolution                    : 1
Y Resolution                    : 1
Resolution Unit                 : None
Y Cb Cr Positioning             : Centered
Comment                         : This is a nail.
Image Width                     : 640
Image Height                    : 640
Encoding Process                : Progressive DCT, Huffman coding
Bits Per Sample                 : 8
Color Components                : 3
Y Cb Cr Sub Sampling            : YCbCr4:2:2 (2 1)
Image Size                      : 640x640
Megapixels                      : 0.410

Seems like I was wrong. Huh.

Nice Nail you got there! :smiley:

There’s two layers to the problem, I’d say. One is the general code architecture where good code practices are related to programming patterns and techniques used to encapsulate logic so that you can focus on one part of the problem at once. For example some terms related to this are OOP, common code patters (proxy, factory, singleton, plain record models), and concepts like SOLID or KISS, data model design. Those are things that apply to most languages and can be used to make sure you aren’t writing super tangled together spaghetti, instead writing really neat small code modules (in OOP that is classes and interfaces) that interact with each other in a well defined way that is documented with comments. If you don’t do that you end up with such a huge mess that trying to reason about the program all at once overloads your brain and you can’t work on the program effectively anymore.

The second layer is writing idiomatic code in the language you picked. Each language has its own set of best practices, like how you should structure, indent, name things in your code. This ensures that when other people read your code they aren’t surprised by your style choices but can actually focus on the meat of the problem: does your code have bugs, algorithmic mistakes, bad big O scaling algorithms that are trivial to rewrite.

I’ll point out that for Thrive, we have a style guide document detailing most of our styling requirements, but also some Godot usage requirements that we’ve found avoid bugs or just result in much more consistent and less confusing code for existing Thrive developers to read:

The rest of the style is enforced with automatic type checks, which are awesome in saving review time as a human doesn’t need to look at your weirdly spaced out code and instead the automatic tool tells you to fix the problems before a human reviewer can then focus on the actual logic of your changes as their eyes won’t get caught on every single style difference.

So it didn’t? Or it could be that only geo location information is removed as I think that’s the only really personally compromising info if someone accidentally uploads an image with that.

What have i done…
I didnt mean for it to derail so much…

Some people enjoy yelling in the void.

I like to see everyone talking about programming, coding, and here I am literally physically unable to program in any program other than Scratch.

…Yes.

When that stupid thing is your first contact with programming, you get used to it and then learning plain text languages ​​becomes extremely difficult to learn.

Wait, but I was told that EXIF data registers the location where the picture was taken!

Too bad there is no such thing for Squirrel. The best I can do is to use the conventions for Lua since it is Squirrel’s closest relative, but I don’t know… I just feel like using my own conventions since Squirrel has more proper OOP than Lua. Metatables are so confusing!

The only good code practice that I use is the never nesting (never nesting more than three times in a row, except if I have no other option).

Once you’ve learned one programming language, you get the basics for most programming languages. Every language (except HTML and CSS) have at least conditional statements (if, if…else, else if, nested), loops (while, for, nested), variables (int, float, string, array or equivalent(s)) and functions. Once you’ve mastered these elements, you’ve mastered the basics of nearly every language. Then again, some languages have their own features. C#, Java, Python and C++ have OOP; Lua has do…until loops and tables instead of arrays, which can have some weird dark magic OOP features; etc.

I know that some people wouldn’t agree, but HTML and CSS aren’t true programming languages like every other. They are only useful for making webpages. HTML is kind of like for structuring the page like a newspaper article. You have the title, then the text. You can also insert images, videos, etc. CSS is more for making the styleart of the page, but I’ve never touched it, so I can’t say anything more about it.

Well a camera without a GPS literally cannot know where it is taking pictures so it obviously can’t add the info. It’s a bit more of a problem nowadays with phones being the primary cameras of people as they do know where they are.

Most of the Lua specific style stuff I’ve seen is actually centered on how to use metatables. So instead if Squirrel has actual classes, using something like C#, JavaScript or C++ style might be much better fit.

That’s because these aren’t programming languages, they are markup languages which are slightly more advanced than something like YAML or JSON. And I see you mentioned that in a later paragraph.

1 Like

Yeah, we only allow high-effort necroposting here. (Joking)

You just did it yourself… I’ll move our posts to the misc thread.

But i was joking! :frowning:

It was still a necropost as a joke does not count as a constructive new post. There’s probably dozens of threads where you could make the same joke…

1 Like

How do I make those thingies with the
[something v]
that if you click it will show some text

When writing a post, click on the cogwheel, and choose “Hide details”:

Summary

details

Example

Like this?

Like[1]


  1. This? ↩︎

Thanks⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀