Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

mrfrosty

macrumors 6502a
Oct 1, 2005
500
21
... you named all of the useless majors that are set up for people who didn't get what they were supposed to out of their free high school education, so they blew huge amounts of money at university for a redo.

The real majors are the ones that build off of what was taught in high school rather than repeat it, IE, engineering, science, medical, math, and business majors.

Your school didn't teach Art, History and English ? That's a strange school system. I can't imagine that it produces well rounded individuals ready for society !
 

ArtOfWarfare

macrumors G3
Nov 26, 2007
9,544
6,042
Your school didn't teach Art, History and English ? That's a strange school system. I can't imagine that it produces well rounded individuals ready for society !

Where do you get that from? I took US History, US Government, Eastern Asian Studies, English Language and Composition, and numerous other history and English classes that I can't recall the exact names of in high school. I didn't waste my money retaking those classes in university - the only class like that that I took in university was a journalism class called "Interpreting the Day's News". My university had plenty of other classes in those departments. It also had algebra, geometry, trig, and calculus. I didn't bother taking any of them because I'd already done so in high school. Instead I took the more advanced classes that weren't offered in high school - diff eq., discrete math, digital logic, computer architecture, electronics, computer optimization, database management, etc.
 

musique

macrumors regular
Apr 10, 2009
222
5
Where to go for occasional assistance

Ladies and Gentlemen, I'd like to return to the OP's question because I'm in a similar situation. I programmed many years ago in assembler, Fortran, BASIC, COBOL, and a few other languages. I'm currently teaching myself C using some of the books and sites referenced here as well as a few others.

One poster mentioned going to other coders to see how they code and to ask questions when there's just some hurdle preventing you from getting to the next level. I have always found that helpful when doing almost anything with systems.

Can you recommend one or more sites to ask these kinds of "stopping you dead in your tracks" questions? For example, one source tells me to use the command "cc" to compile my program (written using BBEdit) from the command line. Another tells me to use "gcc." Both seem to work and both create a new copy of a.out. However, when I try to run a.out I get "-bash: a.out: command not found." I'm sure it's an extremely simple problem, but I don't know what I'm doing wrong.

Where would one go to ask questions? Thanks.
 

lee1210

macrumors 68040
Jan 10, 2005
3,182
3
Dallas, TX
Ladies and Gentlemen, I'd like to return to the OP's question because I'm in a similar situation. I programmed many years ago in assembler, Fortran, BASIC, COBOL, and a few other languages. I'm currently teaching myself C using some of the books and sites referenced here as well as a few others.

One poster mentioned going to other coders to see how they code and to ask questions when there's just some hurdle preventing you from getting to the next level. I have always found that helpful when doing almost anything with systems.

Can you recommend one or more sites to ask these kinds of "stopping you dead in your tracks" questions? For example, one source tells me to use the command "cc" to compile my program (written using BBEdit) from the command line. Another tells me to use "gcc." Both seem to work and both create a new copy of a.out. However, when I try to run a.out I get "-bash: a.out: command not found." I'm sure it's an extremely simple problem, but I don't know what I'm doing wrong.

Where would one go to ask questions? Thanks.

Right here! We're happy to help.

cc is likely aliased to gcc. gcc is a GNU replacement for the original cc. To run your program run:
./a.out
The issue is that the current directory is not on your PATH, and it shouldn't be.

-Lee
 

subsonix

macrumors 68040
Feb 2, 2008
3,551
79
Can you recommend one or more sites to ask these kinds of "stopping you dead in your tracks" questions? For example, one source tells me to use the command "cc" to compile my program (written using BBEdit) from the command line. Another tells me to use "gcc." Both seem to work and both create a new copy of a.out. However, when I try to run a.out I get "-bash: a.out: command not found." I'm sure it's an extremely simple problem, but I don't know what I'm doing wrong.

Where would one go to ask questions? Thanks.

CC on mac OS is just a hard link to GCC, or Clang (I think) depending on what version of OS X you use. On Snow Leopard you get this:

Code:
lrwxr-xr-x  1 root  wheel  32 10 Jul  2011 /usr/bin/cc -> ../llvm-gcc-4.2/bin/llvm-gcc-4.2

Which is not regular GCC actually but the GCC front end with LLVM code generation.

I would explicitly go with Clang personally since GCC is mostly left for compatibility reasons on OS X these days AFAIK. CC is short for C Compiler and GCC, GNU C Compiler basically signifying a free software version of the C Compiler. The hard link is probably there to make sure invocations to CC will "just work" for historical and compatibility reasons.

The reason you get "-bash: a.out: command not found." is that you need to refer to the current directory, ie use: ./a.out , that gives an absolute path to the command you are trying to invoke, without it bash will look at your PATH variable (basically system directories with binaries), it will not find a.out there, which is why you get the error.
 

musique

macrumors regular
Apr 10, 2009
222
5
Perfect

Thanks to both of you. Things worked just as you said. (I am on Mountain Lion, BTW.)

When I do a "man gcc" I get a pretty helpful screen (actually quite a few of them) explaining what it is and its options. Very helpful stuff.

Again, thanks. I'll take you up on your offer and will be back with more questions as they arise. :)
 

960design

macrumors 68040
Apr 17, 2012
3,691
1,548
Destin, FL
Just think of learning a programming language like learning any other communication language: French, Chinese, Korean, Spanish, German, ect.

It will take you a couple of days to figure out how to say hi, by and thanks. It will take you months to learn how to order from a menu, ask for directions.

It will take you years to write a novel in a new language.

The fastest way to learn a language is not from a book ( although it is a fantastic place to start ). The best way is to immerse yourself in the language. If you want to learn Urdu you travel to Pakistan or India.

The best way to learn a programming language is to go to the programmers and ask if you can help. Find a local club, or create one.

It is a perishable skill. At one point I knew more than 12 programming languages, I can only say I'm proficient in 3 now. The good thing is that like riding a bike, it doesn't take too long to pick it back up.

Good luck, study hard, write code every single day.
 

ArtOfWarfare

macrumors G3
Nov 26, 2007
9,544
6,042
It is a perishable skill. At one point I knew more than 12 programming languages, I can only say I'm proficient in 3 now. The good thing is that like riding a bike, it doesn't take too long to pick it back up.

I'm feeling skeptical of that. Given how rapidly I can learn additional languages at this point (at this point, I can learn a new language in about 3 days,) I feel like as long as I'm using just a few languages, I won't forget how to use all the others.

Maybe not. Right now I'd say I'm proficient in C++, Java, Obj-C, C, JavaScript, and Python. Maybe when I learn more I'll start forgetting some of those.
 

firewood

macrumors G3
Jul 29, 2003
8,107
1,343
Silicon Valley
Can you recommend one or more sites to ask these kinds of "stopping you dead in your tracks" questions?
...
Where would one go to ask questions?

For questions not locked to a specific support topic (for instance NDA beta questions for Apple's dev forums), stackoverflow.com currently seems to be the most used and often best source for answers (although you have to filter out dumb answers from game addicts trying to earn rep points). Stackoverflow often has betters answers than a particular software products own official support forums.

You can also learn tons by researching enough to answer some questions on SO.
 

ArtOfWarfare

macrumors G3
Nov 26, 2007
9,544
6,042
For questions not locked to a specific support topic (for instance NDA beta questions for Apple's dev forums), stackoverflow.com currently seems to be the most used and often best source for answers (although you have to filter out dumb answers from game addicts trying to earn rep points). Stackoverflow often has betters answers than a particular software products own official support forums.

You can also learn tons by researching enough to answer some questions on SO.

I agree. The entire stack exchange network is actually pretty great - I use both Super User and Stack Overflow, depending on my specific question (IE, I often find SU has people more familiar with scripting languages than SO.)
 

Miguel Cunha

macrumors 6502
Sep 14, 2012
387
102
Braga, Portugal
What are the differences?

If we're suggesting first languages, I'd pick JavaScript (Not Java, big difference) or Python :)

Hello, rovbas.

You post made me wonder about my decision of learning Java.

I've heard of JavaScript, but I don'know the differences between the two languages, nor the best reference material to start from.
Could you give some directions on this and also explain what are the differences and the reason to start with JavaScript instead of Java?

About Python, I've heard about it as well. Could you tell me more?
There are so many languages that to tell one from another to make a choice is difficult.

Finally, how would you (or anybody in this thread) rate the book mentioned in the OP? There are also many books on the same language and bad choices are not a option.

Thank you.
 
Last edited:

ArtOfWarfare

macrumors G3
Nov 26, 2007
9,544
6,042
Hello, rovbas.

You post made me wonder about my decision of learning Java.

I've heard of JavaScript, but I don'know the differences between the two languages, nor the best reference material to start from.
Could you give some directions on this and also explain what are the differences and the reason to start with JavaScript instead of Java?

About Python, I've heard about it as well. Could you tell me more?
There are so many languages that to tell one from another to make a choice is difficult.

Finally, how would you (or anybody in this thread) rate the book mentioned in the OP? There are also many books on the same language and bad choices are not a option.

Thank you.

All 3 languages are object oriented.
JavaScript and Java are both C based, although totally unrelated. There are so many languages in existence that you can basically google "The (anything) Programming Language" and you'll find someone has made a language with that name. The part that's unusual isn't just how similar their names are, but how similar their names are AND both are actually used and fairly popular.

Java code is compiled into Java Byte Code (JBC) files, called .jar, which a Java Virtual Machine (JVM). Java is the language used to program Android devices. It can also run on any computer with a JVM, so I like using the language if I want my code to run on any computer.

JavaScript and Python are both dynamic, non-type safe languages that aren't usually compiled, but instead interpreted. JavaScript is most known as the standard web language that all browsers, whether desktop or mobile, or IE or any other browser, supports, without any plugins at all.

Python... I guess is mostly used to write scripts? IDK - I think it was originally created with the intent of being easy to learn but I'm finding that its insistence on having types, but never mentioning what they are, to be very obnoxious when trying to debug... Maybe that's just because I'm not using an IDE (anyone have suggestions for a good one for Python?)

Oh, probably something that I should mention about compiled vs. interpreted languages. Compiled languages are languages that need their files to be converted ("compiled") from code that programmers can easily understand, to a language that the computer can easily understand. This generally means the code runs faster than interpreted languages, where the code is always human readable, meaning the computer needs to both figure out what the code means, and then do it, when running the program. As the years have gone by, computers have come to be so fast that it's rare you'll notice a difference in performance between compiled and interpreted languages.
 

subsonix

macrumors 68040
Feb 2, 2008
3,551
79
Do not pick JavaScript unless you are planning on doing web related stuff, it's very domain specific and has lots of warts. If you want to go for a scripting language pick something like Python or Ruby.
 

firewood

macrumors G3
Jul 29, 2003
8,107
1,343
Silicon Valley
I've heard of JavaScript, but I don't know the differences between the two languages...

The great advantage of Javascript is almost every device and computer comes with Javascript built-in and ready to run... inside any modern web browser. Doesn't require any compilers, plug-ins, IDEs, etc. Just type Javascript code anywhere you can get your browser to load (local text file, dropbox, etc.), and immediately see the results (text on a web page, colored boxes on a canvas, etc.) Lots of tutorial/educational material on the web targeted at kids and non-STEM majors.

Javascript is also a forgiving (can't deref null pointers, etc.) and Turing-complete language. The basic thing you will have to learn when moving from Javascript to Objective C is that Javascript is too forgiving and has too much built-in, and you will have to learn a lot more about data types, memory management, linking frameworks, & etc.
 

Mac_Max

macrumors 6502
Mar 8, 2004
404
1
I disagree. The following languages will be suggested by several people:

C
Obj-C
Python
Java

A handful of people will suggest another ~5 languages (LOGO, BASIC, JS, C++, Scratch) but they'll be outliers.
....

You forgot:

Ruby,
Go,
Perl,
C#,
VB.net,
...

Haha and the list goes on and on.

That said, I agree, if you're enjoying the Objective C book stick with that for now. Later on if you feel like doing backed web dev, Ruby is another message passing language that should offer a degree of familiarity.

My own path was Java/C++ (School) -> C# (First job) -> Perl/Objective C (Subsequent work)

The best learn-to-program books for complete non-programmers seem to be on Python, Javascript and maybe Java. Also kids books on Scratch, Squeak, and Alice. Out-of-print books on Basic and Logo. The authors of C/C++ and Objective C books appear to have never taught an beginning programming class for high school A.P. or incoming freshman history/english/art/etc. majors (e.g. typical *real* people, not math-nerds/nerd-wannabe's).

Funny texts on Computer Science might require some background in Computer Science...

ArtOfWarfare said:
I'm feeling skeptical of that. Given how rapidly I can learn additional languages at this point (at this point, I can learn a new language in about 3 days,) I feel like as long as I'm using just a few languages, I won't forget how to use all the others.

I think it depends on the language and individual (how good is your long term memory? haha). I let C# go for a year and change and picked it back up in two days. I also taught myself all the fun async stuff I missed as my job was suck on .Net 3.5.

Where I have a bigger issue is Perl. I learned "Modern Perl" which basically rejects all the terrible practices of the 90s. I can barely read Perl from the 90s (<insert Perl joke>) let alone understand what the script/program is doing. A lot of people from back then wouldn't be able to get a job where I work unless they kept up with developments in the language and community over the past couple years (a couple have tried and been passed on). I feel like C++11 will cause a similar divide for that community but I'm not certain.
 
Last edited:

960design

macrumors 68040
Apr 17, 2012
3,691
1,548
Destin, FL
I'm feeling skeptical of that. Given how rapidly I can learn additional languages at this point (at this point, I can learn a new language in about 3 days,) I feel like as long as I'm using just a few languages, I won't forget how to use all the others.

Maybe not. Right now I'd say I'm proficient in C++, Java, Obj-C, C, JavaScript, and Python. Maybe when I learn more I'll start forgetting some of those.

You shouldn't feel skeptical at all, you should be proud of your superior abilities. I haven't written assembly in over 20 years. I would not take a job writing code for TIMU based applications for DARPA right now. Ahh, the days of hacking satellite receivers so many years ago. Good times, good times.
 

robvas

macrumors 68040
Mar 29, 2009
3,240
629
USA
There was an article a week or two ago that was posted on various blogs and news sites about writing a Scheme compiler in C - you might want to check that out for fun.
 

PatrickCocoa

macrumors 6502a
Dec 2, 2008
751
149
I am Disappoint

I'll pop back in once the reply count hits 100.

At that point there will be 100 replies and 101 suggested starting languages.

Guys, you're not pulling your weight. Here are the languages mentioned so far:

Objective-C
Java
C
Python
LOGO
BASIC
C++
Scratch
JavaScript
Python
Squeak
Alice
assembler
Fortran
COBOL,
Ruby,
Go,
Perl,
C#,
VB.net,
Scheme

Note that not all of these were recommended. In fact, some were anti-recommended.

But in any case, you're way behind on the 101 languages target. Get to work!
 

tominco

macrumors member
Mar 14, 2008
94
86
Guys, you're not pulling your weight. Here are the languages mentioned so far:

Objective-C
Java
C
...
Scheme

Note that not all of these were recommended. In fact, some were anti-recommended.

But in any case, you're way behind on the 101 languages target. Get to work!

Ahhh. this brings back memories.... I'll add a few new ones (or rather some very old) to your list that I've used or played with at one time or another in the last 39 years since I started programming....

LISP
Prolog
Snobol
Pascal
PL/I
APL
Ada
Awk
Matlab
LabView (Lego NXT)
a bunch of different assemblers all with their own quirks.

And how about the classic old Turing machine from an Intro to Comp Sci class. Do they still teach that? Or am I dating myself?

Now days, I do most of my "programming" in Verilog (ok an HDL, but really it's a glorified programming language) and Perl (cheap and quick), with various C dialects as well. I still really like the power, yet simplicity of C.

As to the original comment, I have to agree with other comments. Pick one language and use it. Come up with something you want to do and develop that into an application. Stick with your Objective C and later spread out to something else (Java, Ruby, Python, another C variant) depending upon what your needs are... Then do the same thing, only this time it will go much faster than before, as you will have already learned the concepts of programming and you're just learning new features, quirks and syntax.
 

ArtOfWarfare

macrumors G3
Nov 26, 2007
9,544
6,042
I can't believe I haven't seen Smalltalk mentioned, yet. Not a language I'd suggest you learn for using, but just because it has so many interesting concepts.

Other languages not worth learning for using, but sometimes hilarious to learn about, are esolanguages, such as brainf*** (the name ends in profanity), COW, and Whitespace.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.