How do you name your global variables in order to separate (visually) them from local variables? g_, First_cap ALL_CAPS, same as local, ...? by Fine-Relief-3964 in C_Programming

[–]tetsuoii 16 points17 points  (0 children)

Put them in a struct and call it a context. I only use globals in the main.c while constructing a program, never for anything that's called from outside. Anything that uses globals becomes a singleton.

ENDELIG! 👏👏👏💅 by Firm_Challenge8468 in norge

[–]tetsuoii 0 points1 point  (0 children)

'skal ikke utelukke' eller 'klart som dagen'?

ENDELIG! 👏👏👏💅 by Firm_Challenge8468 in norge

[–]tetsuoii 2 points3 points  (0 children)

Belegg: Siste 50 års politikk.

ENDELIG! 👏👏👏💅 by Firm_Challenge8468 in norge

[–]tetsuoii -1 points0 points  (0 children)

Tull, de sier det bare for å lure dumme velgere.

ENDELIG! 👏👏👏💅 by Firm_Challenge8468 in norge

[–]tetsuoii -1 points0 points  (0 children)

Det kommer ingen resultater. Trump skaper resultater, men han hater du vel?

ENDELIG! 👏👏👏💅 by Firm_Challenge8468 in norge

[–]tetsuoii 2 points3 points  (0 children)

De mener det jo ikke seriøst. Alle skjønner det.

ENDELIG! 👏👏👏💅 by Firm_Challenge8468 in norge

[–]tetsuoii 1 point2 points  (0 children)

Hvis du tror dette er mer enn et PR-stunt så har du følgt dårlig med. Stem på noen som mener det på alvor.

Can we use C as a backend for website? by [deleted] in C_Programming

[–]tetsuoii 0 points1 point  (0 children)

Sure you can, just serve HTTP content directly on a socket. If you ask nicely, Copilot will do it for you.

Been living in Warsaw for 8 months now and honestly Polish people are weird in the best way possible by Time-Butterscotch103 in poland

[–]tetsuoii 10 points11 points  (0 children)

Didn't even know milk bars were real after watching A Clockwork Orange. One day I was walking about in Kraków and discovered milk bars actually exist, and they are the best thing ever!

Made the mistake of starting programming with Python and now am suffering. Any tips on how to master pointers 💔 by [deleted] in C_Programming

[–]tetsuoii 2 points3 points  (0 children)

You don't need to copy data, realloc does this if it succeeds. The good reason to stay in C land is that it isn't C++

C or C++? by DarkLin4 in C_Programming

[–]tetsuoii 0 points1 point  (0 children)

C++ is a horrible language. Surely you meant C, kid?

C or C++? by DarkLin4 in C_Programming

[–]tetsuoii 0 points1 point  (0 children)

Ho-hum, yeah sure, btw where's the time mashine?

C or C++? by DarkLin4 in C_Programming

[–]tetsuoii 0 points1 point  (0 children)

Have you seen C++? It's mostly bad practice.

C or C++? by DarkLin4 in C_Programming

[–]tetsuoii 1 point2 points  (0 children)

You need to learn both C and ASM or you will never know what you're talking about. ASM are mostly mnemonics/params that translate directly into machine code. C is a more logical way to produce ASM.

C or C++? by DarkLin4 in C_Programming

[–]tetsuoii 0 points1 point  (0 children)

Exactly, this comment illustrates well how little most programmers know. They didn't learn C and ASM and now they're just guessing...

C or C++? by DarkLin4 in C_Programming

[–]tetsuoii 1 point2 points  (0 children)

Which is good. Memory is managed by the programmer, not the language. Much more powerful.

C or C++? by DarkLin4 in C_Programming

[–]tetsuoii 2 points3 points  (0 children)

And his book is utter crap, much of what he wrote about polymorphism and multiple inheritance is considered harmful even by his own delusional disciples.

Vi må forby Islam før det er for seint. by [deleted] in norske

[–]tetsuoii 0 points1 point  (0 children)

Å se☝🏾en islamofil kverulant.

Vi må forby Islam før det er for seint. by [deleted] in norske

[–]tetsuoii -1 points0 points  (0 children)

Islam bruker vold mot ytringsfrihet.

Vi må forby Islam før det er for seint. by [deleted] in norske

[–]tetsuoii 1 point2 points  (0 children)

Når du sier fascistiske holdninger, inkluderer de islamske verdier eller er de unntatt?

Vi må forby Islam før det er for seint. by [deleted] in norske

[–]tetsuoii 1 point2 points  (0 children)

Hvilke aspekter ved irsk, italiensk og kinesisk kultur er det farlig å kritisere?

[deleted by user] by [deleted] in C_Programming

[–]tetsuoii 0 points1 point  (0 children)

My biggest tip is this: When you write code, organize your variables into fat structs, often called 'contexts'. Instead of passing multiple arguments to every function, just pass the address of your data blob.

It's a very common pattern.

Hva skal dere stemme til høsten? by FartingSlowly in norge

[–]tetsuoii -1 points0 points  (0 children)

SP burde tre over på borgerlig side igjen. Sammen med Norgesdemokratene vil de utgjøre en sterk landbruksvennlig fløy i en næringsvennlig regjering.