Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230
[Solved] Learning to Program
[Solved] Learning to Program
I recently decided that I wished to try and learn programming for fun and to see if I am any good at it not to mention it'd be nice to have a deeper understanding of how things work.
I was wondering what books you all would recommend for a beginner to learn C. I would prefer books with sample codes and 'assignments/projects' at the end of chapters to build/test my understanding. Better yet if people can advise a series of books to progress my knowledge on as I move from total idiot -> beginner -> intermediate etc
Thanks in advance!
I was wondering what books you all would recommend for a beginner to learn C. I would prefer books with sample codes and 'assignments/projects' at the end of chapters to build/test my understanding. Better yet if people can advise a series of books to progress my knowledge on as I move from total idiot -> beginner -> intermediate etc
Thanks in advance!
Last edited by DEW on 2015-05-09 14:31, edited 1 time in total.
Re: Learning to Program
Learn Python and PyQt and you will make nice programs in no time.
Rapid GUI Programming with Python and Qt
Rapid GUI Programming with Python and Qt
Re: Learning to Program
C Programming - a modern approach
by King
might be a good one, worth a try.
The coreutils of one of the BSD's is much shorter and clearer than the GNU versions. Might be an idea too.
http://cvsweb.netbsd.org/bsdweb.cgi/~ch ... text/plain
No clue, found it while searching for the source code of "cat"
http://www.cs.stevens.edu/~jschauma/631/
At linuxquestions.org in the forum is a list with books about C, including comments by the users.
by King
might be a good one, worth a try.
The coreutils of one of the BSD's is much shorter and clearer than the GNU versions. Might be an idea too.
http://cvsweb.netbsd.org/bsdweb.cgi/~ch ... text/plain
No clue, found it while searching for the source code of "cat"
http://www.cs.stevens.edu/~jschauma/631/
At linuxquestions.org in the forum is a list with books about C, including comments by the users.
Re: Learning to Program
Why do you advise that I learn Python/PyQt over C?Issyer wrote:Learn Python and PyQt and you will make nice programs in no time.
Rapid GUI Programming with Python and Qt
Re: Learning to Program
There are actually several good reasons to prefer Python as a first programming language. The most obvious is learnability. For a larger discussion, consult either (a) any of the several existing threads here at FDN where people have asked this exact same question (realizing that the answer doesn't change merely because the question is repeated) or (b) any of the several hundred thousand pages on the Web that address this question.DEW wrote:Why do you advise that I learn Python/PyQt over C?
Then post back with any specific questions you might still have.
-
- Posts: 31
- Joined: 2014-09-07 10:10
Re: Learning to Program
I don't know your line of work or your interests, but what i'd recommend is a book titled:
Numerical methods in engineering with Python 3-3rd edition
It's short (around 450 pages),concise (covers a lot of important python chapters),well-written (at least i think so) and deals with practical matters. Don't let the "engineering" on the title discourage you.
My experience with programming languages is not exactly vast (Fortran,Python),so other posters' opinions should bear more gravity.All i've come to understand is that python gains in popularity and therefore, you'll have many available tools (e.g. numpy,matpltlib ) and support (forums,guides and such).
Happy trails!
Numerical methods in engineering with Python 3-3rd edition
It's short (around 450 pages),concise (covers a lot of important python chapters),well-written (at least i think so) and deals with practical matters. Don't let the "engineering" on the title discourage you.
My experience with programming languages is not exactly vast (Fortran,Python),so other posters' opinions should bear more gravity.All i've come to understand is that python gains in popularity and therefore, you'll have many available tools (e.g. numpy,matpltlib ) and support (forums,guides and such).
Happy trails!
Re: Learning to Program
Do you want to program or communicate with the microprocessor? Then it's a different thing. You didn't ask about that.DEW wrote: Why do you advise that I learn Python/PyQt over C?
Re: Learning to Program
Well one program I'd like to one day write/make if I ever become that skilled is a program that will read/monitor temperatures of various components in my system preferably with a GUI. I'm aware that there are programs out there that do this, but I'm not really fond of any of them. Would I need a C level language to do this?Issyer wrote:Do you want to program or communicate with the microprocessor? Then it's a different thing. You didn't ask about that.DEW wrote: Why do you advise that I learn Python/PyQt over C?
Beyond that the fact that you stated Python/PyQt are good for making GUI programs does sound rather appealing.
Re: Learning to Program
No. Not unless you're planning a drop-in replacement for lm-sensors anyway (which would be a huge timesink for no obvious benefit).DEW wrote:...a program that will read/monitor temperatures of various components in my system preferably with a GUI. I'm aware that there are programs out there that do this, but I'm not really fond of any of them. Would I need a C level language to do this?
Re: Learning to Program
If I did it, it would simply just be to see if I could. Guess this thread is giving me more to think about than I'd bargained for hahadasein wrote:No. Not unless you're planning a drop-in replacement for lm-sensors anyway (which would be a huge timesink for no obvious benefit).DEW wrote:...a program that will read/monitor temperatures of various components in my system preferably with a GUI. I'm aware that there are programs out there that do this, but I'm not really fond of any of them. Would I need a C level language to do this?
Re: Learning to Program
Any Turing Complete Programmer could...DEW wrote:If I did it, it would simply just be to see if I could.
But that's still not sufficient reason to start with 'c'. One of the things you will learn at some point is that programming isn't about syntax, it's about logic--a logic that you need to learn regardless of, and in fact independent of, syntax. It's also about "best tool for the job," not "10 times harder than it needs to be."
Fact is, for temperature sensors in userspace, once you have lm_sensors installed, you don't actually need anything beyond the standard *nix tools (cat, grep, uniq, awk/sed). Display the results however you see fit to.
Afterthought: But before I went doing all of that, I'd check out the conky-manager gizmo that stevepusser has backported (if you haven't already). It's freakin' amazing what conky can be programmed to do. The gizmo includes a bunch of themes, and some of them are amazingly creative; eye candy at its finest.
Re: Learning to Program
Yeah. I have written a nice outliner within a couple weeks. Unicode, tables, URL, string formatting, clipboard capture and everything in text. Hell with Cherrytree, Zim and all that crap.DEW wrote:Beyond that the fact that you stated Python/PyQt are good for making GUI programs does sound rather appealing.
Re: Learning to Program
No, and probably for most things you won't need it (or do you plan to write another programming language or operating system? In that case ... ).DEW wrote:Issyer wrote:DEW wrote: Would I need a C level language to do this?
All which was said is probably true, and really many recommend pyhton.
But there is something about C which makes it very sexy, very elegant. "Not one word too much" as someone has put it.
If you care for understanding, not for "get the job done", then C might be a good option (and dasein said it is about learning the logic of programming, and you sure will learn it better with a language like C).
But it is kinda "hard", because it is low-level. Things more modern languages do for you, behind your back, in C you have to take care of them yourself. Memory Management being the obvious one.
Heck, simply having to run a compiler already gives me a good feeling. Rather: gave.
Re: Learning to Program
Well then I guess I will do some more research into Python and think of what I'd really like to do with programming and go from there.
Thanks for the advice everyone.
Thanks for the advice everyone.
Re: Learning to Program
Most commonly spreaded opinion is that C++/java/python or c#, etc are somehow "easier" because they are object-oriented and are providing wrappers for many system-level ("low-level") functionalities, so You don't have to deal with with those things directly, and therefore You can focus on the main task - that's an utter bullshit.
The fact is, that every program is simple as long as it is based only on simple boolean logic (if <this> then do <that>) - no matter if You use infamous C#, Java or some yet-not-existing-next-generation-wonderful-language.
Real programming starts with non-linear, timing-based or timing-independant/parallel logic or when You eventually will try to actually compute something using the computer - quickly discovering that floating point arithmetic i far from perfection.
Then, You'll need to learn about thread synchronisation, inter-process-communication techniques and how to handle/prevent FPU bugs. Sooner or later You'll have to uderstand how hardware timers are used to generate time slices for processes, what irq's are, how they can be used in those "now-not-so-easy-and-wonderful" high-level languages, why FPU may cheat You in trivial computation, and why the hell advanced CPU/GPU funcionalities are available only in C...
Programming is not easy - If You read tons of CPU specs, then You'll discover that there's even more to learn...
If You want to learn programming of computers, start at the right place - learn how the computer works - pick one of CPU architectures and read its specification. Write examples/tests in assembly language (after few thousants of lines You'll know what's going on in the CPU).
But - if You want to waste Your time, read those shitty "Hello world" examples - and it's not really important in which language they are written - differences between languages won't be really visible to You, but almost for sure You will meet bullshits like : "C is bad beacuse it's not object-oriented" or "C doesn't have that wonderful and convenient exceptions" or maybe even "Java is a portable and secure language".
Regards.
The fact is, that every program is simple as long as it is based only on simple boolean logic (if <this> then do <that>) - no matter if You use infamous C#, Java or some yet-not-existing-next-generation-wonderful-language.
Real programming starts with non-linear, timing-based or timing-independant/parallel logic or when You eventually will try to actually compute something using the computer - quickly discovering that floating point arithmetic i far from perfection.
Then, You'll need to learn about thread synchronisation, inter-process-communication techniques and how to handle/prevent FPU bugs. Sooner or later You'll have to uderstand how hardware timers are used to generate time slices for processes, what irq's are, how they can be used in those "now-not-so-easy-and-wonderful" high-level languages, why FPU may cheat You in trivial computation, and why the hell advanced CPU/GPU funcionalities are available only in C...
Programming is not easy - If You read tons of CPU specs, then You'll discover that there's even more to learn...
If You want to learn programming of computers, start at the right place - learn how the computer works - pick one of CPU architectures and read its specification. Write examples/tests in assembly language (after few thousants of lines You'll know what's going on in the CPU).
But - if You want to waste Your time, read those shitty "Hello world" examples - and it's not really important in which language they are written - differences between languages won't be really visible to You, but almost for sure You will meet bullshits like : "C is bad beacuse it's not object-oriented" or "C doesn't have that wonderful and convenient exceptions" or maybe even "Java is a portable and secure language".
Regards.
Odi profanum vulgus
Re: Learning to Program
Real programming starts with nested loops. And yes, if you are unable to separated the past from the future while timer is ticking you will get a huge pile of mess.tomazzi wrote:Real programming starts with non-linear, timing-based or timing-independant/parallel logic
Re: Learning to Program
Nah, not such. Steve Summit is a better option if one wants an easy start (easy being the wrong word)ExDatis wrote:http://www.tutorialspoint.com/cprogramming/
Good luck!
http://www.eskimo.com/~scs/
-
- Posts: 959
- Joined: 2006-07-15 12:08
Re: Learning to Program
"(b) any of the several hundred thousand pages on the Web that address this question."
This guy's like a fart in an elevator. Unpleasant as hell and you can't get away from him.
This guy's like a fart in an elevator. Unpleasant as hell and you can't get away from him.
Re: Learning to Program
More weird he gets away with it, 5000 posts in a row. Seems to be unvisible for the family-friendly hordes which bug pretty much anyone else.BowCatShot wrote:"(b) any of the several hundred thousand pages on the Web that address this question."
This guy's like a fart in an elevator. Unpleasant as hell and you can't get away from him.