pouët.net

Go to bottom

Good tips n tricks to learn coding ?

category: code [glöplog]
shuffle2: i like how you manage to see the difference between pleks case and the one in the faq.

Code:x=x/++x;

is bad due to many things, the important ones are readability and predictability.

Code:for (iter=container.begin(); iter!=container.end(); ++iter) { ... };

is good since it does not need to make a copy of the current value of iter for executing the loop whereas the postfix notation would. it's a matter of instructing the compiler to generate more efficient code.
rasmus: I can't tell if you're being sarcastic to me or not, so:

The main problem with reading from p and deref then increment in the same call is simply that it is undefined behavior. In fact, I only pointed it out because codepad.org will error out on any warnings.
In both cases (parameter evaluation and the example the faq gives), the same basic issue causes problems.

As for prefixing iterator increments in loops...yes, I do that, but normally only for STL types. Maybe a bad habit, but whatever :p

*still confused since I read your reply as sarcastic*...
added on the 2011-05-15 06:35:30 by shuffle2 shuffle2
lol @ Adok. if you're still referring to articles you wrote when you were 12, there's something seriously wrong.
added on the 2011-05-15 16:28:44 by button button
button: But not regarding me.
added on the 2011-05-15 17:08:05 by Adok Adok
Huge crowd sources for those who loves software renderings :
http://laurent.horus.free.fr/hugecrowd32sources2008.zip

The Cartoon Fish sources, for those who loves asm and dos:
http://laurent.horus.free.fr/The%20Cartoon%20Fish%20(Source%20Code%20by%20LCF%20as%20BARTi%20of%20NoooN).zip
added on the 2011-05-15 19:44:22 by Bartoshe Bartoshe
when i was 12, i had friends, i went outside to play and socialize, and i never wrote a tutorial on that. hmmm... maybe i should have. Adok could have made some very clever conclusions from that.
added on the 2011-05-16 10:59:12 by hcdlt hcdlt
What worked for me after all:

Find a nice demoscener group.
Code.
Have fun coding, by only doing it, when you want to...

fin.
added on the 2011-05-16 11:48:06 by FeN FeN
after Fen's last post, something pop'ed out in my head. something that ive actually wondered and pondered about for very long time. please feel free to comment and come with suggestions and experiences in conjunction with the subject: "How to make a demo in collaboration with members from the same demogroup". I find it very difficult to cooperate on a demo by sending sourcecode over the internet, actually one needs "imho" a good idea and plan if its going to be a successfull one. its been a long time since i did exchange ideas and sourcecode over the web, it seems like i just dont think its fun anymore to do. because i had the experience before to actually be in the same city with a coder, gfx artist or musician for that matter and then work on a demo by exchanging ideas to and forth by have meetings once in a week or even crash at the same house for a weekend and work on demo like that. imho the last one is the best one! because then its much easier to cooperate. doing it on the web works for some, quite good ive heard, but it isnt the same thing. you feel like you are working on a production all alone, and its very difficult if you have an idea in your head to actually transmit it via the internet unless you have a plan and drawing and all that, but that is very difficult because maybe not everyone are agreed on, or have such a passion for an idea. blah, do you get what i say or. does anyone from any demogroups any longer have meetings and work on a demo (whatever kind of demo it may be, a joke-demo, serious demo or just some experimental demo) by have meetings, like fairlight or any other groups? or do you work on a demo only by doing it from your home. or maybe if you work at a games company you have meetings at work and work on the demo from there. i wonder how it is working out nowadays.. ive usually sit alone and code alot, and its pitty that nothing really gets out there, because its easy to say "this isnt good enough, i have to polish it more", when you work alone most of the time. and then its just alot of code and in the end you arent satisified with the outcome and then the code just lies there never being used.
added on the 2011-05-16 15:35:47 by rudi rudi
The best way to code is not to code at all, but learn to do graphics or music and find a demogroup and pester your groupmates to do all your ideas because coders can't think for themselves. Really, we're all idiots. Also naked.
added on the 2011-05-16 15:36:19 by ferris ferris
thanks everyone for your advices, that's awesome :)

i'm gonna read all the lastest ones at leisure tonight :)
added on the 2011-05-16 20:06:20 by bull bull
it might be a better idea just to start coding something very simple instead of reading all the "advice" here. its not a matter of seeking pathways or "advice" its a matter of dedication and reaching a goal.



and then years later finding out that the skill level you idolized as a beginner doesn't make you a master of anything. just have fun with it and think less, do more. think about problemsolving, not about how to become the president of the usa.
added on the 2011-05-16 20:30:22 by superplek superplek
1 Code something
2 Code another thing
3 Goto 1
added on the 2011-05-16 20:37:45 by ham ham
start by coding some simple sine plasmas, fire effect, starfields, copperbars etc.. or you can find some ideas from this list
added on the 2011-05-16 21:08:27 by rudi rudi
hehe before coding those effects i'm learning the bases, coding simple programs, and then coding 2d effects first maybe ? (SDL) before going to 3d ?
added on the 2011-05-17 18:53:12 by bull bull
Do what you want! The is no "best" way.
added on the 2011-05-17 19:07:48 by trc_wm trc_wm
No, you're not allowed to do what you want until you've beaten the atari st sprite record! Until then it's copper bars and sine plasmas.
added on the 2011-05-17 19:11:56 by psonice psonice
lol, and then to "fit" pouet jokes, i'lli have to code a "noise" intro ? right ? :)
added on the 2011-05-17 19:15:26 by bull bull
noise prods are old news.
to be hip you gotta code for amstrad cpc now ;)
added on the 2011-05-17 19:25:36 by wysiwtf wysiwtf
Setting simple goals (if your primary goal is graphics programming that does mean plasmas, bitmap distorts, starfields et cetera) to get a basic hold of the language(s) and platform you're using is effective. As soon as you, inevitably, start to feel the need to expand (e.g building a whole, somewhat more complicated demo) other issues like reusable code, structuring, solid I/O, timing, audio and just the whole thing of forming a bigger usable whole will automatically become your focal point of attention. And that will improve over the years.

Goal-oriented coding and building experience that way. Oh hell, this has been said so many times.
added on the 2011-05-17 20:12:25 by superplek superplek
and of course AssImp
added on the 2011-05-17 20:13:02 by superplek superplek
also, start drinking double - or better triple - the coffee you're drinking now (+1).
added on the 2011-05-18 09:17:00 by hcdlt hcdlt
What wysiwtf said, hahaha. Also coder porn is sooo in right now. Just hard to produce.
added on the 2011-05-18 11:54:16 by ferris ferris
Speaking of goals.. one thing I did a while back was 'lunch break games'. I spent a week doing it, and the goal was to write a complete (usually simple/crappy) game within my lunch break (~45 minutes after eating).

More recently I try to do something with raymarching, or something for my iOS apps during lunch. Today I'll write colour transformations in YUV space (after spending over a week of lunch times doing the same in HSV/HSL and variants, and spending ages optimising, and finding it's still unacceptably slow ;( ).
added on the 2011-05-18 12:04:30 by psonice psonice
...which ended up highly productive :) If anyone is in need of fast colour processing where accuracy isn't critical, look into YUV rather than HSL/V. You can do the RGB->YUV and back transforms nice and fast without any conditionals (or the evil atan I found in one alternative).
added on the 2011-05-18 13:58:11 by psonice psonice
psonice: interesting. i have an realtime hsv tool that is not the fastest in the world. and i think its not 100% correct either. and its written i C#. :p
added on the 2011-05-18 16:10:21 by rudi rudi

login

Go to top