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

Programming languages, Coding, Executables, Package Creation, and Scripting.
Message
Author
DEW
Posts: 33
Joined: 2014-07-23 19:16

[Solved] Learning to Program

#1 Post by DEW »

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!
Last edited by DEW on 2015-05-09 14:31, edited 1 time in total.

User avatar
Issyer
Posts: 3032
Joined: 2007-05-23 02:59
Location: Khakassia

Re: Learning to Program

#2 Post by Issyer »

Learn Python and PyQt and you will make nice programs in no time.

Rapid GUI Programming with Python and Qt

schnuller
Posts: 386
Joined: 2014-11-25 05:05

Re: Learning to Program

#3 Post by schnuller »

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.

DEW
Posts: 33
Joined: 2014-07-23 19:16

Re: Learning to Program

#4 Post by DEW »

Issyer wrote:Learn Python and PyQt and you will make nice programs in no time.

Rapid GUI Programming with Python and Qt
Why do you advise that I learn Python/PyQt over C?

User avatar
dasein
Posts: 7680
Joined: 2011-03-04 01:06
Location: Terra Incantationum

Re: Learning to Program

#5 Post by dasein »

DEW wrote:Why do you advise that I learn Python/PyQt over C?
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.

Then post back with any specific questions you might still have.

tsathoguah
Posts: 31
Joined: 2014-09-07 10:10

Re: Learning to Program

#6 Post by tsathoguah »

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!

User avatar
Issyer
Posts: 3032
Joined: 2007-05-23 02:59
Location: Khakassia

Re: Learning to Program

#7 Post by Issyer »

DEW wrote: Why do you advise that I learn Python/PyQt over C?
Do you want to program or communicate with the microprocessor? Then it's a different thing. You didn't ask about that.

DEW
Posts: 33
Joined: 2014-07-23 19:16

Re: Learning to Program

#8 Post by DEW »

Issyer wrote:
DEW wrote: Why do you advise that I learn Python/PyQt over C?
Do you want to program or communicate with the microprocessor? Then it's a different thing. You didn't ask about that.
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?

Beyond that the fact that you stated Python/PyQt are good for making GUI programs does sound rather appealing.

User avatar
dasein
Posts: 7680
Joined: 2011-03-04 01:06
Location: Terra Incantationum

Re: Learning to Program

#9 Post by dasein »

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?
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
Posts: 33
Joined: 2014-07-23 19:16

Re: Learning to Program

#10 Post by DEW »

dasein wrote:
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?
No. Not unless you're planning a drop-in replacement for lm-sensors anyway (which would be a huge timesink for no obvious benefit).
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 haha

User avatar
dasein
Posts: 7680
Joined: 2011-03-04 01:06
Location: Terra Incantationum

Re: Learning to Program

#11 Post by dasein »

DEW wrote:If I did it, it would simply just be to see if I could.
Any Turing Complete Programmer 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.

User avatar
Issyer
Posts: 3032
Joined: 2007-05-23 02:59
Location: Khakassia

Re: Learning to Program

#12 Post by Issyer »

DEW wrote:Beyond that the fact that you stated Python/PyQt are good for making GUI programs does sound rather appealing.
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.

Image

schnuller
Posts: 386
Joined: 2014-11-25 05:05

Re: Learning to Program

#13 Post by schnuller »

DEW wrote:
Issyer wrote:
DEW wrote: Would I need a C level language to do this?
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 ... :-) ).
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.

DEW
Posts: 33
Joined: 2014-07-23 19:16

Re: Learning to Program

#14 Post by DEW »

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.

tomazzi
Posts: 730
Joined: 2013-08-02 21:33

Re: Learning to Program

#15 Post by tomazzi »

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. :)
Odi profanum vulgus

User avatar
Issyer
Posts: 3032
Joined: 2007-05-23 02:59
Location: Khakassia

Re: Learning to Program

#16 Post by Issyer »

tomazzi wrote:Real programming starts with non-linear, timing-based or timing-independant/parallel logic
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.

ExDatis
Posts: 9
Joined: 2013-05-09 06:08

Re: Learning to Program

#17 Post by ExDatis »


schnuller
Posts: 386
Joined: 2014-11-25 05:05

Re: Learning to Program

#18 Post by schnuller »

Nah, not such. Steve Summit is a better option if one wants an easy start (easy being the wrong word)
http://www.eskimo.com/~scs/

BowCatShot
Posts: 959
Joined: 2006-07-15 12:08

Re: Learning to Program

#19 Post by BowCatShot »

"(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.

schnuller
Posts: 386
Joined: 2014-11-25 05:05

Re: Learning to Program

#20 Post by schnuller »

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.
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.

Post Reply