Computer Hope

Software => Computer programming => Topic started by: unlovedwarrior on July 28, 2006, 04:22:30 PM

Title: programming lang
Post by: unlovedwarrior on July 28, 2006, 04:22:30 PM
i dont know which lang to learn Java, Java 2, C, C++, C#

i want to make programs for like linux os
Title: Re: programming lang
Post by: soybean on August 02, 2006, 07:57:34 AM
"Java Java 2 C C++ C#".   Is that one language?  LOL   Ever user commas?
Title: Re: programming lang
Post by: unlovedwarrior on August 02, 2006, 08:03:06 AM
i barely swueezed through english.. but there different langs.
Title: Re: programming lang
Post by: Rob Pomeroy on August 03, 2006, 05:53:27 AM
For Linux, you should probably start with C.  Once you've got C sussed, you'd find the other procedural-based languages fairly easy to pick up.  C++ would be a bit more of a challenge - it is OO-based.
Title: Re: programming lang
Post by: Neil on August 03, 2006, 06:45:20 AM
Depends if you want to program for fun, or profession.

Blitz Basic is easier to learn and use than C, and Linux compatable.

http://www.blitzbasic.com/Products/_index_.php
Title: Re: programming lang
Post by: unlovedwarrior on August 03, 2006, 08:09:10 AM
Quote
C++ would be a bit more of a challenge - it is OO-based.

what do you mean 00-based?? :-?
Title: Re: programming lang
Post by: Neil on August 03, 2006, 09:22:28 AM
Object orrientated. Or whatever I can't spell.
Title: Re: programming lang
Post by: unlovedwarrior on August 03, 2006, 09:24:36 AM
oh ok.. i think im going to do programming for a hobby
Title: Re: programming lang
Post by: Neil on August 03, 2006, 09:31:53 AM
Do you have any programming experiance? And what is your particular reason for wanting to program for Linux (is that your OS)?
Title: Re: programming lang
Post by: unlovedwarrior on August 03, 2006, 09:35:36 AM
dont laugh but ive programmed in truebasic and thats pretty much it.. it is my os for my computer in my room and it will also be on my new macbook when i get it.. and couldnt i use c for in windows kinda?
Title: Re: programming lang
Post by: Rob Pomeroy on August 03, 2006, 12:58:57 PM
Any programming language is a good start.  I say C for Linux because it is the major programming language used for developing the operating system.  The great bulk of the kernel, drivers, libraries etc. are coded in C.  Some stuff is in C++.

I find object-oriented programming languages less intuitive than procedural languages, but that is very much a matter of training and personal preference.
Title: Re: programming lang
Post by: Neil on August 03, 2006, 01:00:18 PM
Quote
I find object-oriented programming languages less intuitive than procedural languages, but that is very much a matter of training and personal preference.

Does that mean you like it more or less? :P
Title: Re: programming lang
Post by: unlovedwarrior on August 03, 2006, 01:01:17 PM
whats the difference between the two?
Title: Re: programming lang
Post by: Rob Pomeroy on August 03, 2006, 03:56:13 PM
Quote
Does that mean you like it more or less? :P
Hah!  I'm too old, or dense, or both, to get on with OO.  Procedural languages harmonise better with the way I think - step by step, one thing at a time...

(No, I don't do parallelism and semaphores either...)
Title: Re: programming lang
Post by: unlovedwarrior on August 03, 2006, 03:58:02 PM
im still confused on the difference between the two  :-?
Title: Re: programming lang
Post by: Rob Pomeroy on August 03, 2006, 04:07:00 PM
Well procedural is mostly do this do that blah blah blah.

OO is all about objects.  X does this, X does that, X relates to Y in this way, etc.
Title: Re: programming lang
Post by: unlovedwarrior on August 03, 2006, 04:40:20 PM
oh kool thanks
Title: Re: programming lang
Post by: Neil on August 03, 2006, 05:25:14 PM
Procedural is easier to understand what's going on... OO is easier to make "windows" applications, meaning it has buttons and scroll bars and things. But it's rarely used for games.
Title: Re: programming lang
Post by: unlovedwarrior on August 03, 2006, 06:17:25 PM
i love this forum.... i learn new stuff daily ;D
Title: Re: programming lang
Post by: johnchain on August 03, 2006, 07:32:00 PM
Why is procedural seen as easier. Object Orientated programs are basically designed for simplicity.

Create and object->make it do something.

I think it is simpler in many cases. And I am not sure, but I think all OO languages are high level languages.

Learn C for linux and just in general. Good place to start and know how your computer works at the same time. They call it the "high low-level" language. Since it can touch parts of your hardware while being easy to read and understand.
Title: Re: programming lang
Post by: Rob Pomeroy on August 04, 2006, 04:20:11 AM
Quote
while being easy to read and understand.
Can you read and understand this?  ;)
#include <stdio.h>

main(t,_,a)
char *a;
{return!0<t?t<3?main(-79,-13,a+main(-87,1-_,
main(-86, 0, a+1 )+a)):1,t<_?main(t+1, _, a ):3,main ( -94, -27+t, a
)&&t == 2 ?_<13 ?main ( 2, _+1, "%s %d %d\n" ):9:16:t<0?t<-72?main(_,
t,"@n'+,#'/*{}w+/w#cdnr/+,{}r/*de}+,/*{*+,/w{%+,/w#q#n+,/#{l,+,/n{n+\
,/+#n+,/#;#q#n+,/+k#;*+,/'r :'d*'3,}{w+K w'K:'+}e#';dq#'l q#'+d'K#!/\
+k#;q#'r}eKK#}w'r}eKK{nl]'/#;#q#n'){)#}w'){){nl]'/+#n';d}rw' i;# ){n\
l]!/n{n#'; r{#w'r nc{nl]'/#{l,+'K {rw' iK{;[{nl]'/w#q#\
n'wk nw' iwk{KK{nl]!/w{%'l##w#' i; :{nl]'/*{q#'ld;r'}{nlwb!/*de}'c \
;;{nl'-{}rw]'/+,}##'*}#nc,',#nw]'/+kd'+e}+;\
#'rdq#w! nr'/ ') }+}{rl#'{n' ')# }'+}##(!!/")
:t<-50?_==*a ?putchar(a[31]):main(-65,_,a+1):main((*a == '/')+t,_,a\
+1 ):0<t?main ( 2, 2 , "%s"):*a=='/'||main(0,main(-61,*a, "!ek;dc \
i@bK'(q)-[w]*%n+r3#l,{}:\nuwloca-O;m .vpbks,fxntdCeghiry"),a+1);}

Compile and run if you're curious.  You'll be surprised at the results.
Title: Re: programming lang
Post by: panboy on August 04, 2006, 09:24:55 AM
Rob if your going to post Code , at least try to format it into Brain Usable Segments.

I could Go trough that and tell you what it would do.... But its a Mess why would you write it like that?
Title: Re: programming lang
Post by: ghostdog74 on August 04, 2006, 09:38:49 AM
it's for the purpose of code obfuscation
http://en.wikipedia.org/wiki/Obfuscated_code
Title: Re: programming lang
Post by: panboy on August 04, 2006, 09:57:50 AM
i kinda thought so.

But why would one use Obfuscated Code to show someone how complicated it is?

it doesn't show it's Real Difficulty

thats kinda like posting the contents of a compiled EXE and saying this is what OO looks like

Code: [Select]
MZ1     ! !     Ð                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         ËË€üu8<w4.ƒ>}  u
.€> tè& r
P.¡} ÄÄXƒÄÏ
Àu3Ûë      < u3À»­­Ï.ÿ.y PSQRVWŒÈŽØŽÀ¾€ ¿Š »š Yº° ÄÄX r.£} .Æ _^ZY[Xà       VCDEX.DLL VDDRegisterInit VDDDispatch ‡Û‡Û‡Û‡Û‡Ûÿÿÿÿ@È    MSCDEX00             ¸3Í!€ûtëP?€ÿ2tëH?´° Í/?û­­uë9?&Ž, ´IÍ!´5°/Í!.‰y .Œ{ º ´%°/Í!ºÐ ±ÓêƒÂ´1° Í!¸ LÍ!
Title: Re: programming lang
Post by: Neil on August 04, 2006, 11:36:47 AM
@John Chain, try making a chess game in OO. It's hard enough in procedural ;)

They are both designed for different needs.
Title: Re: programming lang
Post by: Rob Pomeroy on August 04, 2006, 01:42:55 PM
To be honest, I would have thought that a chess game would be the perfect candidate for OO code.  The elements of chess lend themselves readily to description as objects.  I would make an exception to my preference for procedural coding.
Title: Re: programming lang
Post by: ghostdog74 on August 04, 2006, 08:04:51 PM
Quote
i kinda thought so.
But why would one use Obfuscated Code to show someone how complicated it is?

like the wiki says, it has its uses.
http://en.wikipedia.org/wiki/Obfuscated_code#Uses_for_obfuscation

Title: Re: programming lang
Post by: Neil on August 05, 2006, 04:23:20 PM
How would OO be easier? What about the AI?
Title: Re: programming lang
Post by: Rob Pomeroy on August 06, 2006, 01:44:28 AM
class brain {

  brain
  {
    iq = 100;
    inebriation = 1;
    confidence = 10;
  }

  drink
  {
    this.inebriation++;
    this.iq -= 10;
    this.confidence++;
  }

  think
  {
    if (this.inebriation > 3 || this.iq < 50)
    {
      result = rand(0, 2000000);
    }

    // etc...
  }

}
Title: Re: programming lang
Post by: unlovedwarrior on August 06, 2006, 11:33:34 PM
im so confused