Emuforums.com

Go Back   Emuforums.com > General Discussion > Web development / Programming
Home Register Downloads FAQ Members List Calendar Arcade Mark Forums Read

WON'T YOU JOIN US?
You are not a registered member and
are viewing this site as a guest.
Registration is simple and FREE.
Join this CrowdGather community today.
Registration offers the following perks:

» Less advertising throughout
» Post and participate in discussions
» Network with other forum members
» Free private messaging

join

Reply
 
Thread Tools Display Modes
Old December 3rd, 2009, 19:05   #61
@ruantec
Crazy GFX coder
 
@ruantec's Avatar
 
Join Date: Nov 2002
Location: Dominican Republic/Austria
Posts: 8,099
as i previously said i think its every coder choice to do what he/she wants however smaller/compacted code doesnīt mean is less bloated nor advanced etc.. it just mean each coder add his/her special touch to it. also it doesnīt change the behaviour of the code execution either. using slightly more lines have his advantages specially when you want to debug your code in a better way... sadly debugging is necessary as every single coder in this world canīt write a perfect code and therefore debugging is more than necessary in many, many cases. eitherway is your choice and if you like it i donīt see any problems with that

anyways every coder has different tastes and style so i think that even using the same style coders still have differences.. for example i would use "Switch" here instead:

Code:
void mVU_ESADD(microVU* mVU, int recPass) 
{
	if (recPass == 0) 
        { 
                mVUanalyzeEFU2(mVU, _Fs_, 11); 
        }
	if (recPass == 1) 
        { 
		int Fs = mVU->regAlloc->allocReg(_Fs_, 0, _X_Y_Z_W);
		SSE2_PSHUFD_XMM_to_XMM(xmmPQ, xmmPQ, mVUinfo.writeP ? 0x27 : 0xC6); // Flip xmmPQ to get Valid P instance
		mVU_sumXYZ(mVU, xmmPQ, Fs);
		SSE2_PSHUFD_XMM_to_XMM(xmmPQ, xmmPQ, mVUinfo.writeP ? 0x27 : 0xC6); // Flip back
		mVU->regAlloc->clearNeeded(Fs);
	}
	if (recPass == 2) 
        { 
               mVUlog("ESADD P"); 
        }
}
actually am unsure if the word "BLOATED" is correctly undertanded when it comes to coding.
__________________


Current development tools:

Visual C++.net, Visual C#.net
Visual VB.net, Visual Webdeveloper.net
Bloodshed Dev C++, Borland C++
Visual Basic 6

Last edited by @ruantec; December 3rd, 2009 at 19:14..
@ruantec is offline   Reply With Quote

Advertisement [Remove Advertisement]
Old December 3rd, 2009, 19:10   #62
Fadingz
代言人
 
Fadingz's Avatar
 
Join Date: Dec 2006
Location: 應許之地
Posts: 7,056
I prefer switch when possible too
Easy to read, but switch has potency for logical errors if cases are not well defined.
Keys are good examples for switch, in my opinion
Code:
/* handle  special keys handling. (arrows, etc) */
void arrow_keys ( int a_keys, int x, int y )  
{
    switch ( a_keys ) {
    case GLUT_KEY_UP:     /* When Up Arrow Is Pressed...*/
        screen.Rotate( Vec3f(ROTATE_VERTICAL,0,0) );
        break;
    case GLUT_KEY_DOWN:   /* When Down Arrow Is Pressed...*/
        screen.Rotate( Vec3f(-ROTATE_VERTICAL,0,0) );
        break;
    case GLUT_KEY_LEFT:   /* When Left Arrow Is Pressed...*/
        screen.Rotate( Vec3f(0,-ROTATE_HORIZONTAL,0) );
        break;
    case GLUT_KEY_RIGHT:  /* When Right Arrow Is Pressed...*/
        screen.Rotate( Vec3f(0,ROTATE_HORIZONTAL,0) );
        break;
    default:
        break;
    }
    redisplay();
}
__________________
Fadingz is offline   Reply With Quote
Old December 3rd, 2009, 19:16   #63
@ruantec
Crazy GFX coder
 
@ruantec's Avatar
 
Join Date: Nov 2002
Location: Dominican Republic/Austria
Posts: 8,099
well a good coder should know at least that "break;" is needed on every case otherwise un-wanted code is going to be executed
__________________


Current development tools:

Visual C++.net, Visual C#.net
Visual VB.net, Visual Webdeveloper.net
Bloodshed Dev C++, Borland C++
Visual Basic 6
@ruantec is offline   Reply With Quote
Old December 3rd, 2009, 19:39   #64
serge2k
Registered User
 
Join Date: Sep 2006
Location: surrey
Posts: 111
Pairing heaps.
Code:
import java.util.LinkedList;
public class PairingHeap<E extends Comparable<E>>
{
	private E min;
	private LinkedList<PairingHeap<E>> heaps;
	
	public PairingHeap(E value)
	{
		min = value;
	}
	
	public PairingHeap<E> insert(E value)
	{
		PairingHeap<E> h = new PairingHeap<E>(value);
		return merge(h);
	}
	
	public PairingHeap<E> merge(PairingHeap<E> h)
	{
		if(h.min.compareTo(min) < 0) 
			return h.addHeap(this);
		else return this.addHeap(h);
	}
	
	private PairingHeap<E> addHeap(PairingHeap<E> h)
	{
		if(heaps == null) heaps = new LinkedList<PairingHeap<E>>();
		heaps.add(h);
		return this;
	}
	
	public E findMin()
	{
		return min;
	}
	
	public void deleteMin()
	{
		if(heaps == null)
			min = null;
		else
		{
			LinkedList<PairingHeap<E>> t = new LinkedList<PairingHeap<E>>();
			PairingHeap<E> t2;
			PairingHeap<E> t3;		
			for(int i = 0; i < heaps.size()-1; i+=2)
			{
				t2 = heaps.get(i);
				t3 = heaps.get(i+1);
				t2 = t2.merge(t3);
				t.add(t2);
			}
			heaps = t;
		}
		int i = heaps.size()-1;
		int i2 = 0;
		E minimum = heaps.get(i2).min;
		int minLocation = 0;
		while(i > i2)
		{
			if(heaps.get(i--).min.compareTo(minimum) < 0)
			{
				minimum = heaps.get(i).min;
				minLocation = i;
			}
			if(heaps.get(i2++).min.compareTo(minimum) < 0)
			{
				minimum = heaps.get(i2).min;
				minLocation = i2;
			}
		}
		min = minimum;
		PairingHeap<E> minHeap = heaps.get(minLocation);
		heaps.remove(minLocation);
		heaps.addAll(minHeap.heaps);
	}
	
	public String toString()
	{
		StringBuilder sb = new StringBuilder();
		sb.append("min: ");
		sb.append(min.toString());
		if(heaps == null)
			sb.append("\nHeaps: null");
		else
		{
			for(int i = 0; i < heaps.size(); i++)
			{
				sb.append("\nHeap:\n{\n");
				sb.append(heaps.get(i).toString());
				sb.append("\n}\n");
			}
		}
		return sb.toString();
	}
}
serge2k is offline   Reply With Quote
Old December 3rd, 2009, 20:31   #65
cottonvibes
You're already dead...
 
cottonvibes's Avatar
 
Join Date: Sep 2007
Location: Planet Vegeta
Posts: 5,385
switches are useful when you have alot of well defined cases.

when you have a limited number of cases, they usually take up more lines of code.
switches also look very ugly if you need to declare variables within the case statements. you need to add brackets to the case to give the variables correct scope, so you end up with something that looks very unsymmetrical.

my use of macros in the code i posted earlier gave each emulated opcode a definite structure, promoting consistency.

Code:
mVUop(someOpcode) {
    pass1 {}
    pass2 {}
    pass3 {}
}
anyways i love the power to do this type of stuff in c++.
__________________

"It was, of course, a lie what you read about my religious convictions, a lie which is being systematically repeated. I do not believe in a personal God and I have never denied this but have expressed it clearly. If something is in me which can be called religious then it is the unbounded admiration for the structure of the world so far as our science can reveal it." - Albert Einstein
check out my blog
cottonvibes is offline   Reply With Quote
Old December 3rd, 2009, 20:38   #66
@ruantec
Crazy GFX coder
 
@ruantec's Avatar
 
Join Date: Nov 2002
Location: Dominican Republic/Austria
Posts: 8,099
Quote:
Originally Posted by cottonvibes View Post
anyways i love the power to do this type of stuff in c++.
That is actually the most important thing

....... however other coders may not share your points of view in this case as maybe some of us doesnīt consider such practice as more productive nor make your code more advanced... but hey we should be happy not everyone thinks the same
__________________


Current development tools:

Visual C++.net, Visual C#.net
Visual VB.net, Visual Webdeveloper.net
Bloodshed Dev C++, Borland C++
Visual Basic 6
@ruantec is offline   Reply With Quote
Old December 3rd, 2009, 20:43   #67
Demigod
これはバタスです
 
Demigod's Avatar
 
Join Date: Jun 2001
Location: Toronto, Ontario, Canada
Posts: 6,331
Quote:
Originally Posted by cottonvibes View Post
I'm aware that when i get into the professional industry i will have to code the way i don't like.
its just like when i do my HW for programming classes, i have to code it in a very noob-way to be sure that the professor understands exactly what i'm doing.
Yup, this was one of the first things I had to get used to when I got a job as a programmer. I like to use highly compact code but I had to abandon the practice and conform to company standards. The code is accessed by a lot of people and simpler code is easier on everyone (plus it saves the company money, since others developers don't have to spend hours trying to understand how the code works). Meh, eventually you get used to it.
__________________
CPU: Intel Core 2 Quad Q9450 Mobo: Intel DX48BT2 Memory: 4096 MB PC10600 DDR3 Videocard: PNY Geforce 9800 GX2 Soundcard: On-board SigmaTel High Definition Audio Hard drive: 120 GB OCZ RevoDrive PCI-E SSD & 1 TB Hitachi Optical drive: LG GGW-H20L (2x BD-R DL) PSU: Nexus 1000 Watt PSU OS: Microsoft Windows 7 Ultimate (64-bit)

Proud millionaire folder of the NGEmu folding team
Demigod is offline   Reply With Quote
Old December 3rd, 2009, 20:47   #68
cottonvibes
You're already dead...
 
cottonvibes's Avatar
 
Join Date: Sep 2007
Location: Planet Vegeta
Posts: 5,385
Quote:
Originally Posted by Fadingz View Post
don't you think C++ looks much cleaner?
Code:
/* Class Ray */ /* Declaration */
/* Written by Fadingz 2009 */

#pragma once

#include <pic.h>

#include "rt_scene.h"
#include "rt_group.h"
#include "rt_light.h"
#include "rt_material.h"

#define REFLECTION_LIMIT 4
#define REFRACTION_LIMIT 4

class Ray
{
public:
    /* Init-Constructor */
    Ray( rt_Scene *scene, const DivisionTree& tree, const Vector& ray, const Vec3f& bgColor, const int& shadowLightNum, int reflectionCounter = 0, int refractionCounter = 0 );

    Vec3f Color;

private:
    /* The global illimunation model */
    Vec3f ModelIllum ( const Vec3f& intersect, const int& numLight ) const;
    /* The raytrace function */
    Vec3f Trace ( const Vec3f& baseColor, const Vector& ray );
    /* Checks the color intensity bounds: {0} <= {[I]} <= {1} */
    void ColorCheck ( Vec3f& color ) const;
    /* Calculates the refration vector */
    Vector GetRefractionVector ( const Vec3f& vV, const Vec3f& n, const float& n1, const float& n2, const Vec3f& location = ZERO );
    /* Calculates the reflection vector */
    Vector GetReflectionVector ( const Vec3f& vV, const Vec3f& vN, const Vec3f& location = ZERO ) const;

    DivisionTree Tree;
    rt_Group *Group;
    rt_Scene *Scene;
    rt_Light* g_pLight;
    size_t NumObjects, NumLights;
    int ReflectionCounter, RefractionCounter, ShadowLightNum;
    Vec3f L, V, N, Kd, Ks, Kr, Kt, Ia, Ic, BgColor;
    Vector R;
    float R2, Alpha, A1, A2, A3, Att;
};
yeh c++ gives alot of freedom in formatting, so you can make stuff look alot cleaner.
some would argue pointers make stuff uglier though.
no garbage collecter is arguably uglier too (but used wisely, you can make stuff look cleaner when you need to explicitly delete class objects; too lazy to give an example though)


what i noticed about your code is that you use /* */, for your single line comments.
i think thats too hard to type for every comment, so i always use // for my single line ones.
only time i really use /**/ is when i'm commenting out big chunks of code to test something.
or if i need to comment something in a multi-line macro or within a line statement.
__________________

"It was, of course, a lie what you read about my religious convictions, a lie which is being systematically repeated. I do not believe in a personal God and I have never denied this but have expressed it clearly. If something is in me which can be called religious then it is the unbounded admiration for the structure of the world so far as our science can reveal it." - Albert Einstein
check out my blog
cottonvibes is offline   Reply With Quote
Old December 3rd, 2009, 21:11   #69
fried_egg
Registered User
 
fried_egg's Avatar
 
Join Date: Apr 2007
Location: indiana
Posts: 694
Quote:
Originally Posted by cottonvibes View Post
switches are useful when you have alot of well defined cases.

when you have a limited number of cases, they usually take up more lines of code.
switches also look very ugly if you need to declare variables within the case statements. you need to add brackets to the case to give the variables correct scope, so you end up with something that looks very unsymmetrical.

my use of macros in the code i posted earlier gave each emulated opcode a definite structure, promoting consistency.

Code:
mVUop(someOpcode) {
    pass1 {}
    pass2 {}
    pass3 {}
}
anyways i love the power to do this type of stuff in c++.
i agree that this enhances readability and is an example of a good use of the define directive.
fried_egg is offline   Reply With Quote
Old December 3rd, 2009, 21:29   #70
@ruantec
Crazy GFX coder
 
@ruantec's Avatar
 
Join Date: Nov 2002
Location: Dominican Republic/Austria
Posts: 8,099
Quote:
Originally Posted by cottonvibes View Post
i its just like when i do my HW for programming classes, i have to code it in a very noob-way to be sure that the professor understands exactly what i'm doing.
i pretty much doubt your teacher is a noob judging by his position so the text above gives the feeling you think youīre superior than him... mmmm thatīs questionable.
__________________


Current development tools:

Visual C++.net, Visual C#.net
Visual VB.net, Visual Webdeveloper.net
Bloodshed Dev C++, Borland C++
Visual Basic 6

Last edited by @ruantec; December 3rd, 2009 at 21:46..
@ruantec is offline   Reply With Quote
Old December 3rd, 2009, 21:43   #71
Proto
Knowledge is the solution
 
Proto's Avatar
 
Join Date: Dec 2002
Location: Pittsburgh, US. Previously in Mexico City
Posts: 7,160
You also have to consider that your teacher, or the poor TA that will have to check your HW, also has to check the HW of God knows how many students out there. If they didn't ask for a standarized and easy to read way of understanding your code, and everyone programmed in whatever hectic way they preferred, they would invest much more time than what they are investing already.
__________________
Proto is offline   Reply With Quote
Old December 3rd, 2009, 23:00   #72
fried_egg
Registered User
 
fried_egg's Avatar
 
Join Date: Apr 2007
Location: indiana
Posts: 694
Quote:
Originally Posted by @ruantec View Post
actually am unsure if the word "BLOATED" is correctly understood when it comes to coding.
yeah. bloated code is different from code that is overly verbose. if you use more lines to express the exact equivalent statements, that is not code bloat. and sorry for correcting your grammar @ruantec. its not an attack on you, but red squiggly lines really bother me.
fried_egg is offline   Reply With Quote
Old December 4th, 2009, 00:26   #73
cottonvibes
You're already dead...
 
cottonvibes's Avatar
 
Join Date: Sep 2007
Location: Planet Vegeta
Posts: 5,385
Quote:
Originally Posted by @ruantec View Post
i pretty much doubt your teacher is a noob judging by his position so the text above gives the feeling you think youīre superior than him... mmmm thatīs questionable.
apparently you want to start another argument with me; or else you wouldn't write that.

Quote:
Originally Posted by Proto View Post
You also have to consider that your teacher, or the poor TA that will have to check your HW, also has to check the HW of God knows how many students out there. If they didn't ask for a standarized and easy to read way of understanding your code, and everyone programmed in whatever hectic way they preferred, they would invest much more time than what they are investing already.
yeh, i do consider that; that's why i have to write it as noobly as possible.
my teacher even said to not make stuff harder on him.

if i was a professor and had to grade a lot of papers, i probably wouldn't want to be bothered with too complex code.

Quote:
Originally Posted by fried_egg View Post
yeah. bloated code is different from code that is overly verbose. if you use more lines to express the exact equivalent statements, that is not code bloat. and sorry for correcting your grammar @ruantec. its not an attack on you, but red squiggly lines really bother me.
i consider being overly verbose a form of bloat.

i'm not talking about just the formatting stuff; but rather using a lot more code statements to accomplish the same task is just sloppy.

there's plenty of parts of pcsx2 that are just a mess of slop, because some coders just didn't know how to code concise, structured, and to-the-point.
its usually a sign that they had no plan, or they didn't know what they were doing.

according to wikipedia:
Quote:
Code bloat is the production of code that is perceived as unnecessarily long, slow, or otherwise wasteful of resources.
i agree with that definition.
being overly verbose falls into 'unnecessarily long'.

i do not have objections to longer smarter algorithms however. exactly what i consider bloat depends on the situation.
__________________

"It was, of course, a lie what you read about my religious convictions, a lie which is being systematically repeated. I do not believe in a personal God and I have never denied this but have expressed it clearly. If something is in me which can be called religious then it is the unbounded admiration for the structure of the world so far as our science can reveal it." - Albert Einstein
check out my blog
cottonvibes is offline   Reply With Quote
Old December 4th, 2009, 00:58   #74
Fadingz
代言人
 
Fadingz's Avatar
 
Join Date: Dec 2006
Location: 應許之地
Posts: 7,056
Quote:
Originally Posted by cottonvibes View Post
yeh c++ gives alot of freedom in formatting, so you can make stuff look alot cleaner.
some would argue pointers make stuff uglier though.
no garbage collecter is arguably uglier too (but used wisely, you can make stuff look cleaner when you need to explicitly delete class objects; too lazy to give an example though)


what i noticed about your code is that you use /* */, for your single line comments.
i think thats too hard to type for every comment, so i always use // for my single line ones.
only time i really use /**/ is when i'm commenting out big chunks of code to test something.
or if i need to comment something in a multi-line macro or within a line statement.
I prefer to do stuff myself.
Allocating memory myself helps me to develop good habit of keeping things clean regardless of the existence of the garbage collector.
Garbage collector should be there as an aid and not something to rely on.

For commenting, I just type what ever I want, then ctrl-k, ctrl-c to comment my entire thing and ctrl-k, ctrl-u to uncomment the entire thing.
__________________
Fadingz is offline   Reply With Quote
Old December 4th, 2009, 02:25   #75
cottonvibes
You're already dead...
 
cottonvibes's Avatar
 
Join Date: Sep 2007
Location: Planet Vegeta
Posts: 5,385
Quote:
Originally Posted by Fadingz View Post
I prefer to do stuff myself.
Allocating memory myself helps me to develop good habit of keeping things clean regardless of the existence of the garbage collector.
Garbage collector should be there as an aid and not something to rely on.
yeah.
not having a GC also helps you understand how memory allocation works.

when you code in languages with a CG, and never have experienced a language with coder-controlled memory management; you may not get the full idea of how your memory is being used.

stuff like that is why i've expressed that any good coder eventually needs to learn mid-level languages like c/c++; or else they will not fully understand certain concepts (or it will be very difficult to do so).


it reminds me of something i read years ago how some programmer (don't remember who, but i think he was some well-known programmer/professor), was arguing that languages like visual basic are spoiling and teaching bad programming habits to new programmers.
technically it has some truth; but i think when you start out, its best to start with something easy.
then you gradually move on to more difficult languages as you learn more.
__________________

"It was, of course, a lie what you read about my religious convictions, a lie which is being systematically repeated. I do not believe in a personal God and I have never denied this but have expressed it clearly. If something is in me which can be called religious then it is the unbounded admiration for the structure of the world so far as our science can reveal it." - Albert Einstein
check out my blog
cottonvibes is offline   Reply With Quote
Old December 4th, 2009, 02:30   #76
fried_egg
Registered User
 
fried_egg's Avatar
 
Join Date: Apr 2007
Location: indiana
Posts: 694
Quote:
Originally Posted by cottonvibes View Post
i consider being overly verbose a form of bloat.

i'm not talking about just the formatting stuff; but rather using a lot more code statements to accomplish the same task is just sloppy.

there's plenty of parts of pcsx2 that are just a mess of slop, because some coders just didn't know how to code concise, structured, and to-the-point.
its usually a sign that they had no plan, or they didn't know what they were doing.

according to wikipedia:


i agree with that definition.
being overly verbose falls into 'unnecessarily long'.

i do not have objections to longer smarter algorithms however. exactly what i consider bloat depends on the situation.
meh, its not overly verbose to do one clear thing per statement. it enhances readability and maintainability. writing code that is unreadable doesn't make you seem smarter. well, it actually probably does to some people, but not the people who count.
fried_egg is offline   Reply With Quote
Old December 4th, 2009, 02:54   #77
Fadingz
代言人
 
Fadingz's Avatar
 
Join Date: Dec 2006
Location: 應許之地
Posts: 7,056
format plays a huge role in readability as well
Code:
/* Checks the color intensity bounds: {0} <= {[i]} <= {1} */
void Ray::ColorCheck ( Vec3f& color ) const
{
    if ( color.r() > 1) color.Set( 1         ,color.g() ,color.b() );
    if ( color.g() > 1) color.Set( color.r() ,1         ,color.b() );
    if ( color.b() > 1) color.Set( color.r() ,color.g() ,1         );
    if ( color.r() < 0) color.Set( 0         ,color.g() ,color.b() );
    if ( color.g() < 0) color.Set( color.r() ,0         ,color.b() );
    if ( color.b() < 0) color.Set( color.r() ,color.g() ,0         );
}
I usually spend a lot of time to make my code 'look nice' xD
I know a for loop would work here too now, but apparently I didn't at the time @@"

I'm pulling things out from the raytracer I coded last year btw.
__________________
Fadingz is offline   Reply With Quote
Old December 4th, 2009, 02:58   #78
cottonvibes
You're already dead...
 
cottonvibes's Avatar
 
Join Date: Sep 2007
Location: Planet Vegeta
Posts: 5,385
Quote:
Originally Posted by fried_egg View Post
meh, its not overly verbose to do one clear thing per statement. it enhances readability and maintainability. writing code that is unreadable doesn't make you seem smarter. well, it actually probably does to some people, but not the people who count.
i specifically said i wasn't just talking about formatting though.

verbose means "containing more words than necessary".
being overly verbose is essentially 1 of the criteria (arguably the most definitive) for what 'code bloat' is.

what enhances readability is subjective to the reader.
for me its seeing more on the screen at once, for others its apparently seeing less since they like to spread out their code like writing a double spaced college essay.

and no-one said anything about which code makes you look smarter; that's a totally irrelevant comment.
__________________

"It was, of course, a lie what you read about my religious convictions, a lie which is being systematically repeated. I do not believe in a personal God and I have never denied this but have expressed it clearly. If something is in me which can be called religious then it is the unbounded admiration for the structure of the world so far as our science can reveal it." - Albert Einstein
check out my blog
cottonvibes is offline   Reply With Quote
Old December 4th, 2009, 03:00   #79
Fadingz
代言人
 
Fadingz's Avatar
 
Join Date: Dec 2006
Location: 應許之地
Posts: 7,056
I do a lot of chunking, I group codes together using space to improve readability.

Code:
aaaaaaaaaa
aaaaaaaaaa
aaaaaa
a a aaaa

bbbbbbbb
bbb
bb

c
cc cc
cc cccc
like that
__________________
Fadingz is offline   Reply With Quote
Old December 4th, 2009, 03:05   #80
cottonvibes
You're already dead...
 
cottonvibes's Avatar
 
Join Date: Sep 2007
Location: Planet Vegeta
Posts: 5,385
Quote:
Originally Posted by Fadingz View Post
format plays a huge role in readability as well
Code:
/* Checks the color intensity bounds: {0} <= {[i]} <= {1} */
void Ray::ColorCheck ( Vec3f& color ) const
{
    if ( color.r() > 1) color.Set( 1         ,color.g() ,color.b() );
    if ( color.g() > 1) color.Set( color.r() ,1         ,color.b() );
    if ( color.b() > 1) color.Set( color.r() ,color.g() ,1         );
    if ( color.r() < 0) color.Set( 0         ,color.g() ,color.b() );
    if ( color.g() < 0) color.Set( color.r() ,0         ,color.b() );
    if ( color.b() < 0) color.Set( color.r() ,color.g() ,0         );
}
I usually spend a lot of time to make my code 'look nice' xD
I know a for loop would work here too now, but apparently I didn't at the time @@"

I'm pulling things out from the raytracer I coded last year btw.
ah i see we code similarly then.
i also spend time arranging code like that.

when i code i kindoff feel like i'm playing tetris; aligning all the statements into blocks that look good.
i hate it when i can't come-up with something that looks well-aligned (due to the odd code statements) xD.

Quote:
Originally Posted by Fadingz View Post
I do a lot of chunking, I group codes together using space to improve readability.

Code:
aaaaaaaaaa
aaaaaaaaaa
aaaaaa
a a aaaa

bbbbbbbb
bbb
bb

c
cc cc
cc cccc
like that
yeh i do that as well xD
__________________

"It was, of course, a lie what you read about my religious convictions, a lie which is being systematically repeated. I do not believe in a personal God and I have never denied this but have expressed it clearly. If something is in me which can be called religious then it is the unbounded admiration for the structure of the world so far as our science can reveal it." - Albert Einstein
check out my blog

Last edited by cottonvibes; December 4th, 2009 at 03:05.. Reason: Automerged Doublepost
cottonvibes is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT +1. The time now is 04:21.

© 2006 - 2012 Emu Forums | About Emu Forums | Advertisers | Investors | Legal | A member of the Crowdgather Forum Community


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.