that's my favorite tool for any programing tasksQuote:
Originally Posted by john_d
Printable View
that's my favorite tool for any programing tasksQuote:
Originally Posted by john_d
i wish it has.. color picker.. hihihiQuote:
Originally Posted by [lexx]
I always prefer to keep my code as neat as possible with indents..I don't leave alot of blank lines in the middle though.
Btw, john_d, if i'm not mistaken, the php plugin for MSVS has that feature as well, and I believe you can change the colors on that :P
[N]asser` ~ Out
he was talking about notepad++...Quote:
Originally Posted by [N]asser
it really lacks that feature... then usage of WYSIWYG editors for color picking would be really decreased for me..
i have to go to other program to puts colors and stuff.. :p no worries though.. fireworks and photoshop always open on pc anyway.. hihihQuote:
Originally Posted by [lexx]
This recent example says everything about empty lines, indents and namings:
I'm tempted to use short variable names, I always indent, sometimes I comment the end bracket if there's much code between. For single-statement if's I only indent, not use brackets. Also, I usually put empty lines to separate significantly differing code segments. I usually don't have a problem following a previously written program of mine after a while, but I should work on using more describing variable names when it comes to bigger projects. I usually write the code fast and let compiler point out the mistaken names and missing characters and all.Code:void CMainWnd::OnPaint()
{
CPaintDC dc(this);
if (play)
{
CHARACTER *chr;
POSITION pos=chars.GetHeadPosition();
for (int i=0; i<chars.GetCount(); i++)
{
chr=&chars.GetNext(pos);
dc.Ellipse(chr->loc.x-3, chr->loc.y-3, chr->loc.x+3, chr->loc.y+3);
**
** //play
**
I used that for a while, its kind of like gedit on linux.Quote:
Originally Posted by john_d
That's absolutely right :) I use notepad++ a lot, but I wish it had more php functions added, like odbc functions.Quote:
Originally Posted by john_d
Anyways, that's something I can live with :tp:
would love to see some of your works :pQuote:
Originally Posted by Lady_Fu
A certain developer on here made a function in me excel then converted it to code and gave it to me. Since he converted it directly and knew exactly how it was laid out in excel he just named the variables A, B, C etc.. i have been coding in a LOT of languages for YEARS and i have to say thats the most obfuscated piece of crap i have ever seen in my LIFE! it looks like enigma or something! (its only 30 or so lines long! i cant even debug this thing)
I use tab indentation but usually convert it to 4space later, this makes it easier to indent etc but old editors and, particularly, unix developers tend to REALLY hate tabs. One or 2 spaces is simply too small to clearly see the indentation and if you actaully write 4 spaces per indent you end up writing 13 spaces instead of 12 or whichever which will be a total disaster if you ever try a language such as python, which is indentation dependant.
I put my opening braces on their own line but if there is only one line to execute in a block I put it on its own line (unless its a language like VB in which putting it on its own line requires you to put an "End If" on another line). Blank lines can also be very useful to make code readable and people should always ALWAYS use meaningful names for variables.
sometimes i use variable names with names like intSomeNumber, sometimes i use just plain someNumber etc, depending on the language.
I try and keep comments on their own lines and put a space between the comment keyword and its text (for example "' Some comment" or "// Some other comment"
some code of mine may look like this:I know.. im weird.. but i find it makes my code incredibly readable for others :DCode:#include <iostream>
using namespace std;
int main()
{
int intSomeNumber = 0;
int* ptrSomeNumber = &intSomeNumber;
for(int i = 0; i < 2; i++)
(*ptrSomeNumber)++;
// Better output something at some point
cout << *ptrSomeNumber;
if(intSomeNumber == *ptrSomeNumber)
{
cout << "This definately happened" << endl;
return 0;
**
else
return 1;
**
Also while people are talking about editors i HIGHLY reccomend one for windows called CRIMSON EDITOR (Homepage of Crimson Editor - Free Text Editor, Html Editor, Programmers Editor for Windows) It's by far the best editor I have ever seen, supports hundreds of languages, tabbed editing and a shedload of good features but remains lightweight, it is pretty reminiscent of gEdit but has a lot more features (hell you can save directly to ftp and use macros and it has auto intent and simple project support) and is for windows (theres an Open Source port i believe called Emerald Editor but i have never seen it actually used)
Hmm... I like to keep my code neat//easy to read but some what compact, and organized, indenting, using long veriable names so i know what they are later, etc.
right now I'm coding Dios's Mu server website.. I was trying to code a site for car sales, but I quitted that project.. and there are a couple of projects in my head that I'll make true when I can find a time for them :tp:Quote:
Originally Posted by john_d
i always use whitespace, never comments, my code is very dirty, i use a lot of code to do simple tasks in php and c++
i also dont type code like mysql queries, i just have a library of ones i made for all circumstances.
i hate elses and if's but use them alot
i suggest you all go linux way.. once you get teh hang of it, you never let down :) it's simply so neat and easy.
there you can use kate ( KDE Advanced Text Editor ), which has syntax highlighting and eeevery tool u need. believe me, it's worth it. Made my like a ton more easyer :D