I learned Visual Basic as my first language, but as of now my favorite is Java.
Your Programming Language of Choice? Share your favorite way to code
#107
Posted 13 December 2010 - 10:47 AM
Here's some crappy code, Nineko may like it :
I do Have some VB5 code now:
CODE
Private Sub Command2_Click()
Open Label1.Caption + "\" + Text1.Text For Binary As #1
For I% = 0 To 1023
a$ = Chr$(Stage(I%))
Put #1, , a$
Next I%
For I% = 0 To 3
If Option4(I%).Value Then Exit For
Next I%
'direction
a$ = Chr$(I% * 64)
Put #1, , a$
a$ = Chr$(0)
Put #1, , a$
'x
a$ = Chr$(List1.ListIndex)
Put #1, , a$
a$ = Chr$(0)
Put #1, , a$
'y
a$ = Chr$(List2.ListIndex)
Put #1, , a$
a$ = Chr$(0)
Put #1, , a$
'perfect
a$ = Chr$(List3.ListIndex \ 256)
Put #1, , a$
a$ = Chr$(List3.ListIndex And 255)
Put #1, , a$
Close #1
If File1.ListIndex = -1 Then File1.Refresh
End Sub
Open Label1.Caption + "\" + Text1.Text For Binary As #1
For I% = 0 To 1023
a$ = Chr$(Stage(I%))
Put #1, , a$
Next I%
For I% = 0 To 3
If Option4(I%).Value Then Exit For
Next I%
'direction
a$ = Chr$(I% * 64)
Put #1, , a$
a$ = Chr$(0)
Put #1, , a$
'x
a$ = Chr$(List1.ListIndex)
Put #1, , a$
a$ = Chr$(0)
Put #1, , a$
'y
a$ = Chr$(List2.ListIndex)
Put #1, , a$
a$ = Chr$(0)
Put #1, , a$
'perfect
a$ = Chr$(List3.ListIndex \ 256)
Put #1, , a$
a$ = Chr$(List3.ListIndex And 255)
Put #1, , a$
Close #1
If File1.ListIndex = -1 Then File1.Refresh
End Sub
#110
Posted 14 December 2010 - 02:22 AM
I know:
68k ASM
C, Java, I won't claim to know C++ cause I use it so rarely I forget how to do shit
QB, VBC, VB.NET (I haven't used those three in ages)
Python
PHP, MySQL (does that one even count?)
XHTML, CSS, JS
GML (Game Maker), AHK (AutoHotkey)
And yes I did actually program something interactive in AHK, it's an anime episode chooser I use in the lounge (Essentially the media center PC except it's not running Media Center, it's running ordinary Windows XP).
I kind of wish there was a C-style version of AHK, because AHK is incredibly useful but the syntax is even more horrendous than Basic.
Use tabs. Just... use tabs. For the reason already stated in the thread - anyone reading the code will see it with their preference of tab width.
Also, it only takes one keystroke to backspace a tab, while it takes eight (or four if you're not hardcore) keystrokes to backspace an indentation of spaces.
Do that, it looks so much neater.
If you put it on its own line, the shape of the lines moves to the left for the one-character brace which is aligned with the start of the line it should be on... and then moves back over to the right for the body.
If you put it where it should be, the shape of the line moves right for an indent... as it should.
I've also seen people doing this:
which is just plain wrong, the brace is not part of the body.
68k ASM
C, Java, I won't claim to know C++ cause I use it so rarely I forget how to do shit
QB, VBC, VB.NET (I haven't used those three in ages)
Python
PHP, MySQL (does that one even count?)
XHTML, CSS, JS
GML (Game Maker), AHK (AutoHotkey)
And yes I did actually program something interactive in AHK, it's an anime episode chooser I use in the lounge (Essentially the media center PC except it's not running Media Center, it's running ordinary Windows XP).
I kind of wish there was a C-style version of AHK, because AHK is incredibly useful but the syntax is even more horrendous than Basic.
QUOTE
Argument about tabs vs spaces
Use tabs. Just... use tabs. For the reason already stated in the thread - anyone reading the code will see it with their preference of tab width.
Also, it only takes one keystroke to backspace a tab, while it takes eight (or four if you're not hardcore) keystrokes to backspace an indentation of spaces.
QUOTE
Argument about braces on their own line
CODE
void main(void) {
<tab>...
}
<tab>...
}
Do that, it looks so much neater.
If you put it on its own line, the shape of the lines moves to the left for the one-character brace which is aligned with the start of the line it should be on... and then moves back over to the right for the body.
If you put it where it should be, the shape of the line moves right for an indent... as it should.
I've also seen people doing this:
CODE
void main(void)
<tab>{
<tab>...
}
<tab>{
<tab>...
}
which is just plain wrong, the brace is not part of the body.
#111
Posted 14 December 2010 - 02:34 AM
Pretty much all modern IDEs and text editors will kill space-based indentation in a single stroke, so that reason is out of the way.
And like it has been said, usually hard tabs end up mixed with spaces, making the indentation look completely wrong...
And like it has been said, usually hard tabs end up mixed with spaces, making the indentation look completely wrong...
#112
Posted 14 December 2010 - 07:03 AM
CODE
void main(void) {
<tab>...
}
<tab>...
}
Do that, it looks so much neater.
If you put it on its own line, the shape of the lines moves to the left for the one-character brace which is aligned with the start of the line it should be on... and then moves back over to the right for the body.
If you put it where it should be, the shape of the line moves right for an indent... as it should.
Thats the format im trying to use now. I actually got marked down in a technical interview for using the following format:
CODE
void main(void)
{
<tab>...
}
{
<tab>...
}
Apparently senior developers don't like it...
This post has been edited by Yuzoboy: 14 December 2010 - 07:03 AM
#113
Posted 14 December 2010 - 09:10 AM
Objective-C , please don't hit me. :P
Nah, actually C++, but I'm learning/interested in learning Objective-C.
Nah, actually C++, but I'm learning/interested in learning Objective-C.
#114
Posted 14 December 2010 - 04:13 PM
Thats the format im trying to use now. I actually got marked down in a technical interview for using the following format:
Apparently senior developers don't like it...
CODE
void main(void)
{
<tab>...
}
{
<tab>...
}
Apparently senior developers don't like it...
What has indentation has to do with "technical" interview? It's a matter of preference and style (unless you were given some standard/guidelines to adhere to). It's like a bunch of these senior developers (aka fags) would mark you down if you liked Coke instead of Pepsi. I want to punch these sort of interviewers.
#115
Posted 14 December 2010 - 05:31 PM
Use tabs. Just... use tabs. For the reason already stated in the thread - anyone reading the code will see it with their preference of tab width.
That only works for tabs at the beginning of a line. When tabs are used in the middle of a line, that's where it screws up (like in the disassemblies we have, some people use an editor configured for 4-space-wide tabs and they start putting 2 tabs after short mnemonics like jsr, not knowing they should be using 8-space-wide tabs).
The only way to solve code style issues is to use a programming "language" that isn't plain text, but encoded in binary or something (an abstract syntax tree, what). An editor could show the code in whatever style you like, but that information wouldn't be part of the code itself. The downside of this is that a custom editor would be required to edit the code, you can't just use any text editor out there.
#116
Posted 15 December 2010 - 09:32 AM
What has indentation has to do with "technical" interview? It's a matter of preference and style (unless you were given some standard/guidelines to adhere to). It's like a bunch of these senior developers (aka fags) would mark you down if you liked Coke instead of Pepsi. I want to punch these sort of interviewers.
Absolutely nothing is the answer. But it goes to show how far some people wil go to get the perfect candidate. Its understandable if indentation and bracket use was inconsistent but it was just because their team didnt like the style I was using as it meant they would have to "change the way they read code".
#117
Posted 15 December 2010 - 06:40 PM
To me, VB looks kind of like ASM, only more confusing.
That's not VB, that's old-style BASIC being forced though VB5. =P VB5/6 native code is more like:
CODE
Private Sub sonic_write_Click()
Open RomPath For Binary As #1
For Counter = sonic.LBound To sonic.UBound
With sonic(Counter)
If Len(.Text) < .MaxLength Then .Text = .Text & String(.MaxLength - Len(.Text), 32) '32 is the character code for space
WriteString 1, .Tag, .Text
End With
Next Counter
Close #1
MsgBox "Writing complete!", vbInformation, "Sonic Text Editor"
End Sub
Open RomPath For Binary As #1
For Counter = sonic.LBound To sonic.UBound
With sonic(Counter)
If Len(.Text) < .MaxLength Then .Text = .Text & String(.MaxLength - Len(.Text), 32) '32 is the character code for space
WriteString 1, .Tag, .Text
End With
Next Counter
Close #1
MsgBox "Writing complete!", vbInformation, "Sonic Text Editor"
End Sub
=P
#118
Posted 16 December 2010 - 12:40 AM
Click programming.
and Java. (only one I learned in School that I didn't get all frustrated over)
and Java. (only one I learned in School that I didn't get all frustrated over)


00
