Here I come with some rant again. I currently dont enjoy my job whatsoever and I'm currently consider quitting and do some selfexploration and projects I feel like doing
I mean why don't you enjoy it? I'm having a hard time believing you just got tired of programming.
I got pretty annoyed having to do certifiable documentation in 5 times redundant word documents that are impossible to keep synchronized with unknown requirements.
But that is something that is fixable.
Especially when you are ready to quit your job you may have a go at saying "Boss, our current processes suck. We could be much more productive if we did it like this and that". If he fires you for that you didn't really lose anything. And chances are things actually improve.
hey guys, i got told that i always should try to use the stack instead of the heap in c++. now im doing a SDL tutorial, and so many things are used with pointers(heap), like SDL_Window*, SDL_Surface*, etc. im just confused now :)
2019 is here! And with the new year, as usual, comes a new iteration of Community Promotion Ads! Let’s refresh these for the coming year :)
What are Community Promotion Ads?
Community Promotion Ads are community-vetted advertisements that will show up on the main site, in the right sidebar. The...
@Chris there is no difference between allocating on the stack/heap
stack memory is the memory that is accessible via the stack register by the cpu
The speed of its allocation/deallocation is fast because it is strictly a last-in/first-out design. It is simply moving and decrement/increment operations.
Heap memory is a bunch of memory that gets allocated when using malloc, calloc, new [...]. it almost always must be manually freed, though you should reallly use a smart pointer class or similar to avoid needing to remember to do so
@Chris Pointers are just a way of getting an indirect reference to a variable: instead of holding the value of a variable, they tell you its address in memory
but isn't it resource wasting to use a pointer? because the pointer variable needs some memory too, right? (but probably that less that it has no negative effect at all?)
@Chris Use simple stack-allocated objects until you have a reason not to. In practice you can almost always get away with stack-allocated objects or making it someone else's problem by using std::vector.
Unless you use terrible libraries such as Qt where writing good code is essentially impossible.
Qt was created before C++ was standardized and had a standard library. It then evolved in a different direction than C++ which is why it is so incompatible.
back when I was uni, they were used a synonyms. Presently, the first web hit says the difference is inversion of control. Mileage vary on some terms, that's mainly why I'm asking for context here.
Ah, I didn't know that it had those side effects. I'm not sure if I'd pick those terms myself, but that level of behavior does warrant some manner of "here be dragons" notice.
Oh, and pointers. You can't simply use std::unique_ptr<Ui::MainWindow> ui; because that would be too easy. Got to keep using Ui::MainWindow *ui; with new and delete like a caveman because otherwise Qt Designer breaks.
Actually I don't know about "upgrade". I think they have always been objects. Even in C.
But C does not have the concept of "object lifetime". You just access stuff and if it exist it's fine. C++ says an object springs to life in the constructor and is destroyed in the destructor, and if you access it outside of those you get screwed.
It depends on what you consider an object. In C++ essentially everything that is made out of bytes is an object, which is probably not the smalltalk definition.
@Kay honestly it's probably because of the pollution levels
if you're outside london you can see a dome of smog hovering over the central parts of the city pretty much
if the trend continues, in a hundred years London will resemble the city in The Fifth Element, including with the lower levels being uninhabitable due to lethal pollution levels
@nwp Ah, ok, things maybe haven't changed super radically then. Admittedly, discussing programming languages at this level can get weird - sometimes object means 'instance of a class', sometimes it's a term that means 'managed collection of 1s & 0s'
I remember a buddy of mine playing a similar survival horror game, but I can't remember the name of it
It was something where different regions of the map get blocked off at different times, and the survivors have to close portals and stuff while dead players revive and become part of the opposing team
Is that the same game or am I getting stuff mixed up?
dead by daylight is fairly new, and you are four survivors summoned to a creepy place where you have to get generators up and running while being pursued by a killer. the whole realm is controlled by The Entity who has put everyone here.
if the survivors get generators running they can escape.
You'll also find it used to refer to generic copying of memory sometimes.
user4704
In particular, the kind of copying that just moves the bytes around without regard to what those bytes are (so no fixups, copy constructor-like stuff, et cetera).