What are the best learning practices to learn programming? - Page 2 - MacRumors Forums
Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Jul 25, 2013, 02:27 AM   #26
mrfrosty
macrumors 6502
 
Join Date: Oct 2005
Quote:
Originally Posted by ArtOfWarfare View Post
... 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 !
__________________
MrFrosty
mrfrosty is offline   0 Reply With Quote
Old Jul 25, 2013, 05:09 AM   #27
ArtOfWarfare
macrumors 603
 
ArtOfWarfare's Avatar
 
Join Date: Nov 2007
Send a message via Skype™ to ArtOfWarfare
Quote:
Originally Posted by mrfrosty View Post
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.
__________________
Battery Status - On the Mac App Store
The only app that'll estimate when your wireless devices will need their batteries changed.
Including the ones paired with other Macs on your network.
ArtOfWarfare is offline   0 Reply With Quote
Old Jul 25, 2013, 11:34 AM   #28
musique
macrumors regular
 
Join Date: Apr 2009
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.
musique is offline   0 Reply With Quote
Old Jul 25, 2013, 11:58 AM   #29
lee1210
macrumors 68040
 
lee1210's Avatar
 
Join Date: Jan 2005
Location: Dallas, TX
Quote:
Originally Posted by musique View Post
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
lee1210 is online now   0 Reply With Quote
Old Jul 25, 2013, 12:09 PM   #30
subsonix
macrumors 68030
 
Join Date: Feb 2008
Quote:
Originally Posted by musique View Post
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.
subsonix is offline   0 Reply With Quote
Old Jul 26, 2013, 09:30 AM   #31
musique
macrumors regular
 
Join Date: Apr 2009
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.
musique is offline   0 Reply With Quote
Old Jul 26, 2013, 11:38 AM   #32
960design
macrumors 6502a
 
Join Date: Apr 2012
Location: 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.
__________________
TI-99/4A, tape cassette, 12" B&W Zenith
960design is offline   0 Reply With Quote
Old Jul 26, 2013, 11:54 AM   #33
ArtOfWarfare
macrumors 603
 
ArtOfWarfare's Avatar
 
Join Date: Nov 2007
Send a message via Skype™ to ArtOfWarfare
Quote:
Originally Posted by 960design View Post
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.
__________________
Battery Status - On the Mac App Store
The only app that'll estimate when your wireless devices will need their batteries changed.
Including the ones paired with other Macs on your network.
ArtOfWarfare is offline   0 Reply With Quote
Old Jul 26, 2013, 12:29 PM   #34
robvas
macrumors 68000
 
Join Date: Mar 2009
Location: USA
Depends on what you mean by 'knowing' a language.
robvas is offline   0 Reply With Quote
Old Jul 26, 2013, 02:29 PM   #35
firewood
macrumors 603
 
Join Date: Jul 2003
Location: Silicon Valley
Quote:
Originally Posted by musique View Post
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.
firewood is offline   1 Reply With Quote
Old Jul 26, 2013, 10:16 PM   #36
ArtOfWarfare
macrumors 603
 
ArtOfWarfare's Avatar
 
Join Date: Nov 2007
Send a message via Skype™ to ArtOfWarfare
Quote:
Originally Posted by firewood View Post
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.)
__________________
Battery Status - On the Mac App Store
The only app that'll estimate when your wireless devices will need their batteries changed.
Including the ones paired with other Macs on your network.
ArtOfWarfare is offline   0 Reply With Quote
Old Jul 27, 2013, 06:45 AM   #37
Miguel Cunha
macrumors regular
 
Join Date: Sep 2012
Location: Braga, Portugal
What are the differences?

Quote:
Originally Posted by robvas View Post
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 by Miguel Cunha; Jul 27, 2013 at 06:53 AM. Reason: Incomplete post
Miguel Cunha is offline   0 Reply With Quote
Old Jul 27, 2013, 07:36 AM   #38
ArtOfWarfare
macrumors 603
 
ArtOfWarfare's Avatar
 
Join Date: Nov 2007
Send a message via Skype™ to ArtOfWarfare
Quote:
Originally Posted by Miguel Cunha View Post
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.
__________________
Battery Status - On the Mac App Store
The only app that'll estimate when your wireless devices will need their batteries changed.
Including the ones paired with other Macs on your network.
ArtOfWarfare is offline   0 Reply With Quote
Old Jul 27, 2013, 12:44 PM   #39
subsonix
macrumors 68030
 
Join Date: Feb 2008
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.
subsonix is offline   0 Reply With Quote
Old Jul 27, 2013, 02:20 PM   #40
firewood
macrumors 603
 
Join Date: Jul 2003
Location: Silicon Valley
Quote:
Originally Posted by Miguel Cunha View Post
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.
firewood is offline   0 Reply With Quote
Old Jul 27, 2013, 05:02 PM   #41
Mac_Max
macrumors 6502
 
Join Date: Mar 2004
Quote:
Originally Posted by ArtOfWarfare View Post
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)

Quote:
Originally Posted by firewood View Post
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...

Quote:
Originally Posted by ArtOfWarfare
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 by Mac_Max; Jul 27, 2013 at 05:12 PM.
Mac_Max is offline   0 Reply With Quote
Old Jul 29, 2013, 10:52 PM   #42
960design
macrumors 6502a
 
Join Date: Apr 2012
Location: Destin, FL
Quote:
Originally Posted by ArtOfWarfare View Post
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.
__________________
TI-99/4A, tape cassette, 12" B&W Zenith
960design is offline   0 Reply With Quote
Old Jul 30, 2013, 07:20 AM   #43
robvas
macrumors 68000
 
Join Date: Mar 2009
Location: 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.
robvas is offline   0 Reply With Quote
Old Jul 30, 2013, 10:48 AM   #44
PatrickCocoa
macrumors 6502a
 
Join Date: Dec 2008
I am Disappoint

Quote:
Originally Posted by PatrickCocoa View Post
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!
__________________
iMac 21.5", 3.06GHz, 4 GB, 2 TB HD.
iPod Touch 3G.
PatrickCocoa is offline   0 Reply With Quote
Old Jul 31, 2013, 01:25 AM   #45
tominco
macrumors newbie
 
Join Date: Mar 2008
Quote:
Originally Posted by PatrickCocoa View Post
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.
tominco is offline   0 Reply With Quote
Old Jul 31, 2013, 10:52 AM   #46
ArtOfWarfare
macrumors 603
 
ArtOfWarfare's Avatar
 
Join Date: Nov 2007
Send a message via Skype™ to ArtOfWarfare
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.
ArtOfWarfare is offline   0 Reply With Quote
Old Jul 31, 2013, 11:31 AM   #47
firewood
macrumors 603
 
Join Date: Jul 2003
Location: Silicon Valley
Quote:
Originally Posted by ArtOfWarfare View Post
I can't believe I haven't seen Smalltalk mentioned, yet.
Both Java and Objective C have been called ways of hiding Smalltalk behind a more familiar-to-coders C-like syntax.
firewood is offline   0 Reply With Quote
Old Aug 1, 2013, 12:11 AM   #48
samwich
macrumors regular
 
Join Date: Aug 2007
Quote:
Originally Posted by PatrickCocoa View Post
But in any case, you're way behind on the 101 languages target. Get to work!
Lua.

Depending on your learning style you may like www.codecademy.com for Python or Javascript.

Or http://c.learncodethehardway.org/ For C, Python, etc.
__________________
my portfolio
samwich is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Advice on learning programming harlanjmichael Mac Programming 10 Mar 13, 2014 01:02 PM
Good books for learning programming workflow? MorphingDragon Mac Programming 0 Mar 7, 2014 05:24 AM
LEARN NOW to make Learning Easier!! apps99 iPad Apps 7 Aug 5, 2013 03:53 PM
iOS7 Camera Enhancements & Best Programming Practices Menneisyys2 iPhone/iPad Programming 16 Jun 27, 2013 03:35 AM
Should I learn any other language before learning LUA? quantic iPhone/iPad Programming 6 Jun 27, 2013 01:09 AM

Forum Jump

All times are GMT -5. The time now is 10:12 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC