don't click here

Your Programming Language of Choice?

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

  1. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,710
    301
    63
    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,718
    1
    0
    being an asshole =P
    There are .NET bindings. Heck, there's a brainfuck dialect that supports OpenGL actually o_O
     
  3. 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.     finally
    2.     {
    3.       try {
    4.         if (stmt != null)
    5.           stmt.close();}
    6.       catch (SQLException e) {
    7.         handleSQLException(e);}
    8.     }
     
  4. theocas

    theocas

    Tech Member
    346
    0
    16
    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:
    • 68k ASM
    • VB6
    • Nintendo's NS-HUBASIC (or G-BASIC in "famiclones")
    • Lua (Gens Movie Test's) [still learning...]
     
  7. Overlord

    Overlord

    Now playable in Smash Bros Ultimate Moderator
    19,193
    954
    93
    Long-term happiness
    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 white space 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? Banned
    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. Flygon

    Flygon

    Member
  12. Chilly Willy

    Chilly Willy

    Tech Member
    751
    11
    18
    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
    114
    0
    16
    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
    6,287
    473
    63
    italy
    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
    2
    18
    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,718
    1
    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.     case 0:
    4.         puts("It's zero.");
    5.         break;
    6.     case 1:
    7.         puts("It's one.");
    8.         break;
    9.     default:
    10.         puts("It's neither zero nor one.");
    11.         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,138
    0
    16
    Southbridge, MA
    Random VR/AR trash
    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
    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
    5,324
    405
    63
    Lincs, UK
    TurBoa, S1RL
    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 always indent, as it's an old habit left over from QuickBASIC/GW-BASIC/Python.