How do you manage yourself and your time as years pass on?

Started by
48 comments, last by taby 4 weeks, 1 day ago

Aybe One said:
In fact, all one really needs is char and a memory allocator, you can then do your own int, string, map… 😎

Due to me attempting to write my own OS back in the uni - you DO NOT NEED a memory allocator. Is it practical? Hell no! But possible.

Take this with a grain of salt though - it's an extreme.

The original thread deviated a lot, I agree.

My current blog on programming, linux and stuff - http://gameprogrammerdiary.blogspot.com

Advertisement

@Vilem Otte

Tried to think of an algorithm for that while showering but couldn't find one. How is that even possible? 🤣

I find that 12 hours of sleep per night is helpful.

True, I can sleep for 10 hours straight sometimes.

But sleeping a lot isn't without issues: you basically live for work, no leisure… Remote work helps though.

For me, coding and painting are leisure. It heals my soul when I produce something, no matter how little I produce in a day. Pick relatively difficult problems to solve, work at them. Sometimes it takes longer than it did when you were 20-something, and I don’t think that there’s anything that you can do about that. Just keep your brain active as you age — it may ward off dementia in general.

True, I used to do music back then, a totally unrelated activity is such a soothing experience for the brain!
Over the years, time started lacking and I ended up not practicing anymore, hopefully I'll find the time again.

Yes, I tend to think that as well, a brain intensive thing such as coding is likely to help stay mentally in shape.

Also, major improvement for me was to stop watching TV, it felt weird at first but ended up totally worth it.

I haven’t watched TV in decades. Wise choice.

I also should really cut back on Twitter time. There’s just so many cool graphics programmers to follow.

Aressera said:
I'd suggest rewriting your example to explicitly reuse the vector and pass it by reference to the helper function:

I just had opportunity to test the difference on a similar example as given.
Results are as expected this time. Avoiding allocation in the loop is 10 times faster.

if (debug) for (int i=0; i<100; i++)
{
	std::vector<int> polyRing; // 16ms

	for (int ringPoly=0; ringPoly<mm.GetPolyCount(); ringPoly++)
	{
//std::vector<int> polyRing; // 170ms

		mm.FindPolyRing (polyRing, ringPoly);

		if (polyRing.size()>20) SystemTools::Log("(!) NOTE: (print some warning)");

	}
}

Btw, i remember you have wondered about the need for ‘fancy’ half edge mesh data structures.
The FindPolyRing function i have just written finds the one ring neighborhood of a given polygon, including other polygons touching it only at vertex, in clockwise order. Illustrating the result:

I remember i had done this with indexed mesh data structures before, and it was quite complicated.
So i'm actually surprised how simple it is using half edge:

void HEMesh::FindPolyRing (std::vector<int> &polyRing, const int poly) const
{
	polyRing.clear();
	int h = GetPolyEdge(poly);		
	if (h==-1) return;
	h = GetEdgePair(h);
	h = GetEdgeNext(h);
	const int iH = h;
				
	do {
		int hp = GetEdgePair(h);
		int p = GetEdgePoly(hp);
		if (p==poly) 
		{
			h = GetEdgeNext(h);
		}
		else
		{
			if (p!=-1 && (!polyRing.size() || polyRing.back() != p))
				polyRing.push_back(p);
			h = GetEdgeNext(hp);
		}
	} while (h!=iH);
}

Maybe that's a good example to show the benefit.
Personally i did the move to half-edge because implementing various mesh editing functions became way too complicated with indexed meshes. It really helped a lot.

taby said:
I haven’t watched TV in decades. Wise choice.

Same for me. Basically i never had a flat screen to watch TV.

taby said:
For me, coding and painting are leisure. It heals my soul when I produce something, no matter how little I produce in a day. Pick relatively difficult problems to solve, work at them. Sometimes it takes longer than it did when you were 20-something, and I don’t think that there’s anything that you can do about that. Just keep your brain active as you age — it may ward off dementia in general.

I think my coding is much faster now than when i was 20. (approaching 50)

But my guitar playing definitively became slower, although i kept playing regularly.

So maybe it was a wise choice to not become a rock star. :D

JoeJ said:
But my guitar playing definitively became slower, although i kept playing regularly. So maybe it was a wise choice to not become a rock star. :D

Strange thing is that for me, I became faster few years ago, I was around 42.

JoeJ said:
I think my coding is much faster now than when i was 20. (approaching 50)

I think I code faster now too. I do less mistakes either, which for sure helps.

Advertisement