• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Programmers: Question

Nocturnal

Lifer
Do you ever get confused when you are coding something and you have to put in:

if a = dothis()
then dothis().text1 = "help"
loop a(function)
end

I know that is not valid code but I am just talking about something like that. I get confused when I try to read people's code like that.

I'm an inspiring Computer Science major... should I be worried that I get confused or were any of you like that as well?
 
Originally posted by: Nocturnal
Do you ever get confused when you are coding something and you have to put in:

if a = dothis()
then dothis().text1 = "help"
loop a(function)
end

I know that is not valid code but I am just talking about something like that. I get confused when I try to read people's code like that.

I'm an inspiring Computer Science major... should I be worried that I get confused or were any of you like that as well?

This is about as confusing as which way is up.
😕
 
Originally posted by: Nocturnal
What I meant is when they start using:

a = function

function.text1.text

Or something along those lines.

you should make sure you understand all that stuff before moving on, imo. a = function is setting a equal to whatever value is returned when you call the function.
 
Private Sub Command1_Click()
Static Round As Integer
Round = Round + 1
Randomize Timer ' make a random seed, based on the Timer
Dim a As Integer ' make it an Integer to remove decimals
a = 16 * Rnd + 1 ' pick a random # between 1 and 16
NewLine = Chr(13) + Chr(10) ' This creates a new line when typed in a textbox
Text1 = Text1 + NewLine ' add a blank line
Text1 = Text1 & "--ROUND#" & Round & "---" & NewLine ' Type the round number
Text1 = Text1 & "Yndolia casts Fireball, and hit Erwulf, Harald and Fiona for <" & a & "> points of damage." + NewLine
Text1.SetFocus ' set the focus to Text1
SendKeys "^{End}" ' Send the key [CTRL] and [End] to make the typing cursor go down, wich in turn makes the scrollbar stay DOWN.
End sub

Something like that where you keep adding things on equaling something. Like text1 = text1 & " blah" for text1 <" blah ">
 
Originally posted by: gopunk
Originally posted by: Nocturnal
What I meant is when they start using:

a = function

function.text1.text

Or something along those lines.

you should make sure you understand all that stuff before moving on, imo. a = function is setting a equal to whatever value is returned when you call the function.

I haven't even dabbled with computer science/programming. I'm just doing my liberal arts at a community college right now.
 
is this vb? i don't know vb, so i might be biased, but i think it's one of the crappiest languages to start out learning how to program with.
 
Originally posted by: gopunk
is this vb? i don't know vb, so i might be biased, but i think it's one of the crappiest languages to start out learning how to program with.
Why is that?

 
Originally posted by: Nocturnal
Private Sub Command1_Click()
Static Round As Integer
Round = Round + 1
Randomize Timer ' make a random seed, based on the Timer
Dim a As Integer ' make it an Integer to remove decimals
a = 16 * Rnd + 1 ' pick a random # between 1 and 16
NewLine = Chr(13) + Chr(10) ' This creates a new line when typed in a textbox
Text1 = Text1 + NewLine ' add a blank line
Text1 = Text1 & "--ROUND#" & Round & "---" & NewLine ' Type the round number
Text1 = Text1 & "Yndolia casts Fireball, and hit Erwulf, Harald and Fiona for <" & a & "> points of damage." + NewLine
Text1.SetFocus ' set the focus to Text1
SendKeys "^{End}" ' Send the key [CTRL] and [End] to make the typing cursor go down, wich in turn makes the scrollbar stay DOWN.
End sub

Something like that where you keep adding things on equaling something. Like text1 = text1 & " blah" for text1 <" blah ">

You forgot to query the user as to whether or not they "want to play a game?"

 
Originally posted by: minendo
Originally posted by: gopunk
is this vb? i don't know vb, so i might be biased, but i think it's one of the crappiest languages to start out learning how to program with.
Why is that?

i dunno it just all looks really convoluted and the syntax is dissimilar from most other programming languages. i would start out with C or something... it's a better time investment imo, since so many other languages that you might want to learn will have c-style syntax.
 
Originally posted by: Nocturnal
Do you ever get confused when you are coding something and you have to put in:

if a = dothis()
then dothis().text1 = "help"
loop a(function)
end

I know that is not valid code but I am just talking about something like that. I get confused when I try to read people's code like that.

I'm an inspiring Computer Science major... should I be worried that I get confused or were any of you like that as well?

I do not generally play grammar police, is that really what you meant? It is not clear that you will inspire many with your current programming skills. If I were you I would ASPIRE to learn programing.
 
Something like that where you keep adding things on equaling something. Like text1 = text1 & " blah" for text1 <" blah ">

thats pretty simple man, just think of it like this: text1 = text 1 & "blah"
so assuming text1 already contains "smurf" then what that code does is concatenate "blah" to "smurf", creating "smurfblah" and storing it in the same variable. you know what i mean? it evaluates the stuff on the right on the assignment character, so text1 & blah and then after its done evaluating the expression it assigns it to the variable...

does this help at all?



edit: are you seriously learning vb in uni?
 
Originally posted by: FelixDeKat
Originally posted by: Nocturnal
Private Sub Command1_Click()
Static Round As Integer
Round = Round + 1
Randomize Timer ' make a random seed, based on the Timer
Dim a As Integer ' make it an Integer to remove decimals
a = 16 * Rnd + 1 ' pick a random # between 1 and 16
NewLine = Chr(13) + Chr(10) ' This creates a new line when typed in a textbox
Text1 = Text1 + NewLine ' add a blank line
Text1 = Text1 & "--ROUND#" & Round & "---" & NewLine ' Type the round number
Text1 = Text1 & "Yndolia casts Fireball, and hit Erwulf, Harald and Fiona for <" & a & "> points of damage." + NewLine
Text1.SetFocus ' set the focus to Text1
SendKeys "^{End}" ' Send the key [CTRL] and [End] to make the typing cursor go down, wich in turn makes the scrollbar stay DOWN.
End sub

Something like that where you keep adding things on equaling something. Like text1 = text1 & " blah" for text1 <" blah ">

You forgot to query the user as to whether or not they "want to play a game?"

HAHAHH!!! Wargames reference!
 
Originally posted by: Apathetic
It depends on how well the code is written. Bad code is just awkward to look at.

Dave

#define processor x86

#include <stdio.h>
#include <sys/stat.h>

#define l int*
#define F char
struct stat t;
#define c return
#define I (P+=4,*L(P-4,0))
#define G (signed F)E(*L(P++,0))
#define C(O,D)E (D[B+V(010)/4+O*10])
#define U R[4]=E(V(17)-4),*(l)V(021)=
F M [99],Q[99],b[9999],*ss,*d=b,*z;
#define O =(n=*(l)V(021),R[4]=E(V(17)+4),n)
#define p(a,b,c) system((sprintf(a,b,k[1]),c)),z
#define g (y/010&7)
#define R (B+13)
#define x86 (F*)index\
(ss+V(i ),0100)
#define D(y,n,a,m,i,c )d+=sprintf( d,y,n,a,m,i,c ),(F*\
) P
l B,i,n,a,r,y ,
P ;
#define Tr(an,sl,at,or) l an##i(d,sl){ c at? an##i(d,r)😱r; } \
l an(d, sl){ c \
r=V(014 )&63,an##i(d,sl); }
#define add(Ev,Gv) Ev(){ i=((a-=16)+C(r,4))/4,(\
Gv?Ev() :0) ; } Ev##n(){ a=C(r,5),Ev(); }
Tr(L,r, C(r,3)&&C(r,3)<=d?(l)(((int)B)+d+C(r,4)-C(r,3))🙁((int)B)^d)>>24&&--\
r,(l)d) Tr(Run,a,(ss=strcmp((F*)B+C((V(12)>>16),4)+C(--r,0),A(.strtab))?ss🙁F\
*)B+C(r ,4),C(r,1)-2),0) add(Sca ,V(-~i)-P+2) add(ru,strcmp(ss+V(i),A(main)))
E(DX) { c *z? DX😀X <<030|(DX&65280)<<010|DX>>8&65280|DX>>24&0377; } l K(k){
c L(E(k [(l)V(17)]),0); } V(v){ c E(B[v]); }


main (char *ck, char **k) {
exit(E((ck?main((z?(stat(M,&t)?P+=a+'{'?0:3:execv(M,k),a=G,i=P,y=G&255,sprintf(Q,y/'@'-3?A(*L(V(%d+%d)+%d,0)):A(R[%d]),(y&7),'\r',y/0100-1?0:G),(a+127&&a+'}'&&a+1?(a+61&&a+24&&a+025?(P=a+'H'&&a%061<=0?P:i,D(a>0?&quot; R[%d]=E(~-E(R[%d])),\0 U R[%d],\0 R[%d] O,\0 U %d,\0R[%d]=0,&quot;+(a&'8')*3:a <- 'c'?&quot; %d, %c%s = R[%d], \0 %d, *R=%c%s==R[%d], \0 R[%d]=(int)%c%s,&quot;-a%'w'%'j'*5:&quot;%d,%d,%s=%d,&quot;,a>0?a-'h'?a-49?a&7:g:I:g,a>0?a&7:&quot;& &quot;[a%3%2+1],a+72?Q:A(*R),a>0|a<-99?g:I,0))🙁P=i,i=a+61?a+21?E(I):G:0,D(a%' '+29+&quot;P O,\0 U %d,P=%d,&quot;,P,P+i,0,0,0),p(d,&quot;A'&quot;,b)))🙁n=g-4?g%5-1?a+127?G:I:0🙁Scan(),*( x86?processor 😀)=0,(int)(ss+V(i))),g%5<2?D(g%5?&quot; %s=E(~-E(%s)), \0 U %s,&quot;+4*g:&quot;%s=E(E(%s)%c%d),&quot;,Q,Q,&quot;+ - &quot;[g],n,0)🙁a=G-'u'?'!':'=',D(g-4?&quot;P=%d%c=%s?%d:%d,&quot;:&quot;*R=E(((int(*)(l,l,l))%s)(K(1),K(2),K(3))),P O,&quot;,n,a,Q,P,P+G),p(d,&quot;A'&quot;,b)))))🙁Run((z=(F*)&ck,stat(k[1],&t),B=(l)mmap(0,i=t.st_size,3,1,open(k[1],2),0))),magic((R[4]=E(B+i/4),run(),P=V(-~i),U 0)),sprintf(M,A(.%s%d),k[1],P),D(&quot;%s %s '-DX=A(%s)' -o %s '-Dmagic=&quot;,X,__FILE__,X,M,fflush(0)))),k)😛(M,A(rm -f .%s*),M),*R)));
}



😀

It messes up the layout 🙁
 
everyone has a different style of coding


it normal to not understand someone elses code by looking at it once if his style of coding is very very diff from what you are used to , so i wouldnt be too worried

if you take WAYYY too long to figure out then i'd say you should try and improve your basics

but if you need to go over some small but seemingly confusing piece of code 2-3 times to understand it i wouldnt be too worried


if your basics are clear you should be fine
 
Back
Top