Learning Practical Programming (General discussion topic)

Right now I'm in the process of learning a few different programming languages (C, C++, and Python to be specific), and while it's brain racking, it's a lot of fun (somebody's sick, sick, idea of fun). Pretty much all of the practice programs I write though involve various forms of number crunching or string processing and... not a whole lot else, truthfully. While these things are useful for learning programming concepts, I've sort of begun to realize that these things aren't going to help me create any sort of practical PC applications.

So my question then becomes, what's a good place to go to start learning how to make my programs talk to the OS, so they can do something useful for a change? Also, what are other good concepts to learn in order to apply what I'm learning in more practical, useful, ways?

Re: Learning Practical Programming (General discussion topic)

First of all, thank you for recognizing that C and C++ are different languages. They are very different languages, and, in my opinion, too many programmers lump them together.

Next, it's time for you to learn what you'll be spending most of your time using: libraries! If you want to make a GUI application you could use GTK (C), Qt (C++), or wxWidgets (Python). If you want to make a video game you could use Allegro (C), SFML (C++), or Pygame (Python).

Of course, this is just a quick list of some example libraries. You might find a library that you'd like to learn that better suites your needs. But programming languages by themselves are boring. The exciting power is in the libraries.

Re: Learning Practical Programming (General discussion topic)

So my question then becomes, what's a good place to go to start learning how to make my programs talk to the OS, so they can do something useful for a change?

Could you clarify what you mean by this. What kind of applications are you interested in developing? Examples?

P.S. Using computers for number crunching and string processing is actually quite useful.

- Good judgement comes from experience; experience comes from bad judgement. -- Mark Twain- There's a remedy for everything but death. -- The wise fool, Sancho Panza- The purpose of a system is what it does. -- Anthony Stafford Beer

Re: Learning Practical Programming (General discussion topic)

So my question then becomes, what's a good place to go to start learning how to make my programs talk to the OS, so they can do something useful for a change?

Could you clarify what you mean by this. What kind of applications are you interested in developing? Examples?

P.S. Using computers for number crunching and string processing is actually quite useful.

Certainly! For example, if I wanted to code a simple filemanager, it would seem like I would need to learn how to interact with the filesystem using one of the aforementioned languages. Or if I wanted to write a music player, I would need to know how to interact with the audio architecture using the programming language. Or even just learning how to use system calls from any of these languages. This is what I mean by making programs "talk to the OS".

I'm not entirely sure what kinds of applications I'm interested in developing. One day, I'll probably be sitting around wishing some kind of desktop app existed, and then set out to take it on as a project, or just roam GitHub looking for something interesting that I might be able to contribute to. For now though, I'm lost in a quagmire of non-specific goals.

Also, you point on number crunching and string processing is well received. I should not have been so dismissive! I mean mostly to point out that these things on their own while useful, and lend themselves to the creation of many useful applications, have a sort of confine built into them which I'm trying to explore outside of a little bit.

Re: Learning Practical Programming (General discussion topic)

drcouzelis wrote:

First of all, thank you for recognizing that C and C++ are different languages. They are very different languages, and, in my opinion, too many programmers lump them together.

Next, it's time for you to learn what you'll be spending most of your time using: libraries! If you want to make a GUI application you could use GTK (C), Qt (C++), or wxWidgets (Python). If you want to make a video game you could use Allegro (C), SFML (C++), or Pygame (Python).

Of course, this is just a quick list of some example libraries. You might find a library that you'd like to learn that better suites your needs. But programming languages by themselves are boring. The exciting power is in the libraries.

Very awesome! I will definitely start checking out some of the various libraries out there!

Re: Learning Practical Programming (General discussion topic)

First of all, thank you for recognizing that C and C++ are different languages. They are very different languages, and, in my opinion, too many programmers lump them together.

Next, it's time for you to learn what you'll be spending most of your time using: libraries! If you want to make a GUI application you could use GTK (C), Qt (C++), or wxWidgets (Python). If you want to make a video game you could use Allegro (C), SFML (C++), or Pygame (Python).

Of course, this is just a quick list of some example libraries. You might find a library that you'd like to learn that better suites your needs. But programming languages by themselves are boring. The exciting power is in the libraries.

Very awesome! I will definitely start checking out some of the various libraries out there!

I'd recommend SFML in combination with C++ (It also has a TON of bindings for various languages though) if you want to develop games. It comes not only with graphics capabilities, but also with audio, network, input etc. And fully crossplattform too!

If you go with SFML I recommend sfml-git from the AUR, since it comes with huge bugfixes(especially if you want to support intel gpus).

wxWidgets is also rather nice with C++, GUI-programming can be quite messy but wxw is the way to go if you ask me (with 1 exception: .NET in C# under windows, because of its awesome visual designer).

Other libraries I hugely recommend is mysql++ for databaseaccess, tinyxml for XML-parsing/creation, boost for loads of things, but primarily for crossplatform filehandling and stringmanipulation. Also go with C++11

Re: Learning Practical Programming (General discussion topic)

OakRaider4Life wrote:

I will definitely start checking out some of the various libraries out there!

That's great! There are many libraries to help you make a file manager.

Another piece of advice is: Focus on writing exactly what you want to make. It's easy to get distracted by extra features such as being cross-platform, or making a reusable library out of your code. Instead, just make the specific application you want to make. The time for doing those other things is after you get it working.

Re: Learning Practical Programming (General discussion topic)

Grab a cup of coffee. Find a comfortable couch. Spend some quality time perusing the documentation for the libraries appropriate to your language of choice. For Python, the Standard Library documentation is mandatory. For C on Linux, you must know libc. Read the documentation using info libc. For C++, you must read up on the standard library and templates

Read it a couple times. First, just get an idea what is in the libraries, then again to get a feel for how they fit together, and again to really start to understand them. Read sample code. Read (good) code from others.

Then, get some more coffee, and try to build and play with samples.

Finally, pick a simple task and code it. And debug it. And stress test it. Then, post it and ask for feedback. You may get feedback; it may be harsh. Roll with it, learn, incorporate the changes. repeat. Then re-read the documentation

Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael FaradaySometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing----How to Ask Questions the Smart Way

Re: Learning Practical Programming (General discussion topic)

I'd also like to add that you should really try to find something you find very interesting, else (unless you are paid to do it) it will likely end up being one of many dead (as in 'oh I will pick this up sometime in the future and finish it', yeah right lol) projects on your harddrive (of course you will still learn from the ordeal but not as much as if you see a project through)

I've had tons of these spare-time projects in my time and unless they are trivial most have ended up in that 'dead-projects' area, perhaps it's a different thing for those of us programming for a living though, or maybe it's just me being a lazy bum

Re: Learning Practical Programming (General discussion topic)

I've been writing a good number of tools for friends and coworkers. This is a good way to avoid the dead-project syndrome. Much of it is fun, but when it's not there is still the drive to finish it as someone else is relying on it.

Re: Learning Practical Programming (General discussion topic)

I would love to have you as my friend and/or coworker Trilby, there are lots of nice tools you could write for me

Joking aside that's good advise, if you know the end result matters to someone other than yourself (and preferably someone you like) then it's more likely you will finish it even though your own interest may start to wane.

Re: Learning Practical Programming (General discussion topic)

I would love to have you as my friend and/or coworker Trilby, there are lots of nice tools you could write for me

Great idea!

I've never actually progressed pass academic programming, myself. Have to get round to that someday.

Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Re: Learning Practical Programming (General discussion topic)

At some point you may also want to start familiarizing yourself with unit testing, and perhaps other formal methods of verification and validation. If it wasn't for unit tests, there is no way I could develop anything of real use that was reliable.

There are number of automated testing frameworks out there for C++ and Python that are pretty easy to use, but I'm not sure about C. (I mostly code in C++, Python, and, when I have to, Fortran.)

- Good judgement comes from experience; experience comes from bad judgement. -- Mark Twain- There's a remedy for everything but death. -- The wise fool, Sancho Panza- The purpose of a system is what it does. -- Anthony Stafford Beer

Re: Learning Practical Programming (General discussion topic)

I do it "pro bono" now to build up a client/referal base for when I 'go pro'. I'm not going pro as a "programmer" or software developer, as in these regards I'm just a proficient hobbiest, but rather as a consultant for automating work in research laboratories.

If you go into any non-math/comp sci university department around here you'll find a bunch of people who have great uses for technology, but even opening Microsoft's "Control Panel" strikes fear into their hearts as they are sure it will break something, and that is for experts only. So I may just be the one eyed man in the land of the blind.

Re: Learning Practical Programming (General discussion topic)

But programming languages by themselves are boring. The exciting power is in the libraries.

Sure, if you use boring languages like C++, Python, or Java. If you use fun, exciting languages like Racket, Haskell, or Forth then the exciting power is definitely in the languages.

In Zen they say: If something is boring after two minutes, try it for four. If still boring, try it for eight, sixteen, thirty-two, and so on. Eventually one discovers that it's not boring at all but very interesting.~ John Cage

Re: Learning Practical Programming (General discussion topic)

But programming languages by themselves are boring. The exciting power is in the libraries.

Sure, if you use boring languages like C++, Python, or Java. If you use fun, exciting languages like Racket, Haskell, or Forth then the exciting power is definitely in the languages.

After reading this, I would be inclined to add D to that list. (I can't wait until gdc becomes an official component of GCC.)

- Good judgement comes from experience; experience comes from bad judgement. -- Mark Twain- There's a remedy for everything but death. -- The wise fool, Sancho Panza- The purpose of a system is what it does. -- Anthony Stafford Beer

Re: Learning Practical Programming (General discussion topic)

Forth. wow. I have not played with Forth in 20 years. Any language that is inherently uses reverse Polish notation cannot be all that bad

Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael FaradaySometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing----How to Ask Questions the Smart Way

- Good judgement comes from experience; experience comes from bad judgement. -- Mark Twain- There's a remedy for everything but death. -- The wise fool, Sancho Panza- The purpose of a system is what it does. -- Anthony Stafford Beer

Re: Learning Practical Programming (General discussion topic)

As an engineer who does a lot of programming, I'd like to note that PC and mobile apps account for only a small fraction of all "practical" programming. People tend to forget about instrumentation, controls, DSP, and other kinds of embedded systems, but for me that's the most fun and pragmatic area of the field. It's one thing to make applications with buttons and stuff, but I think it's really cool to program real hardware to do things in the real world

Not to dismiss those who make software that deals solely in information -- I've done my share of that, too, and while it's not for me, it is also a worthy cause. I've written quite a few such applications in Perl. Mostly webapps that are database interfaces, as well as some other things, like cron scripts and conversion utilities... those are probably still much more numerous than your typical desktop or mobile app.

Re: Learning Practical Programming (General discussion topic)

Sure, if you use boring languages like C++, Python, or Java. If you use fun, exciting languages like Racket, Haskell, or Forth then the exciting power is definitely in the languages.

Will you please backup that claim / opinion? What can you make with those languages that makes them more powerful or more exciting than the others?

There's nothing that you can make with them that is inherently more exciting, but as was said above, the fun is in figuring out the radically different paradigm that the language uses. For example, Forth has RPN which is fun to play with, Haskell has a myriad of type system extensions, in addition to the vanilla type system which can be fun to play with, and Racket has its DSL building system and awesome macro system which is fun to learn about.

I'm not deriding people who use languages that they don't have to think about the mechanics of using much, and who prefer to focus on the domain/problem they are trying to solve. I'm just presenting an alternative viewpoint on what the enjoyable parts of programming are.

In Zen they say: If something is boring after two minutes, try it for four. If still boring, try it for eight, sixteen, thirty-two, and so on. Eventually one discovers that it's not boring at all but very interesting.~ John Cage