Page 1 of 1 [ 9 posts ] 

Albinoboy
Yellow-bellied Woodpecker
Yellow-bellied Woodpecker

User avatar

Joined: 5 Aug 2010
Age: 28
Gender: Male
Posts: 70
Location: Surrey, England

05 Oct 2010, 5:34 pm

Hiya,
While this sounds reasonably insane, I don't care!
I would like people to tell me where I can learn the following languages:

~ Machine Code (Didn't see that one coming did you?)
~ Java (And JavaScript)
~ C# (I can do C++ (and thus C, with a little tweaking))
~ Pascal
~ Assembly (Again, you didn't see that coming!)
And I'll think of more later... lol

The languages I can already do (and thus don't want you to list them!)
+ C++
+ C (I just tweak my C++ until the C compiler stops throwing errors at me)
+ Visual Basic (It Is A Horrible Language, Period.)
+ HTML (It's fun, My code is always XHTML 1 Strict)
+ CSS (Following on from HTML)
+ PHP (It's fun and easy)

Help me, pretty please :)



ruveyn
Veteran
Veteran

User avatar

Joined: 21 Sep 2008
Age: 87
Gender: Male
Posts: 31,502
Location: New Jersey

05 Oct 2010, 5:50 pm

Albinoboy wrote:
Hiya,
While this sounds reasonably insane, I don't care!
I would like people to tell me where I can learn the following languages:

~ Machine Code (Didn't see that one coming did you?)
~ Java (And JavaScript)
~ C# (I can do C++ (and thus C, with a little tweaking))
~ Pascal
~ Assembly (Again, you didn't see that coming!)
And I'll think of more later... lol

The languages I can already do (and thus don't want you to list them!)
+ C++
+ C (I just tweak my C++ until the C compiler stops throwing errors at me)
+ Visual Basic (It Is A Horrible Language, Period.)
+ HTML (It's fun, My code is always XHTML 1 Strict)
+ CSS (Following on from HTML)
+ PHP (It's fun and easy)

Help me, pretty please :)


The only reason I can see for learning assembly/machine language for a machine is to write device drivers and for very computationally heavy calculations when writing tight code might save significant time and computation cycles.

ruveyn



lau
Veteran
Veteran

User avatar

Joined: 17 Jun 2006
Age: 75
Gender: Male
Posts: 9,619
Location: Somerset UK

05 Oct 2010, 6:07 pm

ruveyn wrote:
...

The only reason I can see for learning assembly/machine language for a machine is to write device drivers and for very computationally heavy calculations when writing tight code might save significant time and computation cycles.

ruveyn

That was TWO reasons. :)

Also... for the fun of it.

Also... to gain understanding of what is actually happening under all that very high level code.

Also... in order to program very "small" devices: microcontrollers, etc.


_________________
"Striking up conversations with strangers is an autistic person's version of extreme sports." Kamran Nazeer


LordoftheMonkeys
Veteran
Veteran

User avatar

Joined: 15 Aug 2009
Age: 34
Gender: Male
Posts: 927
Location: A deep,dark hole in the ground

05 Oct 2010, 6:18 pm

Albinoboy wrote:
~ Machine Code (Didn't see that one coming did you?)


If you want to do programming close to the CPU, learn assembly language. It's basically machine code with mnemonics.

Albinoboy wrote:
~ Java (And JavaScript)


Javascript: The Definitive Guide - from O'Reilly Media
As for Java, I don't know.

Albinoboy wrote:
~ C# (I can do C++ (and thus C, with a little tweaking))


There is about as much similarity between C/C++ and C# as there is between dishwasher detergent and Easter Island. They are completely separate languages. C# is based on Java, not C. Anyway, I wouldn't recommend it. There is nothing C# can do that C++ can't. But try writing an OS or a CLI program in C#; it's next to impossible.

Albinoboy wrote:
~ Pascal


Might be a fun language to try out. It's a Wirth language, so it has a very distinctive syntax. It's not used much anymore, so it may be harder to find tutorials or documentation on it. If you want a Pascal compiler I think there's a free one from GNU (there is one listed in my Synaptic package manager in Debian).

Albinoboy wrote:
~ Assembly (Again, you didn't see that coming!)


I found some books on Amazon about assembly language, but they were all relatively expensive. I have one titled Assembly Language for Intel-based Computers, which I bought last January, though I haven't read it yet, so I don't know how helpful it is. The thing you have to realize about assembly, though, is that it's different for each CPU. If you want to program in assembly on both Intel and AMD computers, you will need to learn a separate language for each of them.

Albinoboy wrote:
+ Visual Basic (It Is A Horrible Language, Period.)


I agree with you on that one. I don't know what Microsoft was thinking when they made that language. "Hey, let's make a programming language that's easy for beginners, even if it means teaching them bad programming practices and utterly failing to prepare them for professional software development." Visual Basic is a .NET language, but so far I have yet to see a single piece of software come out of Microsoft that was written in VB. It's a totally worthless pile of $hit.


_________________
I don't want a good life. I want an interesting one.


Jookia
Velociraptor
Velociraptor

User avatar

Joined: 7 Jan 2007
Age: 28
Gender: Male
Posts: 410

05 Oct 2010, 7:29 pm

You want to use assembly? Good luck making portable applications. It's a gimmick right now, just use C and optimize your code to the point it's really fast.



Ancalagon
Veteran
Veteran

User avatar

Joined: 25 Dec 2007
Age: 45
Gender: Male
Posts: 2,302

05 Oct 2010, 9:11 pm

Albinoboy wrote:
~ Machine Code (Didn't see that one coming did you?)

It will help you understand how the machine does low-level stuff, and it will probably teach you to appreciate high-level languages, since they are so much easier to use. Knowing how things work at a lower level can help you understand a higher-level program's performance.

Definitely a language worth knowing, even if the dialect you study isn't used anywhere anymore and you never actually use it in practice.

There's a famous quote by somebody (too lazy to look up who right now) that says, 'A language that doesn't affect the way you think about programming isn't worth knowing.' Assembler will affect how you think about programming.

Quote:
~ Java (And JavaScript)
~ C# (I can do C++ (and thus C, with a little tweaking))

I don't know c#, but from what I've heard, it's a slightly cleaned up java.

Java and javascript are totally different languages.

Quote:
~ Pascal

Not a terrible language, but it probably won't teach you much that you don't already know. If you already know C relatively well, you should be able to pick up most of the syntax relatively quickly.

It was the second language I learned; BASIC was the first, so it was a great improvement on that.

Gcc has a pascal compiler (gpc).


_________________
"A dead thing can go with the stream, but only a living thing can go against it." --G. K. Chesterton


mcg
Veteran
Veteran

User avatar

Joined: 26 Jan 2010
Age: 34
Gender: Male
Posts: 538
Location: Sacramento

05 Oct 2010, 10:11 pm

LordoftheMonkeys wrote:
There is about as much similarity between C/C++ and C# as there is between dishwasher detergent and Easter Island. They are completely separate languages. C# is based on Java, not C. Anyway, I wouldn't recommend it. There is nothing C# can do that C++ can't. But try writing an OS or a CLI program in C#; it's next to impossible.

Writing a CLI hello world is the first chapter in most C# books. About as much similarity between C++ and C# as there is between dishwasher detergent and Easter Island? They're both statically typed, lexically scoped, compiled languages that support OOP. How much more similar can two languages get? Here's my post from a different thread explaining the differences:
mcg wrote:
C# doesn't have explicit pointers, having reference types instead. Also, there is no multiple inheritance, but it has these things called interfaces that are kind of like abstract classes, and you can make a class implement multiple interfaces. It is pretty similar to Java in both these respects. Other than that, C++ and C# have almost the exact same feature set (well actually C#'s has a lot of additional features, but you don't have to use them). If you know C++, C# can be learned in minutes.


LordoftheMonkeys wrote:
The thing you have to realize about assembly, though, is that it's different for each CPU. If you want to program in assembly on both Intel and AMD computers, you will need to learn a separate language for each of them.
Nope, an x86 is going to have the same instruction set whether it was manufactured by intel or amd. If they were different, then you would need to compile different binaries for each.

It is possible to write portable assembler apps for a specific platform (i.e. assembler code that can be linked and executed on both linux and windows x86 machines). Other platforms have different instruction sets, so there's no portability there, but 386 assembly is still a reasonable thing to learn, especially if you want to know how things like memory protection, paging, virtual to physical address translation, switches between kernel and user mode all work at the lowest level.

You can reverse engineer other people's software and modify it to strip out nasty copy protection or whatever. You can debug problems in code you don't have the source for.

The ultimate documentation for 386 assembly is the intel manuals: http://www.intel.com/products/processor/manuals/



TallyMan
Veteran
Veteran

User avatar

Joined: 30 Mar 2008
Gender: Male
Posts: 40,061

06 Oct 2010, 4:00 am

lau wrote:
ruveyn wrote:
...

The only reason I can see for learning assembly/machine language for a machine is to write device drivers and for very computationally heavy calculations when writing tight code might save significant time and computation cycles.

ruveyn

That was TWO reasons. :)

Also... for the fun of it.

Also... to gain understanding of what is actually happening under all that very high level code.

Also... in order to program very "small" devices: microcontrollers, etc.


Assembly definitely for the fun. I wrote a lot of assembly code for the 6502 processor (Commodore 64) many years ago. It isn't very forgiving when it goes wrong, basically a bug = crashed machine. But it is fascinating, especially when you write longish programs. The raw speed is incredible. It makes C seem like a bloated wart hog! :lol: especially if you can do certain arithmetic computations using clever custom techniques rather than using generic number crunching code.

Unfortunately nowadays assembly isn't very practical though, unless you are coding for specific devices as Lau mentions. Assembly is microprocessor and architecture specific.


_________________
I've left WP indefinitely.


StuartN
Veteran
Veteran

User avatar

Joined: 20 Jan 2010
Age: 60
Gender: Male
Posts: 1,569

06 Oct 2010, 4:48 am

Albinoboy wrote:
~ Machine Code (Didn't see that one coming did you?)
~ Assembly (Again, you didn't see that coming!)


I still have all my assembly code books (6502, Z80, 8086, 68000). I once had a summer job writing machine code (Z80) because the tight-fisted idiots could not see the value of paying for assembly language. Most large libraries are likely to have similar books, last checked out a couple of decades ago.

You can download xa65 or Z80asm to write 6502 and Z80 code and bin86 for more recent processors - there must be loads of free documentation with them. Gnusim8085 is supposed to be a visual assembler / simulator for the 8085.

And, of course, you can stick assembly code anywhere in gcc source code (http://www.ibiblio.org/gferg/ldp/GCC-In ... HOWTO.html), and machine code if you must. The source code for any tightly-written packages (device drivers or maths packages) should be useful study materials.