StepChild OSX.
-
- KVRist
- 105 posts since 19 Oct, 2003
A word of the wise to everyone who ever coded anything:
Aesthetics in code is important, and only marginally less important than actual functionality.
Why? Because beautiful code is more enjoyable to write, read and understand. The number of times I've spotted a subtle bug because I'd expected two operators or operands to line up but they didn't are too many to count. Furthermore, when code is beautiful, I take the time to read over it, and ususally spot a problem or two in the process. This is one of the reasons why people who say case-sensitive languages are unnecessarily restrictive are full of it.
So: Have consistent naming styles. One of the great things about Java is that *everybody* uses the same style. Classes have CapitalNames, methods and variables camelCaseNames, etc. It makes it *so* much easier to interoperate with other programmers and code. When I code C#, I have a different style altogether, simply because of the culture of the language. Also, use whitespace consistently. I personally use a whitespace before each open bracket and whitespace around each operator religiously.
Trust me - the extra 2% of effort (once you've gotten used to it) will repay itself a thousand times over when it comes to debugging, extending and understanding your code.
The other thing which all programmers must write on a large piece of paper and hang above their bed (and hope that the girl/guy they take home is too drunk to notice or ask) is this:
Code that is undocumented is incomplete and potentially useless!.
In Java, use JavaDoc comments for *every* method and class. In Python, use pydoc. In C#, use DocComments. In Pascal, at least have a convention. I write the comments describing a method or class before I write any code in the class. In fact, I make a skeletal program with all my classes and most of their methods with nothing but comments as part of the design phase of the development. This makes the entire experience so much easier and more enjoyable, because I don't find myself writing new code that is inconsistent with old code.
/end rant
Martin
Aesthetics in code is important, and only marginally less important than actual functionality.
Why? Because beautiful code is more enjoyable to write, read and understand. The number of times I've spotted a subtle bug because I'd expected two operators or operands to line up but they didn't are too many to count. Furthermore, when code is beautiful, I take the time to read over it, and ususally spot a problem or two in the process. This is one of the reasons why people who say case-sensitive languages are unnecessarily restrictive are full of it.
So: Have consistent naming styles. One of the great things about Java is that *everybody* uses the same style. Classes have CapitalNames, methods and variables camelCaseNames, etc. It makes it *so* much easier to interoperate with other programmers and code. When I code C#, I have a different style altogether, simply because of the culture of the language. Also, use whitespace consistently. I personally use a whitespace before each open bracket and whitespace around each operator religiously.
Trust me - the extra 2% of effort (once you've gotten used to it) will repay itself a thousand times over when it comes to debugging, extending and understanding your code.
The other thing which all programmers must write on a large piece of paper and hang above their bed (and hope that the girl/guy they take home is too drunk to notice or ask) is this:
Code that is undocumented is incomplete and potentially useless!.
In Java, use JavaDoc comments for *every* method and class. In Python, use pydoc. In C#, use DocComments. In Pascal, at least have a convention. I write the comments describing a method or class before I write any code in the class. In fact, I make a skeletal program with all my classes and most of their methods with nothing but comments as part of the design phase of the development. This makes the entire experience so much easier and more enjoyable, because I don't find myself writing new code that is inconsistent with old code.
/end rant
Martin
"Life is both a major and a minor key"
-- Travis, Side
-- Travis, Side
-
- KVRAF
- 1974 posts since 21 Jun, 2002 from Earth
very methodical...
I use a mixture of things... my approach to coding is somewhat like art. For example, I like lining up the ':=' in delphi, but not because it's proper... but because it feels right [edit]. Purely selfish. I tend to capitalize my constants now, but beyond that who knows...
I'm somewhat of a chaotic person... so I'm kinda all over the place when it comes down to it. If people where to rate my form, I'd surely get an F. I do tend to comment my code tho, and now group my routines based on their function. I've had to completely rearrage Toby's template, so that common routines are grouped together. Then I put a huge comment at the ehad of that entire section. It helps me stay organized
(or so I like to think). In the end I just try to get it to work... and once it does, my brain starts thinking of more ideas and the old concept is left on the shelf to collect dust.
I can kinda relate to how someone like arguru used to just abandon projects then fire up a new one. I dunno if it's for the same reasons, but I feel I learn a lot more... at which points it's not the code that matters but the execution of the concept. Hmmmm, I've never really thought about this... interesting stuff...
BTW Karbon, did you really email me? cos if you did I never got a thing. You can email me at: modulratsubminimaldotorg
I use a mixture of things... my approach to coding is somewhat like art. For example, I like lining up the ':=' in delphi, but not because it's proper... but because it feels right [edit]. Purely selfish. I tend to capitalize my constants now, but beyond that who knows...
BTW Karbon, did you really email me? cos if you did I never got a thing. You can email me at: modulratsubminimaldotorg
ModuLR / Radio
- KVRAF
- 8109 posts since 13 Jan, 2003 from Darkest Kent, UK
mine too.ModuLR wrote:... my approach to coding is somewhat like art.
though I'm more of an abstract expressionist like Jackson Pollock.
only today i had to quickly reformat someones data, didn't have time to "do it properly" so imported it to Excel and wrote the most horrific, hacky bit of Visual Basic ever to grace a spreadsheet...
worked though.
can VSTs be written in VB?
.g
-
Karbon L. Forms Karbon L. Forms https://www.kvraudio.com/forum/memberlist.php?mode=viewprofile&u=29033
- KVRian
- 1413 posts since 10 Jun, 2004 from Inverness, Scotland
That's all very well chaps.
Take this hypothetical piece of Delphi...
iccyiccyftangftang := nurdle;
Now without any form of disciplined coding eh... code? Style or whatever. We can see that iccyiccyftangftang is a variable of SOME kind because it's being assigned to.
What's nurdle? A constant? a function? a variable? What sort of variable? I don't have delphi so I can't hover the mouse for an explaination. Time to scroll and search!
You have to look at the definitions then search-and-replace them into recognisability. Which is itself frought with danger.
Take this hypothetical piece of Delphi...
iccyiccyftangftang := nurdle;
Now without any form of disciplined coding eh... code? Style or whatever. We can see that iccyiccyftangftang is a variable of SOME kind because it's being assigned to.
What's nurdle? A constant? a function? a variable? What sort of variable? I don't have delphi so I can't hover the mouse for an explaination. Time to scroll and search!
You have to look at the definitions then search-and-replace them into recognisability. Which is itself frought with danger.
.................................
"Hell is other People" J.P.Sartre
.................................
"Hell is other People" J.P.Sartre
.................................
-
- KVRer
- 18 posts since 9 Jan, 2004
Tags are your friends!Karbon L. Forms wrote: What's nurdle? A constant? a function? a variable? What sort of variable? I don't have delphi so I can't hover the mouse for an explaination. Time to scroll and search!
http://ctags.sourceforge.net/
Exuberant ctags supports Pascal so maybe it would work on Delphi as well.
This signature is untrue
-
Karbon L. Forms Karbon L. Forms https://www.kvraudio.com/forum/memberlist.php?mode=viewprofile&u=29033
- KVRian
- 1413 posts since 10 Jun, 2004 from Inverness, Scotland
Hmm intereshting. Very intereshting. Never heard of she-tagsh before mish moneypenny. Though upon invetstigashun, my tecsht editor shupportsh sheep-lush-plush she-tagsh.
YO! GUYS!! Anyone got Delphi? They don't seem to be giving it away anymore
Anyone got an old PCPLUS coverdisk with it on sitting about? I'm not adverse to a little electronic transfer (via messenger or somewhat)
Obviously staying within lisence stuff!
It would speed up my porting no end.
.................................
"Hell is other People" J.P.Sartre
.................................
"Hell is other People" J.P.Sartre
.................................
-
- KVRian
- 880 posts since 11 Jun, 2001 from Munich, Germany
Delphi 6 PE is still available all over the net (legally!), check this thread:
http://www.kvr-vst.com/forum/viewtopic.php?t=42818
Cheers
Toby
www.tobybear.de
http://www.kvr-vst.com/forum/viewtopic.php?t=42818
Cheers
Toby
www.tobybear.de
-
Karbon L. Forms Karbon L. Forms https://www.kvraudio.com/forum/memberlist.php?mode=viewprofile&u=29033
- KVRian
- 1413 posts since 10 Jun, 2004 from Inverness, Scotland
Ya fookin dancer!
.................................
"Hell is other People" J.P.Sartre
.................................
"Hell is other People" J.P.Sartre
.................................
-
- KVRAF
- 4644 posts since 28 Nov, 2002 from Chicago
Uhuh. That's why I use my own f**ked up version of Polish. It is clear as day for me, and incomprehensible for everyone else.Karbon L. Forms wrote:That's all very well chaps.
Take this hypothetical piece of Delphi...
iccyiccyftangftang := nurdle;
And if you wanna bitch about bad variable names, try deciphering some of the fortran code floating around my place of work. One of my favourites has a quad nested loop with variables i, ii, iii, mr, xi, xmr, yiii, xyi, and xyiii.
Someone shot the food. Remember: don't shoot food!
-
- KVRian
- 880 posts since 11 Jun, 2001 from Munich, Germany
C++ code is often way more f*cked up then Delphi/Pascal, or at least it is harder to decypher when there are no comments.
Here are two programs I submitted at the first semester of my university studies in a C++ course:
Converting Roman numerals to numbers:
on a pool table:

Cheers
Toby
www.tobybear.de
Here are two programs I submitted at the first semester of my university studies in a C++ course:
Converting Roman numerals to numbers:
A little ball bouncing off the window edges like#define V C+=M[I-1]==
main(){char M[50];int I,D,C,X=0;cin>>M;
strupr(M);for(I=strlen(M);I;I--)
{C=0;V'M'?1000:0;V'D'?500:0;V'C'?100:0;
V'L'?50:0;V'X'?10:0;V'V'?5:0;V'I'?1:0;
X+=C<D?-C:C;D=C;}cout<<X;}
on a pool table:
But hey, I passed...#define z ?-1:1
int u=3,v=u,o=400,b=o,y=20,w=700,h=500;
main(){long T=OpenWindow(1,1,w,h,"");
for(;;){o+=u;b-=v;DrawCircle(T,o,b,y);
v*=(b<y||b>h-y)z;u*=(o<y||o>w-y)z;
ClearWindow(T);}}
Cheers
Toby
www.tobybear.de
-
- KVRAF
- 1974 posts since 21 Jun, 2002 from Earth
I couldn't agree more!tobybear wrote:C++ code is often way more f*cked up then Delphi/Pascal, or at least it is harder to decypher when there are no comments.
ModuLR / Radio
-
Karbon L. Forms Karbon L. Forms https://www.kvraudio.com/forum/memberlist.php?mode=viewprofile&u=29033
- KVRian
- 1413 posts since 10 Jun, 2004 from Inverness, Scotland
Depends who's writing it.ModuLR wrote:I couldn't agree more!tobybear wrote:C++ code is often way more f*cked up then Delphi/Pascal, or at least it is harder to decypher when there are no comments.I wish delphi was cross platform, because I really like it infinately better than C++. Much easier on the brain, and much easier to read.
.................................
"Hell is other People" J.P.Sartre
.................................
"Hell is other People" J.P.Sartre
.................................
-
- KVRian
- 880 posts since 11 Jun, 2001 from Munich, Germany
Well, Delphi actually *is* cross-platform, if you consider Windows and Linux systems.
But maybe the new FreePascal 2.0 (that will hopefully soon be out) allows compiling Delphi units on the Mac?
Here is some info:
FP for Mac:
http://www.freepascal.org/fpcmac.html
FP in general:
http://www.freepascal.org/
Delphi-clone for FP:
http://www.lazarus.freepascal.org/
Cheers
Toby
www.tobybear.de
But maybe the new FreePascal 2.0 (that will hopefully soon be out) allows compiling Delphi units on the Mac?
Here is some info:
FP for Mac:
http://www.freepascal.org/fpcmac.html
FP in general:
http://www.freepascal.org/
Delphi-clone for FP:
http://www.lazarus.freepascal.org/
Cheers
Toby
www.tobybear.de
-
Karbon L. Forms Karbon L. Forms https://www.kvraudio.com/forum/memberlist.php?mode=viewprofile&u=29033
- KVRian
- 1413 posts since 10 Jun, 2004 from Inverness, Scotland
So would StepChild compile on Linux?tobybear wrote:Well, Delphi actually *is* cross-platform, if you consider Windows and Linux systems.
But maybe the new FreePascal 2.0 (that will hopefully soon be out) allows compiling Delphi units on the Mac?
Here is some info:
FP for Mac:
http://www.freepascal.org/fpcmac.html
FP in general:
http://www.freepascal.org/
Delphi-clone for FP:
http://www.lazarus.freepascal.org/
Cheers
Toby
www.tobybear.de
.................................
"Hell is other People" J.P.Sartre
.................................
"Hell is other People" J.P.Sartre
.................................
-
- KVRian
- 880 posts since 11 Jun, 2001 from Munich, Germany
Borland Kylix is the Delphi version for Linux, it does however not compile to machine code executable on PPC CPUs.
Cheers
Toby
www.tobybear.de
Depends on what additional components have been used. If all additional units are available as source code and do not call any Windows specific functions (COM-objects, WinAPI, ...), it should work with a bit of conversion work.So would StepChild compile on Linux?
Cheers
Toby
www.tobybear.de
