pouët.net

Go to bottom

how much of you is there in your code?

category: general [glöplog]
@merou

copyleft is a counter-industry.
demoscene is a para-industry.

try to find counter-para-people.
have fun on pouet.
Whoa.

After reading the topic I hoped I would find people telling how their heart and soul went into their code, how they approach different things, how their personality influenced their style, etc.

And all I see are the usual discussions about brackets and indentation.

Gosh, and I STILL wonder why I go to demo parties and only see ugly low-life nerds there.
added on the 2003-03-07 19:37:28 by kb_ kb_
had the same comment in my head, kb, but i don't think anybody in the scene has a formalized idea of what their process is when dealing with code. or music or graphic for that matter :)
added on the 2003-03-07 20:07:16 by _-_-__ _-_-__
Well, if you want my opinion, the people that speak about brackets, indentation, space/tabs debate are simply novice coders ;)

There are so much complexity behind the simple word "code".

The simple fact of using some particular language to perform some particular task is as much important than the way you use this language.

Even sometimes a good coder will not use code at all. Why using code to rebuild something that already exist. Why using C++ when a simple shell script can do the job ? Why using complex OOP structures where a simple low-tech algorithm will do it ?

The way a coder is working also can be found in the whole structuration of a project. Will he build a single monolith program in one single huge file, or a myriad of small files ? Will he try to make throw out code, or trying to build reusable components that can eventually used to form a library ? Will he use comments ? Will he use comprehensive and consistant in the code, or use whatever he feels sounds good at a particular moment ?

Also some people use comments to comment the lines of code, some other use comments to explain what the general purpose of the function/bloc of code is.

Some people embed links to documentation and external data directly into the code for later reference.

There is much to say about code ;)
added on the 2003-03-07 20:13:37 by Dbug Dbug
Even beyond the choice of a language.. I think there's always a hidden, kind of meta-language that you form for yourself, and that structures the type of constructions / idioms one will use. (when i'm coding in C or java it doesn't always look like C or java.. even if I have to avoid doing that at work, it's highly frowned upon in those areas)
added on the 2003-03-07 21:17:27 by _-_-__ _-_-__
whizzter: then at least that's something we think about likewisely ;) i also got the same d3d-based demostuff going on for years.. expanding, hacking extras into it.. etc. since the source really hasn't got any value, rewriting it for the sake of 'neater code' doesnt really serve a purpose :)
added on the 2003-03-07 21:32:55 by superplek superplek
My favourite syntax for if statements are somewhat like this:

Code:if (something_is_true) then begin do_something; end else begin do_something_else; end;


Seriously, in my line of work I face this problem: I try rather hard to write proper code, using meaningful variable/function/class names, proper OOP with getter/setters and internal laundrying, with readable syntax, completely avoiding 'magic values' and with logical and easily comprehensible execution flow. All the above are rather expected since I come from a Pascal background (naturally...). The problem I have is that noone else but me can understand my code :-) In fact, I am sure noone will use any of my programs just because I have gotten to realise that noone can read them.

Apart from that, I strongly believe that coding is a form of art, that you can admire without having to run it.
added on the 2003-03-07 22:08:32 by moT moT
any half decent editor make layout problems go moot..

more importants are issues of style .. like functional vs oo, data oriented or process oriented, modular vs monolithic, reusable vs optimized. that's where your goals come into play.

one thing i'd really love to play with is 'metaprogramming', and being able to dynamically compile code so as to keep both modularity+reusability of the code (the static part) and optimizations.. Problem is, one may wish to use common lisp for something like that (as it can be very low and very high level) but it comes with hefty non-modular runtime, hence it's completly inappropriate for demos.

other alternative is to build something similar yourself, but this takes time.
added on the 2003-03-07 23:19:49 by _-_-__ _-_-__
There's a bit of ryg in evil's code...
we're getting to it!

Dbug: thanx for your examples about comments, they suit the kind of things i was looking for!sometimes people are too deep into something to be able to see it from outside... i don't tell that as a reproach, being a geek myself... ;)

but yes, i was thinking of program internal structure, evolving along with the experience of the coders, the maturity that comes with more reflexion, conception, of software things... along with their own personnality?

what makes the difference between a "coder" and a coder... when reading the source to understand the global conception of a piece of software?

i was thinking of comparing coding to writing: you can write to do serious articles, boring but informative and understandable... or you can write silly incoherent stuff, just because you find it funny and that it may be nice to read for somebody else... you can challenge yourself to do it using rhymes, or just not care at all, etc...

what do you think of this idea? (i think that on this referential, demomaking would be the equivalent of verse poetry...)

thanx for your help!
added on the 2003-03-08 03:39:47 by merou merou
an example of totally cultural code:
http://runme.org/project/+AcmeManekiNeko/ ;)
added on the 2003-03-08 09:53:56 by _-_-__ _-_-__
steve-dave: see, that's my point. if you'd written it nicely from the beginning you wouldn't think of it as ugly :)
added on the 2003-03-08 10:55:33 by whizzter whizzter
kb:
well my heart and soul? i made voidspace stoned and drunk? and plonch drunk!
on the other hand whilst working on games i've spent weeks cursing infront of the computer because of various bugs. maybe that qualifies? (writing good memory managers without paging available is a bitch)

kb/dbug:
discussions about brackets and tabs are about art. the swedish word for art or science(can't remember what one) is derived from the same greek words. for a reason. i want to see beautiful code.

dbug:
myriad of files or single "monolithic". everyone does everything in myriads of files,libs,dll's,etc,etc.. but you rarely see anything else but monolithic pieces as a result, atleast not in the demoscene(have i mentioned that 20 dll's and one exe is ugly? ;). because you usually compile down everything down to one nice package for distribution

shellscripts? wtf are you some unix admin? ok sure it's nice for some tasks but as i prefer to use windows for my regular work(don't try my temper with cygwin). there's been so many great ideas done but in reality there isn't much that works everywhere except wellwritten C code. (ok java to some degree, the first improvement since the 70s)
i care about AVAILABILITY of my works and forcing people to get an interpreter of language X isn't my idea of it either. compiled languages(and html&java) still runs and will probably always run the consumer side. source/script packages is good when distributing for some lib,unix server or whateverblabla but apart from that no.

knos:
hmm, i'm not exactly sure what you mean but maybe that's why i've started on a java runtime
added on the 2003-03-08 11:20:45 by whizzter whizzter
I'm talking about things like "runtime specialization" ...

let's give an example:

say you have for example a group of modules arranged in a graph
as a model for dsp or graphical processing. When coding such things in C, you have a 1-1 mapping between that graph organization and the actual code. That is to say, one would
code this classically by first sorting the graph then iteratively calling the modules on the data to be processed. In the case of audio effects, this is a block of samples.

Why a block of samples? Because it wouldn't be efficient to
do those n function calls per sample. Sadly, this is imposing a limit on the quality of the output .. you need to
ramp parameters along the block if you want to avoid lofi
noises produced by the jump of parameters. This also sucks if the block is too big if you only process events (note ons, syncs) in between blocks)

If one had at his disposal in the language runtime a compiler, and a flexible way to represent code programmatically (like lisp and its runtime have) one would be able to compile the graph into a more optimized and correct ('per sample') form that would include the processing of those previous n blocks into a single form.

added on the 2003-03-08 12:42:44 by _-_-__ _-_-__
if(chose)
{
(tab) do_bidule();
(tab) bouh();
}
else
{
(tab) do_truc();
(tab) coucou();
}


if(chose)
(tab) do_bidule();
else do_truc();


if(chose) EAT_THIS();

added on the 2003-03-08 17:09:54 by skarab skarab
heh, only me that mix 5 languages in my 3d engine? =)
added on the 2003-03-08 17:46:35 by Hatikvah Hatikvah
whizzter: About script stuff. The only fact of coding something by yourself, when it was possible to use something already existing that do the work (like two lines of script), then it's telling something about the way you think. Perhaps the code is magnificent and optimised and all, but well, it was totaly useless.

A coder I know was very proud of a "data concatenation program" he made. Basicaly you give a list of files and it makes one single one by appending all the files of the list. Quite nice code, just had a limit of maximum 10 files.
Actually it was the exact equivalent of this:

copy /b file1+file2+file3 final

Concerning the monolithic, it's just represent the way you deal with your code. I don't give a fuck about the fact you have a single EXE at the end, we talk about source code here.
added on the 2003-03-09 17:54:25 by Dbug Dbug

login

Go to top