Your Programming Language of Choice?

Discussion in 'Technical Discussion' started by Armada, Jul 24, 2008.

  1. MainMemory

    MainMemory

    Have no fear...Amy Rose is here! Tech Member
    4,373
    42
    28
    SonLVL
    I almost never comment my code, mostly because I'm the only person that ever looks at it.

    And I use D3D, because SADX does, and I'm not even sure if OpenGL has managed libraries (lol .NET).
     
  2. Sik

    Sik

    Sik is pronounced as "seek", not as "sick". Tech Member
    6,719
    0
    0
    being an asshole =P
    There are .NET bindings. Heck, there's a brainfuck dialect that supports OpenGL actually o_O
     
  3. <!--quoteo(post=210263:date=Jul 23 2008, 07:33 PM:name=Dark Sonic)--><div class='quotetop'>QUOTE (Dark Sonic @ Jul 23 2008, 07:33 PM) <a href="index.php?act=findpost&pid=210263"><img src="public/style_images/retro/snapback.png"></a></div><div class='quotemain'><!--quotec-->Java as it's the only programming language I sorta know.<!--QuoteEnd--></div><!--QuoteEEnd-->

    Same. Some C, C++, and C# experience, though. Of the three, C# is my favorite, probably in part due to being very similar to Java, but also because I learned it with XNA, which I thought was pretty nice.

    As for commenting / formatting, I usually put // comments on their own lines, just because I usually have the window at less than maximum width, so putting a comment after a long line would make it hard to be seen. I'm a stickler for headers; if one of my students (while I was a TA) didn't put their name or some other identification as a comment, I'd take points off. For braces, I use separate line notation, unless it's, say, an empty block, or something really simple already inside a block:

    Code (Text):
    1. &nbsp;&nbsp;&nbsp;&nbsp;finally
    2. &nbsp;&nbsp;&nbsp;&nbsp;{
    3. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;try {
    4. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (stmt != null)
    5. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;stmt.close();}
    6. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;catch (SQLException e) {
    7. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;handleSQLException(e);}
    8. &nbsp;&nbsp;&nbsp;&nbsp;}
     
  4. theocas

    theocas

    Tech Member
    346
    0
    0
    Well... I know a lot of languages to code in: HTML, JS, PHP, CSS, Fortan, Pascal, ActionScript, C, C++, Java, Objective C, x86 ASM, M68k ASM, Ada, Perl, Python, and a lil bit of BASIC. Most commonly I'm doing ObjC for this magical Mac App I'm working on, PHP for the server-side shit, and sometimes I stick a bit of x86 ASM in my code.

    As for commenting - I never comment my code at all. Until I run into a problem and comment the living shit out of it. In that case, a file turns into 99% comments. Thank god I don't have to code on stuff together with people.
     
  5. Azu

    Azu

    I must be stupid. Member
    In the process of learning Lua for MTA, and possibly Garry's Mod. Though, I might just learn it all together.
     
  6. GenesisFan64

    GenesisFan64

    The bright side of the dark side. Member
    108
    0
    16
    I know:<ul><li>68k ASM</li><li>VB6</li><li>Nintendo's NS-HUBASIC (or <a href="http://en.wikipedia.org/wiki/G-BASIC" target="_blank">G-BASIC</a> in "famiclones")</li><li>Lua (Gens Movie Test's) [still learning...]</li></ul>
     
  7. Overlord

    Overlord

    ...did we just switch realities? Moderator
    17,571
    60
    28
    Berkshire, England
    Learning Cymraeg
    <!--quoteo(post=537339:date=Dec 11 2010, 11:09 AM:name=AamirM)--><div class='quotetop'>QUOTE (AamirM @ Dec 11 2010, 11:09 AM) <a href="index.php?act=findpost&pid=537339"><img src="public/style_images/retro/snapback.png"></a></div><div class='quotemain'><!--quotec-->I use both commenting styles (if I comment), depending on certain things.

    Also, I put braces on their own line. I absolutely HATE the other style (of putting the starting brace in the same line as the block start). Let me say it again, I HATE IT!<!--QuoteEnd--></div><!--QuoteEEnd-->
    I never do. I see it as adding a needless line - you're already starting the function with the name and etc, and considering the curly brace is a single character, why should it have its own line? The start of the function is clear enough as it is.
     
  8. It makes it line up better with the end of the block. I guess I just prefer it that way.
     
  9. Vinchenz

    Vinchenz

    Yo! Hustle! Hustle! Member
    I don't mind extra lines. I personally think it looks better with braces on their own lines. Only time I don't do it is when I make the constructors/destructor in a class.

    I'm also pretty damn obsessed on my coding structure. Like, insanely. I will go through all of my code to make sure I keep <I>white space</I> up to my standards. I keep berating my group members (we're making a pinball game for our final assignment in class) to keep to my coding style (because it's my engine they're working with) and they're all like "dude wtf who cares". >:{

    I'll go in and make it all uniform later. Yes, it bothers me that much. >_>
     
  10. SegaLoco

    SegaLoco

    W)(at did you say? Misfit
    I usually do the code on the sides if I'm just saying "this does that" but if I'm actually putting something longer than a little phrase I put it at the top. Also, I hardly ever comment until way after writing something when I get around to releasing, and even then, my comments are pretty minimal. I don't idiotproof stuff :P
     
  11. You all suck, <a href="http://tasvideos.org/forum/viewtopic.php?t=10467" target="_blank">bask in the wonders of AviSynth and think about all you have done wrong</a>. :colbert:

    ...so what, it's the only language I actually 'know'. :v:
     
  12. Chilly Willy

    Chilly Willy

    Tech Member
    746
    0
    0
    Doom 32X
    A lot of the "odd" styles you see were done back when people were scrounging for every last byte. It's the same reason people still use hard tabs instead of spaces. Spaces mean your indentation is the same on EVERY last editor - hard tabs may be god only knows what. So I go with all spaces and everything on it's own line. It uses more space, but who gives a flip! Yeah, I'm really concerned about that one extra line filling my 1 TB harddrive. :rolleyes:
     
  13. Yuzoboy

    Yuzoboy

    Member
    113
    0
    0
    UK
    I know the most diverse language would be C++ but personally, using C# or Java is the most comfortable language for me. For websites, definitely ASP.NET/C# if you want to build websites quickly and have no knowledge of PHP. I've totally gone off scripting since my Perl days.
     
  14. nineko

    nineko

    I am the Holy Cat Tech Member
    <!--quoteo(post=537547:date=Dec 12 2010, 07:32 AM:name=Chilly Willy)--><div class='quotetop'>QUOTE (Chilly Willy @ Dec 12 2010, 07:32 AM) <a href="index.php?act=findpost&pid=537547"><img src="public/style_images/retro/snapback.png"></a></div><div class='quotemain'><!--quotec-->It's the same reason people still use hard tabs instead of spaces.<!--QuoteEnd--></div><!--QuoteEEnd-->Sadly both Quick Basic and Visual Basic insert a series of spaces even if you press TAB, I'd totally prefer to use a hard TAB instead :(
    Fortunately when I write stuff in php I can use hard tabs since I use notepad :v:

    Then again I rarely indent my code at all, so this doesn't really matter. I just see spaces as a waste, and I think they can easily lead to misaligned code if you accidentally remove one of them and have (e.g.) 4 spaces here and 5 spaces there. With a tab it's just a tab.
     
  15. TmEE

    TmEE

    Master of OPL3-SA2/3 Tech Member
    1,726
    0
    16
    Estonia, Rapla City
    T-04YBSC-A !
    I hate hard Tabs, I wish they never existed
     
  16. Sik

    Sik

    Sik is pronounced as "seek", not as "sick". Tech Member
    6,719
    0
    0
    being an asshole =P
    The worst issues with hard tabs arise when they're mixed with spaces though - and a lot of projects do that. Ack, reading code when its indentation seems random is annoying.
     
  17. I'm also pretty pedantic when it comes to coding style. My coding style has changed over time: it went from 4 spaces to 2 spaces to 1 space to 4 spaces (never tabs, except for ASM). For C, C++ and C#, I put the braces on individual lines (because Visual Studio and StyleCop seem to prefer it that way), but when I do Java, it looks like Eclipse prefers that I use fewer lines. But now I'm using Qt Creator for other projects and it does like Eclipse... WHAT DO I DO NOW?? (Oh wait, it's configurable. Yay for options.) Also, it likes to put case labels at the same level as the switch, whereas I prefer indenting the case:
    Code (Text):
    1. switch (n)
    2. {
    3. &nbsp;&nbsp;&nbsp;&nbsp;case 0:
    4. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;puts("It's zero.");
    5. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break;
    6. &nbsp;&nbsp;&nbsp;&nbsp;case 1:
    7. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;puts("It's one.");
    8. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break;
    9. &nbsp;&nbsp;&nbsp;&nbsp;default:
    10. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;puts("It's neither zero nor one.");
    11. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break;
    12. }
    I configured Notepad++ to show symbols for whitespace because I'm so pedantic about it. :v: And unlike some other editors who use the color of the text for the symbols, it's possible to change the color in Notepad++ so that it isn't too "noisy" (although the default color is fine).
     
  18. Dude

    Dude

    Tech Member
    3,137
    0
    0
    Southbridge, MA
    Random VR/AR trash
    <!--quoteo(post=537630:date=Dec 12 2010, 12:00 PM:name=FraGag)--><div class='quotetop'>QUOTE (FraGag @ Dec 12 2010, 12:00 PM) <a href="index.php?act=findpost&pid=537630"><img src="public/style_images/retro/snapback.png"></a></div><div class='quotemain'><!--quotec-->I'm also pretty pedantic when it comes to coding style. My coding style has changed over time: it went from 4 spaces to 2 spaces to 1 space to 4 spaces (never tabs, except for ASM). For C, C++ and C#, I put the braces on individual lines (because Visual Studio and StyleCop seem to prefer it that way), but when I do Java, it looks like Eclipse prefers that I use fewer lines. But now I'm using Qt Creator for other projects and it does like Eclipse... WHAT DO I DO NOW?? (Oh wait, it's configurable. Yay for options.) Also, it likes to put case labels at the same level as the switch, whereas I prefer indenting the case:
    Code (Text):
    1. switch (n)
    2. {
    3. &nbsp;&nbsp;&nbsp;&nbsp;case 0:
    4. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;puts("It's zero.");
    5. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break;
    6. &nbsp;&nbsp;&nbsp;&nbsp;case 1:
    7. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;puts("It's one.");
    8. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break;
    9. &nbsp;&nbsp;&nbsp;&nbsp;default:
    10. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;puts("It's neither zero nor one.");
    11. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break;
    12. }
    I configured Notepad++ to show symbols for whitespace because I'm so pedantic about it. :v: And unlike some other editors who use the color of the text for the symbols, it's possible to change the color in Notepad++ so that it isn't too "noisy" (although the default color is fine).<!--QuoteEnd--></div><!--QuoteEEnd-->

    Pretty much this; I always format my code like this, simply because I'm anal. Every block of code gets its own indentation layer, invariably.
     
  19. AamirM

    AamirM

    Tech Member
    <!--quoteo(post=537547:date=Dec 12 2010, 01:32 AM:name=Chilly Willy)--><div class='quotetop'>QUOTE (Chilly Willy @ Dec 12 2010, 01:32 AM) <a href="index.php?act=findpost&pid=537547"><img src="public/style_images/retro/snapback.png"></a></div><div class='quotemain'><!--quotec-->It's the same reason people still use hard tabs instead of spaces. Spaces mean your indentation is the same on EVERY last editor - hard tabs may be god only knows what. So I go with all spaces and everything on it's own line.<!--QuoteEnd--></div><!--QuoteEEnd-->
    Actually, no. Tabs are a LOT more convenient and portable than spaces. Here's why. Consider you like indentation of four (4) spaces, so you indent your code with 4 real spaces. Now, your co-worker, who is also working on your code, likes indentation of 2 spaces only. So, to make the code more pleasant to his eyes, he would either have to manually remove those extra two spaces of indentation or run a formatter/indention tool. Tedious. Now, if you used tabs, all he/she would have to do is to just set the tabwidth to the amount of spaces you like. Simple, easy and portable. No manual stuff required.

    Using tabs, you're not only pleasing yourself, but others as well. Using spaces, you're only pleasing yourself.

    (All this considering that you aren't using a brain-dead retarded of an editor).
     
  20. DigitalDuck

    DigitalDuck

    Arriving four years late. Member
    4,809
    20
    18
    Lincs, UK
    TurBoa, S1RL
    <!--quoteo(post=537630:date=Dec 12 2010, 05:00 PM:name=FraGag)--><div class='quotetop'>QUOTE (FraGag @ Dec 12 2010, 05:00 PM) <a href="index.php?act=findpost&pid=537630"><img src="public/style_images/retro/snapback.png"></a></div><div class='quotemain'><!--quotec-->
    Code (Text):
    1. switch (n)
    2. {
    3. &nbsp;&nbsp;&nbsp;&nbsp;case 0:
    4. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;puts("It's zero.");
    5. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break;
    6. &nbsp;&nbsp;&nbsp;&nbsp;case 1:
    7. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;puts("It's one.");
    8. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break;
    9. &nbsp;&nbsp;&nbsp;&nbsp;default:
    10. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;puts("It's neither zero nor one.");
    11. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break;
    12. }
    <!--QuoteEnd--></div><!--QuoteEEnd-->

    I indent my code exactly like this, except when, as in this situation, each case has only one command attached to it, in which case I put it on the same line as the case.

    And hard tabs all the way. Except HTML, where I like to use spaces because I like to keep indents very small there. Oh, and I <b>always</b> indent, as it's an old habit left over from QuickBASIC/GW-BASIC/Python.