Jump to content
Objectivism Online Forum
Sign in to follow this  
thinkingfighter

How To Go About Programming

Rate this topic

Recommended Posts

First of all I would like to welcome and hail the programmers reading this. I have an enormous amount of respect for you and consider you the new architects of a wondrous and powerful new chapter in our history. The things you create are the foundation for the new frontier of a computerized world. That being said I have an interest in learning how to program and was wondering if anyone could point me in a direction to pursue.

Edited by softwareNerd

Share this post


Link to post
Share on other sites

A few questions:

  1. Do you have any understanding of programming? From your post, I assume the answer is "no", but I thought I'd double-check.
  2. What does "programming" mean to you, at your current state of knowledge?
  3. Why do you want to learn programming? Is it so that you can program something? Or, is it more in the nature of doing simple programming so that you can better appreciate what programming is all about?

And, all hail to thee too!

Share this post


Link to post
Share on other sites

I am a student programmer myself, one whom has always had a great deal of respect for other competent programmers who prove themselves through the excellence of their programs. Having said that I expect that I should have to earn your respect as a[student] programmer...

I would be happy to help you as much as I can, I enjoy teaching others what I know about programming, it helps me more fully understand what I have learnt, and I like it when someone goes "Eureka! Finally I understand" and goes on to do good work. I have not had much expereince at this so far of course, but i am told I am adequate at it.

Now, obviously you are going to want to start of with the basics, the concepts underlaying all of programming in this day and age. But which programming languages [if any] do you have a particular interest in? I would suggest learning C, then C++, as a bare minimum, but you would be best off learning Java, VB, and many others as well. Qt, which is based on C++, would be a good choice for cross-platform development.

I have started a seriestutorial files on C programming, part one should be done later today. it covers the basic concepts underpinning programming in many languages. You might want to read that, as I think it would be of some use to you, and others have commented that it is reasonably informative.

You could also try some of these links:

C Programming

C++ tutorial, but I suggest learning some C programming first

Edited by Prometheus98876

Share this post


Link to post
Share on other sites

The book that I found very useful, when I was a programming newbie, was SAM's Teach Yourself C in 21 Days. It starts with the basics, and builds on that foundation to give you a comprehensive understanding of C. Once you master C, I'd suggest getting Teach Yourself C++ in 21 days, followed by MFC Programming from the Ground Up which will teach you enough to be able to venture into Windows Programming.

In my opinion that's the best way to go about things C, then C++, and finally MFC.

Share this post


Link to post
Share on other sites

To throw in a different opinion: I really don't think learning C is the best way to start off programming. C is a fairly low level language and you'll have enough problems learning the syntax and logic of a program to have to worry about what's going on with the hardware.

I recommend Python, it's a gentle introduction to what programming is all about. You can find tutorials and all the information you'll need here http://www.python.org/doc/Intros.html

C++ wouldn't be too bad of a start. My first textbook was Structured & Object-Oriented Problem Solving Using C++. I found the writing very clear and the author describes each concept very thoroughly. You may be able to find it at http://www.cheapesttextbooks.com/ or one of the various other college text book sites. Another pro of the book is that it comes with Visual C++: all the programs to code and compile a program.

But even before that you may want to go out and buy the book Programming Logic and Design by Joyce Farrell. Learning a language (for the most part) should not be an incredibly difficult task although there are exceptions. It's all about algorithms. The language comes second. If you really want to get inside the head of a programmer, read the aforementioned book and do some of the problems at the end of the chapter. You'll find that while you never actually 'code' anything, your creating the logic that can be coded using any language.

Edited by Michelangelo

Share this post


Link to post
Share on other sites
To throw in a different opinion: I really don't think learning C is the best way to start off programming. C is a fairly low level language and you'll have enough problems learning the syntax and logic of a program to have to worry about what's going on with the hardware.

....

C++ wouldn't be too bad of a start. My first textbook was Structured & Object-Oriented Problem Solving Using C++. I found the writing very clear and the author describes each concept very thoroughly. You may be able to find it at http://www.cheapesttextbooks.com/ or one of the various other college text book sites. Another pro of the book is that it comes with Visual C++: all the programs to code and compile a program.

....

Well, we learnt C in the Programming Fundamentals course at Uni, and apparently this sort of thing is not uncommon..at least in New Zealand.

C++ would indeed be a decent start, it is possible to do well at C++ without knowing C, I reccommend the textbox, A First Book of C++: From Here To There, it teaches C++ in a clear way, while not skimping on the important fundementals. it does not cover alot of the Object-Orientated stuff which makes C++ really shine, but you can should be able to find good textbooks on that.

However, I still reccommend learning C, as it is still widely used, and makes learning C++ a little easier.

Edited by Prometheus98876

Share this post


Link to post
Share on other sites
I really don't think learning C is the best way to start off programming.

I'm a little perplexed by this statement, given that you say the following:

C++ wouldn't be too bad of a start.

If you know C++, then you pretty much know C. C++ is more or less C with classes. Also, I don't consider C to be a low-level language at all - but the whole issue is relative anyway. I've spent a great deal of time writing assembly code, so for me C is high-level. If you've done a lot of programming in Python, you're more likely to consider C to be a low-level.

They do usually teach you C, in every introductory programming course.

Share this post


Link to post
Share on other sites
They do usually teach you C, in every introductory programming course.

Well, usually they do indeed. But apparently at the university my mate goes to they teach Java in their Progrmming Fundamentals class.... though im not sure this is a better choice than C.

Share this post


Link to post
Share on other sites

These days, C is considered low level. It is often considered a glorified macro-assembler.

Pascal is probably a little better for beginners but since most languages take a C-look, C is probably the better way to go. I think if one starts with C then they will learn to be more careful in programming when it comes to memory allocation and pointers, and will also learn about the underlying machine. C doesn't hold your hand or hide much so the learning process can be difficult but well worth it.

Somewhere along the way, one should also learn Lisp or Scheme, and investigate Forth.

- Keith

Share this post


Link to post
Share on other sites
These days, C is considered low level. It is often considered a glorified macro-assembler.

Pascal is probably a little better for beginners but since most languages take a C-look, C is probably the better way to go. I think if one starts with C then they will learn to be more careful in programming when it comes to memory allocation and pointers, and will also learn about the underlying machine. C doesn't hold your hand or hide much so the learning process can be difficult but well worth it.

Somewhere along the way, one should also learn Lisp or Scheme, and investigate Forth.

- Keith

The stuff you mention above about C are many of the reasons I have always thought C is a preffered langauge for entry-level programming, and were some the reasons my lecturer gave when I done the course.

I have looked a little into Lisp, like a few hours into it, and I like what I see so far. Apparently it is used a lot in Computer Science research, could you say in what fields of research?

Share this post


Link to post
Share on other sites

Lisp, historically, has been linked with AI but it is great as a general purpose language.

Paul Graham's website ( www.paulgraham.com ) has a lot on Lisp that makes for interesting reading.

- Keith

Share this post


Link to post
Share on other sites
A few questions:

  1. Do you have any understanding of programming? From your post, I assume the answer is "no", but I thought I'd double-check.

  2. What does "programming" mean to you, at your current state of knowledge?

  3. Why do you want to learn programming? Is it so that you can program something? Or, is it more in the nature of doing simple programming so that you can better appreciate what programming is all about?

And, all hail to thee too!

1. Nothing I can do anything with.

2.Its stringing together various commands.

3. So I can get a better understanding of what is going on when I use a program. I feel dangerously ignorant about something that is becoming an all pervasive part of our lives.

Share this post


Link to post
Share on other sites

Some years ago, I'd have said: get Visual Basic and learn that. However, today the editor and tools have so much functionality that I would not recommend that as the best place to start.

Your best bet would be to get a "Learn Programming" book (link to Amazon). This one says you'll learn programming in 24 hours :D I'm not familiar with this book, but despite the silly title, it seemed to have the most appropriate content and reviews (of the few that I looked at). Even if you don't learn programming from this book, it seems it will give you enough so you can figure what you want to do next.

Some non-traditional approaches also occurred to me: you could start with something non-traditional, like HTML and JavaScript on your own web-site. Or, if you like robots, you could get a Lego MindStorms kit with the programmable "brick". These would be quite different from traditional programming, but might be more fun. So, if these motivate you more, you might consider them. Otherwise, stick with the traditional.

I would not recommend C or C++ for a beginner. Java might be okay, if done right. "Sevik" suggested LISP. Not sure if he realized you're a beginner or if he's trying to pull your leg. I've programmed in LISP; my advice would be: don't go anywhere near LISP, unless someone pays you well to do so. :P

Share this post


Link to post
Share on other sites
I would not recommend C or C++ for a beginner. Java might be okay, if done right. "Sevik" suggested LISP. Not sure if he realized you're a beginner or if he's trying to pull your leg. I've programmed in LISP; my advice would be: don't go anywhere near LISP, unless someone pays you well to do so. :D

Why would you not reccommend beginners learn C?

Share this post


Link to post
Share on other sites
I would suggest learning C

No, no, no!

Do not spoil your programming career by starting with C! C is an ancient legacy language, and the only reason you should be learning it is to maintain existing C code.

If you want to start programming, begin with a simple yet powerful object oriented language like VB.Net, python, or ruby.

The easiest path to programming would be to use VB.Net and Visual Studio 2005. It allows you to create a complete web or windows based application without a single line of code.

I don’t recommend reading programming language books either. It’s not much easier than trying to learn a foreign language by reading a book. You should read a quickie tutorial, then jump right in, using a reference work and examples to get help when you need it. The programming books you do read should be on strategy and design, not syntax.

Share this post


Link to post
Share on other sites
Do not spoil your programming career by starting with C! C is an ancient legacy language, and the only reason you should be learning it is to maintain existing C code.

C is hardly an "ancient legacy language", it's pretty much the standard when it comes to compilers for embedded applications (anything from digital cameras, DVD players, car computer systems). Not to mention developing algorithms with Matlab. It's fast, and gives you total control over the hardware (the only way you're going to do better is if you drop down to assembly).

I stand by my statement - if you want to learn Programming, starting with C is the best way. If you want to do as little coding as possible, and mess around with forms and templates instead, by all means stick with VB...

Share this post


Link to post
Share on other sites

C's fine for what it's designed to do. I've coded in C for a few years, and there I like it. However, it is not designed for safety in the form of error-detection. For that reason, it is a programmer's language, not a beginner's language.

A really good language to learn procedural programming is Pascal; but, that means hunting for an old Turbo Pascal tool. Pascal's focus on "safety", with the sacrifice of power, might have been what killed it.

Share this post


Link to post
Share on other sites
Do not spoil your programming career by starting with C! C is an ancient legacy language, and the only reason you should be learning it is to maintain existing C code.
So I guess I shouldn't suggest learning 370 Assembly language, right?

Share this post


Link to post
Share on other sites
C is hardly an "ancient legacy language", it's pretty much the standard when it comes to compilers for embedded applications (anything from digital cameras, DVD players, car computer systems). Not to mention developing algorithms with Matlab. It's fast, and gives you total control over the hardware (the only way you're going to do better is if you drop down to assembly).

Total control over the hardware means that the programmer has to know how to handle the hardware. This is really too much to ask a beginner to do, programming is hard enough. Learning with a low level he must learn the syntax but more importantly the logic of developing a program AND learn about the hardware at the same time. Higher level languages do a better job because of their singular focus, allowing the programmer to develop that algorithmic type of thinking which is so important while hiding the machinery.

Edited by Michelangelo

Share this post


Link to post
Share on other sites
It's fast, and gives you total control over the hardware (the only way you're going to do better is if you drop down to assembly).

I think that .Net gives me better control over hardware and can be faster than C. Some see C’s reliance on pointers as a benefit, but it usually just leads to inefficient memory management and leaky code. I don’t think blue screens are the “total control” over hardware that you want. Unless you are writing kernel or driver code (in which case, C++ is best) a managed framework is much more efficient. If you want to access hardware, you can do that with .Net too, but how many lines would it take you to do this with C:

Dim port As IO.Ports.SerialPort = My.Computer.Ports.OpenSerialPort(PortName, BaudRate, IO.Ports.Parity.Even)

port.WriteLine(filetosend)

or

if My.Computer.Network.IsAvailable then My.Computer.Network.UploadFile(File, Address, User, Password)
Edited by GreedyCapitalist

Share this post


Link to post
Share on other sites
No, no, no!

Do not spoil your programming career by starting with C! C is an ancient legacy language, and the only reason you should be learning it is to maintain existing C code.

Remember that many modern operating systems (including Windows and Linux) are written in a combination of C, C++, and assembly. It's not that it is a legacy language, it's just that it mainly falls into the domain of low-level system programming. For this reason, you shouldn't start with C. If you do want to get into C/C++, I'd recommend C++. Chances are you will never code much straight C unless you want to do some low-level programming. If you learn C++, you will understand most C code, plus you have the added safety of STL classes, which are much easier to understand and debug.

If you want to start programming, begin with a simple yet powerful object oriented language like VB.Net, python, or ruby.
VB.NET is perfect for an absolute beginner. The only problem with VB is that it hides quite a bit from the programmer. So once you get a little more advanced, I would recommend moving to C++ or Java so you will be more exposed to the important concepts.

The easiest path to programming would be to use VB.Net and Visual Studio 2005. It allows you to create a complete web or windows based application without a single line of code.
This goes with what I was saying earlier. The point and click design of Visual Studio makes it easy to initially create something. But if you eventually want to learn why things work the way they do, Visual Studio will always try to hide that from you.

Share this post


Link to post
Share on other sites
Remember that many modern operating systems (including Windows and Linux) are written in a combination of C, C++, and assembly.

To the best of my knowledge, the Linux kernel and all of Windows XP is 100% C++. I am not addressing C++ here, but there is no longer any benefit to C whatsoever.

VB.NET is perfect for an absolute beginner. The only problem with VB is that it hides quite a bit from the programmer. So once you get a little more advanced, I would recommend moving to C++ or Java so you will be more exposed to the important concepts.

This is just the attitude I dispute. I would challenge anyone to show me something possible with C++ that cannot be done (and better) with VB.Net or C#

But if you eventually want to learn why things work the way they do, Visual Studio will always try to hide that from you.

Hide what exactly? Visual Studio is not a programming language, it's an IDE - it can be used to code in VB, C++, or assembly if you want.

Share this post


Link to post
Share on other sites

The Linux kernel like most kernels, and probably many if not most drivers, is written in C.

Here's a quote from one of the Linux Kernel HOWTO docs from LWN.NET:

So, you want to learn how to become a Linux kernel developer? Or you

have been told by your manager, "Go write a Linux driver for this

device." This document's goal is to teach you everything you need to

know to achieve this by describing the process you need to go through,

and hints on how to work with the community. It will also try to

explain some of the reasons why the community works like it does.

The kernel is written mostly in C, with some architecture-dependent

parts written in assembly. A good understanding of C is required for

kernel development. Assembly (any architecture) is not required unless

you plan to do low-level development for that architecture. Though they

are not a good substitute for a solid C education and/or years of

experience, the following books are good for, if anything, reference:

- "The C Programming Language" by Kernighan and Ritchie [Prentice Hall]

- "Practical C Programming" by Steve Oualline [O'Reilly]

- "Programming the 80386" by Crawford and Gelsinger [sybek]

- "UNIX Systems for Modern Architectures" by Curt Schimmel [Addison Wesley]

The kernel is written using GNU C and the GNU toolchain. While it

adheres to the ISO C89 standard, it uses a number of extensions that are

not featured in the standard. The kernel is a freestanding C

environment, with no reliance on the standard C library, so some

portions of the C standard are not supported.

------------------------------

If not Lisp early on then Scheme is a good substitute.

- Keith

Share this post


Link to post
Share on other sites
I would not recommend C or C++ for a beginner. Java might be okay, if done right. "Sevik" suggested LISP. Not sure if he realized you're a beginner or if he's trying to pull your leg. I've programmed in LISP; my advice would be: don't go anywhere near LISP, unless someone pays you well to do so. :D
I couldnt disagree more. Lisp (and Scheme) will teach you how to be a programmer, rather than a code monkey. Scheme is probably a better idea than Lisp though assuming youre a raw beginner; its like Lisp but with a lot of the more powerful-but-confusing features removed. Choosing Scheme will also allow you to learn from two of the best 'intro to programming' books out there, namely "How to Design Programs" and "The Structure and Interpretation of Computer Programs".

If you dont want to start with Scheme, something like Python or Haskell might also be a good idea. I wouldnt recommend things like VB/C though, and C++ should be avoided at all costs. C# and Java arent too bad I suppose; C# is a good idea if you just want to learn how to knock out some quick graphics based programs rather than actually learning any theory.

I stand by my statement - if you want to learn Programming, starting with C is the best way. If you want to do as little coding as possible, and mess around with forms and templates instead, by all means stick with VB...

Having to micromanage your hardware is not a good way to learn Programming (with a capital P). Programming is about math, algorithms and abstract structure, not hardware-specific issues like memory-allocation. The low-level uglyness of C obscures the underlying concepts which are obvious even to a beginner in something like Scheme.

Edited by Hal

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...