PDA

View Full Version : Learning Programming



jramshu
May 8th, 2011, 03:04 AM
I want to learn to code. I was thinking about C or C++. Years ago I started to learn C++, but work got in the way. I know a good bit about HTML and CSS, and realize they are far from what I would really like to learn. My goal is to be able to write my own little software, compile it, test it, etc.

Should I start with something like Perl or Python?

What do the experts on here recommend?

NovaAesa
May 8th, 2011, 03:15 AM
I would recommend reading the stickies in the Programming Talk section, they have lots of good advice. http://ubuntuforums.org/forumdisplay.php?f=39

aG93IGRvIGkgdWJ1bnR1Pw==
May 8th, 2011, 03:22 AM
If you want to learn coding, by all means stick to a single language, follow tutorials and try to make sense of other people's work.

If, however, you want to learn programming, go learn the theoretical foundations that can be applied to any language, grasp how computers translate your instructions into machine code, learn why you're using the algorithms you were told to in the tutorials, how they were derived and what they imply.

In other words, if you want to be a good programmer, forget online tutorials and go read your SICP and TAOCP.

Johnsie
May 8th, 2011, 03:22 AM
Start with something more basic and work your way up. Java or PHP would be a good start and there are plenty of courses available.

aG93IGRvIGkgdWJ1bnR1Pw==
May 8th, 2011, 03:26 AM
Start with something more basic and work your way up. Java or PHP would be a good start and there are plenty of courses available.

<insert condescending snort>

Thewhistlingwind
May 8th, 2011, 04:08 AM
<insert condescending snort>

+1. Python is fine. The problem with perl is that it's legendary for building programmers who accomplish everything with jedi mind tricks and clever hacks. Those things are necessary, but not necessarily a good thing.

(Basically, kind of like the argument in "BASIC considered harmful")

benc1213
May 8th, 2011, 04:13 AM
<insert condescending snort>

Whats wrong with learning java? Isn't it "better" than python?

danbuter
May 8th, 2011, 04:50 AM
Python is a "cool" language. Java is a language you learn if you want to make money programming.

akand074
May 8th, 2011, 04:51 AM
Yeah. People always bash Java. According to some statistics Java is the #1 used programming language in the world (even though it's not the best for most applications outside the web). It's also one of the easiest/best ones to learn for a beginner. Once you know Java inside and out you can learn any other language really easy. Then you can jump into scripting languages or whatever else you want to learn. I mean, there's always python and other languages too that are not bad to learn first, but I don't know why people bash Java so much for *beginners*.

Bandit
May 8th, 2011, 06:05 AM
Start with something more basic and work your way up. Java or PHP would be a good start and there are plenty of courses available.
Indeed..

I took both in college and they are excellent recommendations.
Java is great for cross platform programming, PHP is essential for server side scripting in the eCommerce market.

Thewhistlingwind
May 8th, 2011, 06:26 AM
Python is a "cool" language. Java is a language you learn if you want to make money programming.

This is arguable, but true enough. OP, what is the purpose exactly behind your learning? (Also, there have been many comparisons of programming languages to religions, the flame wars get that bad, you won't really receive a definitive answer.)

EDIT: It doesn't really matter where you start if you plan on learning most of them anyway.

TeoBigusGeekus
May 8th, 2011, 12:19 PM
Stay away from C++; you have been warned.

(C fanboy reporting...)

jramshu
May 8th, 2011, 01:16 PM
Thanks for all the replies. I see that this stuff is kinda like religion.

I want to learn the basics first, how the machine interprets what you want it to do. The reason I was thinking C, and I may be wrong, is because most books I have looked at seem to refer back to C is some form or another.

I am also very interested in being able to contribute to others peoples projects in the open source community. I am not after monetary gain or even recognition, just would like to be able to open source code and help make it better, fix bugs, fix vulnerabilities, etc. But it looks like a lot of it is written in various different languages. Which I guess means starting from the basics, surely all have a common language, or am I wrong on that?

I'm not that old, 39, and my job for the past few years only requires me to work a few hours a night, and a lot of times just a few hours a week. I have a ton of time on my hands and I am away from home a lot. For those interested, I'm an electrician, licensed. I specialize in refrigeration electrical, low and line voltage controls, install and troubleshooting energy management systems(regardless of manufacturer ex. Novar, Danfoss, CPC, ADM Micro, Honeywell, Lennox and a few others), setup and repair variable speed drives that control compressors and condensing units. Most of this stuff is going, what they are calling, open source. Have you seen what air conditioners are starting to look like these days? Lennox has a massive onboard computer running it.

Good example on where I may begin is what aG93IGRvIGkgdWJ1bnR1Pw== said here.


grasp how computers translate your instructions into machine code, learn why you're using the algorithms you were told to in the tutorials, how they were derived and what they imply.


I really appreciate all the input here. I don't want to start a "war" over the different languages, since they all interest me.

I still would like to keep getting the input, and some recommendations on which books to start looking for. The ones that you guys learned from.

Thanks to all.

aG93IGRvIGkgdWJ1bnR1Pw==
May 8th, 2011, 01:49 PM
I still would like to keep getting the input, and some recommendations on which books to start looking for. The ones that you guys learned from.

Thanks to all.


Structure and Interpretation of Computer Programs (SICP) (http://en.wikipedia.org/wiki/Structure_and_Interpretation_of_Computer_Programs)

The Art Of Computer Programming (TAOCP) (http://en.wikipedia.org/wiki/TAOCP)

That is all.

P1C0
May 8th, 2011, 01:51 PM
I still would like to keep getting the input, and some recommendations on which books to start looking for. The ones that you guys learned from.

Thanks to all.
http://en.wikipedia.org/wiki/The_C_Programming_Language

TeoBigusGeekus
May 8th, 2011, 09:00 PM
http://en.wikipedia.org/wiki/The_C_Programming_Language

A bit too difficult for a beginner patrioti. This should be read after you've learnt C.

I recommend this: http://www.amazon.com/Programming-Approach-K-N-King/dp/0393969452

benc1213
May 8th, 2011, 09:15 PM
What would be the best language to start learning? I am 15 and am really motivated to learn a language I somewhat started java but I am not sure if I should learn c++ or c but I heard c isn't a good first language because it isn't oop. Is c a good first language?

TeoBigusGeekus
May 8th, 2011, 09:20 PM
What would be the best language to start learning? I am 15 and am really motivated to learn a language I somewhat started java but I am not sure if I should learn c++ or c but I heard c isn't a good first language because it isn't oop. Is c a good first language?

Every language is good for first language.
It depends on your iq and the amount of time you want to give to it.
C++ is an overestimated chaos that needs 2 or 3 lifetimes to be mastered.
C is my favourite, it can do anything you like, faster than anything else.
If you necessarily want to learn OOP, you can start with python.

benc1213
May 8th, 2011, 10:00 PM
I would say I am pretty smart for my age. I just heard that its best to learn oop in the begining but I am not sure if that is true or not. The only reason I am curious about learning c over a language such as java is because it would be fun to contribute to the linux community.

Shining Arcanine
May 8th, 2011, 10:04 PM
I want to learn to code. I was thinking about C or C++. Years ago I started to learn C++, but work got in the way. I know a good bit about HTML and CSS, and realize they are far from what I would really like to learn. My goal is to be able to write my own little software, compile it, test it, etc.

Should I start with something like Perl or Python?

What do the experts on here recommend?

Neither. Perl and Python are interpreted, not compiled. If you want a compiled language, I suggest you learn C.

P1C0
May 8th, 2011, 10:48 PM
A bit too difficult for a beginner patrioti. This should be read after you've learnt C.

I recommend this: http://www.amazon.com/Programming-Approach-K-N-King/dp/0393969452May be, but I think if you read it concetrated and patiently and try to code all the examples in the book by yourself, you will have a solid grasp of C. Then, you can read it again, and again, or consult it whenever it is needed.

It was not my first C book unfortunately, this was my first (made me even forget the little programming I learned in high school - avoid like the plague):
http://www.icsd.aegean.gr/lecturers/stamatatos/courses/logismiko/misirlis.jpg

TeoBigusGeekus
May 8th, 2011, 11:01 PM
It was not my first C book unfortunately, this was my first (made me even forget the little programming I learned in high school - avoid like the plague):

Was it a personal choice, or was it forced on you by school/uni?
...Cause, learning C by a Greek writer - what where you thinking mate?

P1C0
May 8th, 2011, 11:24 PM
Was it a personal choice, or was it forced on you by school/uni?
...Cause, learning C by a Greek writer - what where you thinking mate?Forced by the uni..

TeoBigusGeekus
May 8th, 2011, 11:25 PM
Forced by the uni..

...say no more...

Johnsie
May 9th, 2011, 12:30 AM
<insert condescending snort>

I did Java at university and knew Perl and PHP before that. I switched from Perl to PHP because PHP performed faster on the server I was using at the time. I am now a full time programmer working for one of the biggest companies in my country. I get a good wage and freedom to experiment with computers and software whenever I want... Snort all you like, but without knowing those languages I would not have been able to get that job :-)

aG93IGRvIGkgdWJ1bnR1Pw==
May 9th, 2011, 01:04 AM
So you basically admit you learned that abortion of a language to ***** yourself out? Call me a hopeless idealist, but that's a new low I'd never drop to.

benc1213
May 9th, 2011, 01:56 AM
So you basically admit you learned that abortion of a language to ***** yourself out? Call me a hopeless idealist, but that's a new low I'd never drop to.

What are you talking about java or c? And what one should I learn first and probably stick with for a while?

linuxforartists
May 9th, 2011, 03:47 AM
I think your best bet is to decide on a problem you want to solve, or think of something you'd like to create. Then choose the best language for that. Your passion will help you overcome the stumbling blocks.

On a related track, you could look at an open-source project you'd like to get more involved in. Then pick a language accordingly. For example, I love WordPress, so learning PHP would help a lot.

Here's a relevant discussion thread from another forum I frequent: Knowing is Half the Battle (http://www.techhui.com/profiles/blogs/knowing-is-half-the-battle). It talks about the overflow of languages and frameworks out there, and trying to find the right path. Good luck!

benc1213
May 9th, 2011, 04:32 AM
I want to make programs and maybe games but I also want to do some stuff with linux/unix. What would be the best first language to learn?

danbuter
May 9th, 2011, 04:47 AM
jramshu, if you want to mainly contribute to Linux development, C, C++, and Python are used a lot, and are all good choices. Python is the easiest to learn. C should be your second language. You'd likely use both.

jramshu
May 9th, 2011, 05:13 PM
Been reading through all the posts, thanks for all the replies.

I'm starting to read through some of the tutorials to help get a better grasp of the basics. It sure seems to have changed quite a bit from the days as a youngster pecking away all night in front of my Commodore 64.

I think that my ultimate goal may have been too vast to handle at one time.

I was at the bookstore Saturday and ran across the C Programming Language book mentioned on here by P1CO, $67 new, It looks like I'll be getting a used book, lol!

All you guys advice is taken to heart and I can't wait to jump in to a new language.

Thanks much.

Please feel free to keep any advice rolling this way. I'm sure there are plenty more guys like me that are curious to what you guys think.

ErikNJ
May 9th, 2011, 05:51 PM
I like the idea of starting with Java (even though it's not too popular for application development on the Linux desktop). The reasons for Java are that it's syntax is in the "C style" but it is object oriented without the nasty bits of C++. With Java, you can learn both functional type programming and OOP in the same language.

I don't think it's good for a beginner (myself included) to be tied up in syntax. It's more important to focus on solving problems with code. To that effect, I'd suggest after getting your start with some of the basic of programming, focus on the studies of data structures, algorithms, and mathematics.

Also, think about studying some low-level language too. Learning some assembly and understanding computer architecture can take you a long way - it even helps with better understand the high-level languages like C (in fact, it's easy to see why C was created and how it organizes the ideas from assembler). You may also want to dig into some of the basic elements of a computer - things like flip-flops, adders, etc.

Anyway, if the question is just about which languages to learn, I'd suggest Java and learn about OOP. Then I'd suggest some form of assembly to understand how the machine works. Once you have a broad view of software from higher-levels and lower-levels, you can start thinking about where you'd like to focus you efforts.

miguel.guasch
September 9th, 2011, 10:47 AM
I want to learn to code. I was thinking about C or C++. Years ago I started to learn C++, but work got in the way. I know a good bit about HTML and CSS, and realize they are far from what I would really like to learn. My goal is to be able to write my own little software, compile it, test it, etc.

Should I start with something like Perl or Python?

What do the experts on here recommend?


www.learnpythonthehardway.org

mmsmc
September 9th, 2011, 10:54 AM
well, in my personal view i think java is the best choice, i great with java, good with python(since they're not much different), i personally am not going for any other languages for the time being, because with java, you can create just about anything you could possibly think of, and have not hit a limit yet