C++ is love
-
It doesn't really do garbage collection as such. As an analogy imagine the garbage man came once a week and burned your house down. It's much more time and space efficient than taking out the trash. You can't actually delete objects in my scheme, only allocate to pools. You can recycle entire pools though, manually, freeing (invalidating) all pointers (or objects) therein. Doing it that way makes it fast fast fast and it works on constrained memory environments. Also it was easy to code.
Real programmers use butterflies
honey the codewitch wrote:
burned your house down. It's much more time and space efficient than taking out the trash.
How the heck is burning down a house every week efficient? :laugh:
Best, Sander Azure DevOps Succinctly (free eBook) Azure Serverless Succinctly (free eBook) Migrating Apps to the Cloud with Azure arrgh.js - Bringing LINQ to JavaScript
-
honey the codewitch wrote:
burned your house down. It's much more time and space efficient than taking out the trash.
How the heck is burning down a house every week efficient? :laugh:
Best, Sander Azure DevOps Succinctly (free eBook) Azure Serverless Succinctly (free eBook) Migrating Apps to the Cloud with Azure arrgh.js - Bringing LINQ to JavaScript
It saves you from having to take the garbage out. ;P
Real programmers use butterflies
-
Sure, C++ is love, but at what price does this "love" cost? your soul, I am sure. We are talking about C++ here. :laugh:
My soul? Oh that old thing? I think I traded it for some concert tickets back in the day.
Real programmers use butterflies
-
It saves you from having to take the garbage out. ;P
Real programmers use butterflies
That's more like deleting your entire application to solve a single bug... :~ Maybe you just don't know how analogies work? :laugh:
Best, Sander Azure DevOps Succinctly (free eBook) Azure Serverless Succinctly (free eBook) Migrating Apps to the Cloud with Azure arrgh.js - Bringing LINQ to JavaScript
-
I needed some garbage-collector like advantages without the overhead so I wrote a 123 line file to give me exactly that. I love C++, and right now I don't know why I ever messed with .NET. :thumbsup::thumbsup::thumbsup: I'm usually not one to holy roll about technology but this language absolutely rules. The only downside with it is it hides nothing (and it doesn't parse properly**), but hiding nothing is just as big an advantage as a liability. Oh how I missed you, C++. ** C++ should really be parsed with a GLR parser so you don't have to worry about incomplete types being a thing.
Real programmers use butterflies
-
It doesn't really do garbage collection as such. As an analogy imagine the garbage man came once a week and burned your house down. It's much more time and space efficient than taking out the trash. You can't actually delete objects in my scheme, only allocate to pools. You can recycle entire pools though, manually, freeing (invalidating) all pointers (or objects) therein. Doing it that way makes it fast fast fast and it works on constrained memory environments. Also it was easy to code.
Real programmers use butterflies
-
I needed some garbage-collector like advantages without the overhead so I wrote a 123 line file to give me exactly that. I love C++, and right now I don't know why I ever messed with .NET. :thumbsup::thumbsup::thumbsup: I'm usually not one to holy roll about technology but this language absolutely rules. The only downside with it is it hides nothing (and it doesn't parse properly**), but hiding nothing is just as big an advantage as a liability. Oh how I missed you, C++. ** C++ should really be parsed with a GLR parser so you don't have to worry about incomplete types being a thing.
Real programmers use butterflies
-
I needed some garbage-collector like advantages without the overhead so I wrote a 123 line file to give me exactly that. I love C++, and right now I don't know why I ever messed with .NET. :thumbsup::thumbsup::thumbsup: I'm usually not one to holy roll about technology but this language absolutely rules. The only downside with it is it hides nothing (and it doesn't parse properly**), but hiding nothing is just as big an advantage as a liability. Oh how I missed you, C++. ** C++ should really be parsed with a GLR parser so you don't have to worry about incomplete types being a thing.
Real programmers use butterflies
When I saw your post, I wondered how badly you were going to get flamed, given the popularity of C# on this site. I never thought this thread would stay so civilized, let alone be fairly positive. :)
Robust Services Core | Software Techniques for Lemmings | Articles
The fox knows many things, but the hedgehog knows one big thing. -
I needed some garbage-collector like advantages without the overhead so I wrote a 123 line file to give me exactly that. I love C++, and right now I don't know why I ever messed with .NET. :thumbsup::thumbsup::thumbsup: I'm usually not one to holy roll about technology but this language absolutely rules. The only downside with it is it hides nothing (and it doesn't parse properly**), but hiding nothing is just as big an advantage as a liability. Oh how I missed you, C++. ** C++ should really be parsed with a GLR parser so you don't have to worry about incomplete types being a thing.
Real programmers use butterflies
I don't hate C++, but I don't share your sentiments. This is almost certainly my own failing, though—it's not a problem with the language so much (which is alright, I guess), I just always end up fighting with the compiler/linker. I've never worked with C++ enough to become much more than minimally competent with it.
-
I gave it away under the MIT license. It was just a little bit of code anyway.
Real programmers use butterflies
-
honey the codewitch wrote:
I gave it away under the MIT license.
GitHub link, or it didn't happen. :laugh:
GitHub - codewitch-honey-crisis/MemoryPool: Small fixed size sequential memory pool allocators for constrained memory environments[^] :laugh:
Real programmers use butterflies
-
I don't hate C++, but I don't share your sentiments. This is almost certainly my own failing, though—it's not a problem with the language so much (which is alright, I guess), I just always end up fighting with the compiler/linker. I've never worked with C++ enough to become much more than minimally competent with it.
There's a certain point - and it can take awhile with C++ - where you reach a level that it is no longer intimidating or as frustrating. True, I did recently spend all morning and ask a stackoverflow question because I missed a "=0" at the end of one of my functions and was responded to with "missing vtable for class" or some such, but that's life, you know? :laugh:
Real programmers use butterflies
-
When I saw your post, I wondered how badly you were going to get flamed, given the popularity of C# on this site. I never thought this thread would stay so civilized, let alone be fairly positive. :)
Robust Services Core | Software Techniques for Lemmings | Articles
The fox knows many things, but the hedgehog knows one big thing.I share your surprise. :)
Real programmers use butterflies
-
That's more like deleting your entire application to solve a single bug... :~ Maybe you just don't know how analogies work? :laugh:
Best, Sander Azure DevOps Succinctly (free eBook) Azure Serverless Succinctly (free eBook) Migrating Apps to the Cloud with Azure arrgh.js - Bringing LINQ to JavaScript
No, that's basically how my code works.
Real programmers use butterflies
-
GitHub - codewitch-honey-crisis/MemoryPool: Small fixed size sequential memory pool allocators for constrained memory environments[^] :laugh:
Real programmers use butterflies
I see you're using both
#pragma once
and#ifdef include
guards. Is that really necessary? GCC supports both, going back to at least version 4.8, so the #pragma doesn't even need to be wrapped in an #ifdef _MSC_VER. But maybe you know something I don't, or maybe you're using some other compiler that doesn't understand the #pragma? Also, picking nits, since I have nothing better to offer, I see that this is a memory pool for contrained memory environments. That must be a constrained, contained memory situation, correct? :)Keep Calm and Carry On
-
I see you're using both
#pragma once
and#ifdef include
guards. Is that really necessary? GCC supports both, going back to at least version 4.8, so the #pragma doesn't even need to be wrapped in an #ifdef _MSC_VER. But maybe you know something I don't, or maybe you're using some other compiler that doesn't understand the #pragma? Also, picking nits, since I have nothing better to offer, I see that this is a memory pool for contrained memory environments. That must be a constrained, contained memory situation, correct? :)Keep Calm and Carry On
I used to put a test of the preprocessor in headers :
#pragma once
#ifdef HEADER_H
#error pragma once was ignored
#else
#define HEADER_H
#endifI have not used very many compilers but I never saw the error message. I use only VS now so I don't do that any more.
"They have a consciousness, they have a life, they have a soul! Damn you! Let the rabbits wear glasses! Save our brothers! Can I get an amen?"
-
I see you're using both
#pragma once
and#ifdef include
guards. Is that really necessary? GCC supports both, going back to at least version 4.8, so the #pragma doesn't even need to be wrapped in an #ifdef _MSC_VER. But maybe you know something I don't, or maybe you're using some other compiler that doesn't understand the #pragma? Also, picking nits, since I have nothing better to offer, I see that this is a memory pool for contrained memory environments. That must be a constrained, contained memory situation, correct? :)Keep Calm and Carry On
GCC throws a "#pragma once in main file" if I don't guard against them appearing. OTOH MSVC seems to like #pragma once to be in there for its source editors.
Real programmers use butterflies
-
I used to put a test of the preprocessor in headers :
#pragma once
#ifdef HEADER_H
#error pragma once was ignored
#else
#define HEADER_H
#endifI have not used very many compilers but I never saw the error message. I use only VS now so I don't do that any more.
"They have a consciousness, they have a life, they have a soul! Damn you! Let the rabbits wear glasses! Save our brothers! Can I get an amen?"
I could do that but I'd rather recover gracefully. What I did compiles with no warnings and that's my major concern.
Real programmers use butterflies
-
raddevus wrote:
How much can you sell it for?
That's capitalism, and htcw does not believe in that. :)
I'm economically agnostic. No systems devised by humans survive contact with them.
Real programmers use butterflies
-
GitHub - codewitch-honey-crisis/MemoryPool: Small fixed size sequential memory pool allocators for constrained memory environments[^] :laugh:
Real programmers use butterflies