i got no thought on theoretical c few years
but if im back to coding for a while it usually rises some thoughts
some of my recent thought was mess with handles...i know a bit handles
in winapi
(like those terrible gdi objects handles)
i also began to use it recently in my code and
it feels like something is wrong here
this is as a side note maby related to c++
objects trash, becouse much of thsi trash is related to bojests that you keep via handles
some observation, imo mosc convenient code is when you gos just some
pack ot entities and functions, say like you got for example
framebuffer bitmap and functions to draw on it
you dont need any handle, you just get a name
(this name alos may be a pointer but in such case its rather fortunate becouse you can use this name for not only static objects but also those dynamic..still i wouldnt call it even handle
problem is such thet yoy may wish to dynamically dreate (allocate)
things thet didnt existed so
its not a name for examply library provides
so what in that case
imo in sych situation doubtfull are such things as returning handle, and passing handle becouse\in oryginal sceneri you didnt do that
you fr exanple just called functions like draw_lien assuming entity data
of gievem piece of code (say framep and frame_w frame h, regardles is
frame is statical adress and frame_w is immediate value or if frame is pointer to heap,ad frame_w is variable)
so what now? there is a need of something analogical (in a goal to
obtain gol but avoid handles)..but how to do it?
possibly all this assumed entities may be
treated as assumed variables by some module,
aldding module name is no big cost as inner names in code stays the same..then yu need a way to declate other entities to proide names and
not provide handles
something like
frameBuffer a,b,c;
(its something like 'include' diretive but also with name specification)
all inner functions ale extactly the same
like frmae, frame_w, frame_h and functions SetPixel(0 etc but on te user side you must specify names unless yu maybe specify than in some context
you use only one and thsi is default
(it makes distinguis on material creation and
unameterial acces - it also shows that it is
probably natural to think on it in a dose of abstract way it is
regardles of omplementation)
its kinda of what i was saing already few times that entity/modular
language is good and obejcts are trash, but it also shows imo tahat generally handles are kinda inferior probably (and why)
| Sysop: | Amessyroom |
|---|---|
| Location: | Fayetteville, NC |
| Users: | 65 |
| Nodes: | 6 (0 / 6) |
| Uptime: | 06:15:53 |
| Calls: | 862 |
| Files: | 1,311 |
| D/L today: |
921 files (14,318M bytes) |
| Messages: | 264,699 |