SD13

Last to Post 3: Revenge

Recommended Posts

Game programing is more and more using a bunch of libraries and frameworks which code for you to save time.

That explains well why some games are more and more glitched and devs and unoptimized, and why devs have no idea how to fix it, because they don't know how the library works deeply or they can't modify its content without break the game.

 

If you really want to, I advice you to "re-invent the wheel", which is absolutely necessary to understand how things works. Like using a library only when you could code it yourself.

 

That's how I work personally, when I can. But it's extremely difficult to apply this philosophy, and people generally prefer being able to, over to know how.

Share this post


Link to post
Share on other sites

I think it's good to learn programming WITHOUT the libraries, but then use them later. Know how to not use the libraries if you need to fix something, but make use of them when you can.

Share this post


Link to post
Share on other sites

Programming learning steps :

  • Step one : Oh my Luna it's so complicated, it's like Chines.
  • Step two : Eh, I'm so skilled, I can do what I want, I just need time.
  • Step three : Oh my Luna, I know nothing.
  • Step four : Eh, I'm so skilled, let's see what noob I can help on stack overflow.

Of course each steps go on for years. And you can add 2 steps more for people who never stop to learn emote.RDlaugh.png

Share this post


Link to post
Share on other sites
On 5/28/2018 at 1:15 PM, Fintale said:

Where is everybody? Have somebody eliminated them? Maybe that somebody is the only one who will reply to this post?

I was on vacation.

Share this post


Link to post
Share on other sites
17 hours ago, Bakaarion said:

Programming learning steps :

  • Step one : Oh my Luna it's so complicated, it's like Chines.
  •  Step two : Eh, I'm so skilled, I can do what I want, I just need time.
  • Step three : Oh my Luna, I know nothing.
  • Step four : Eh, I'm so skilled, let's see what noob I can help on stack overflow.

Of course each steps go on for years. And you can add 2 steps more for people who never stop to learn emote.RDlaugh.png

I can't use StackOverflow. I'll ruin my high reputation of 12.

Share this post


Link to post
Share on other sites

Non-indented code is like writing a text with no space between words. It may get people upset because they'll get it like a a lack of respect.

But of course, developpers are also very proud of themselves and they loooove giving lessons to show you how they are skilled, it counts too emote.RDlaugh.png

Share this post


Link to post
Share on other sites

I had non-indented code because I wrote the entire thing in a text editor that DIDN'T SUPPORT TABS! D:<

Share this post


Link to post
Share on other sites

Use spaces. 2, or 4.

I use tabs but my IDE turn it into 4 spaces. And honestly I think that spaces is the best way to indent.

Share this post


Link to post
Share on other sites

And honestly I think that spaces is the best way to indent.

 

Do you REALLY want to start that war? Here? Where we're already fighting?

Share this post


Link to post
Share on other sites

I just replace every time there would be an indent with a blank newline. Keep each "intended" section separate. Plus, you learn to keep track of brackets. Sometimes you gotta count them.

Share this post


Link to post
Share on other sites

The end bracket and then another newline. Ends up something like this:

 

code
code
if(code) {

code
code

}
code

Share this post


Link to post
Share on other sites

My Luna :monocle:

code
code

if(code) {
  code
  code
}

code

Isn't that clearer ?

Okay okay, sometimes mine would be more like

code
code
if(code) code code
code

If the content is not too long.

Share this post


Link to post
Share on other sites

They're optional in almost all languages, but only for the first line >w< You're gonna make a mistake

Share this post


Link to post
Share on other sites

emote.RDproud2.png For the first operation, not line. It ends with ;

... Would say a fkin cringe developer that you wanna struggle through your screen.

Share this post


Link to post
Share on other sites
18 hours ago, Lilly said:

Ughhghghghhghghgh, please use the brackets. We don't need another goto fail

Agreed! I've heard that in C you might get some weird behavior if you think you're calling a function in if clause but it's actually a multi line macro without brackets. When the preprocessor expands the macro only the execution of its first line depends on the if condition. Personally I don't use macros and I always use brackets even if I only have one line of code in that scope.

 

Edit: Oops, what was I thinking. Of course I use some simple macros like:

#define VAR_H 10

#define VAR_L 11

to handle data easier, something like this:

uint16_t var = ((((uint16_t) serial_buf[VAR_H]) << 8) | ( (uint16_t) serial_buf[VAR_L]));

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now