LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-08-2008, 03:46 AM   #1
jaepi
Member
 
Registered: Apr 2007
Location: Urban Jungle
Distribution: Ubuntu
Posts: 189
Blog Entries: 1

Rep: Reputation: 30
Seeking for enlightenment


Hello there, I'm a c++ newbie developer and I want to develop more of my skills (specially programming in Linux). I need your advice because I want to develop a Media player in linux for my practice. Where will I start and what do I need in order to develop a media player for linux. Thanks!
 
Old 05-08-2008, 05:32 AM   #2
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
Start by looking at the source code for existing media players.

Before enlightenment, read headers, examine source.
After enlightenment...
...read headers
...examine source.
[from: "Zen and the Art of Open Source Development (The Undiscovered Manuscripts pII"]
 
Old 05-08-2008, 05:49 AM   #3
jaepi
Member
 
Registered: Apr 2007
Location: Urban Jungle
Distribution: Ubuntu
Posts: 189

Original Poster
Blog Entries: 1

Rep: Reputation: 30
Thank you sir, well appreciated.
 
Old 05-08-2008, 06:53 AM   #4
dmail
Member
 
Registered: Oct 2005
Posts: 970

Rep: Reputation: Disabled
Quote:
Originally Posted by Simon Bridge View Post
Start by looking at the source code for existing media players.

Before enlightenment, read headers, examine source.
After enlightenment...
...read headers
...examine source.
[from: "Zen and the Art of Open Source Development (The Undiscovered Manuscripts pII"]
Firstly the article you link to is not the one you mention. Secondly I think this is really bad advice, reading source code is not the correct method of learning.

Quote:
Hello there, I'm a c++ newbie developer and I want to develop more of my skills (specially programming in Linux). I need your advice because I want to develop a Media player in linux for my practice. Where will I start and what do I need in order to develop a media player for linux. Thanks!
You do not want to embark on making this application for a considerable amount of time, firstly you need to learn and practice the language doing simple applications.
 
Old 05-08-2008, 07:56 AM   #5
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Quote:
Originally Posted by dmail View Post
Firstly the article you link to is not the one you mention. Secondly I think this is really bad advice, reading source code is not the correct method of learning.


You do not want to embark on making this application for a considerable amount of time, firstly you need to learn and practice the language doing simple applications.
I am not a programmer, but--based on first principles--I find your advice puzzling. To approach any engineering task, one would need a minimum of two things:
...mastery of the tools.
...understanding the architecture of the thing to be created.

In programming, it seems that examining source code would be a pretty obvious way of understanding the architecture of--eg--a Media Player. That is certainly where I would start.
 
Old 05-08-2008, 08:21 AM   #6
dmail
Member
 
Registered: Oct 2005
Posts: 970

Rep: Reputation: Disabled
Quote:
Originally Posted by pixellany View Post
I am not a programmer, but--based on first principles--I find your advice puzzling. To approach any engineering task, one would need a minimum of two things:
...mastery of the tools.
...understanding the architecture of the thing to be created.

In programming, it seems that examining source code would be a pretty obvious way of understanding the architecture of--eg--a Media Player. That is certainly where I would start.

Quote:
...reading source code is not the correct method of learning
This is the important part, yet I should have written "reading source code is not the correct method of learning a language". The OP clearly states that he is "...a c++ newbie developer...". An experienced programmer who knows the language is a different matter and reading source code can have many benefits, for example: http://aigamedev.com/source/fear-sdk. A blog post which reflects many of my reasons for this is http://scientificninja.com/advice/dont-read-source-code . After all programming is a progression just like running, i.e. you do not learn to run and then learn how to crawl in other words "mastery of the tools."

Last edited by dmail; 05-08-2008 at 08:24 AM.
 
Old 05-08-2008, 10:11 AM   #7
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
Quote:
the article you link to is not the one you mention
Ah - you think the label of the link should be the same as the title of the page linked to perhaps? You forgot to mention that the quote does not appear in the article Would you be happier if I linked to a site dedicated to Wu Li?

Quote:
reading source code is not the correct method of learning a language
I don't know about "correct" - I have observed that the most effective method of becoming proficient in a language is to immerse yourself in it. You have to be forced to speak it.

OK - it helps to have some of the initial structure and vocab, but OP wants to "develop more of my skills". Specifically, OP feels competent enough to attempt coding a media player.

Add to this that source code is typically well commented in FOSS projects, and examining this will give OP a good idea of both the scope of the project and which points of programming need improvement.

Quote:
you do not learn to run and then learn how to crawl
Speak for yourself - my Son did just that.

In learning languages, most kids go from "goo" and "mama" to short sentences before they start differentiating words. This is because they are immersed in it. As adults, we get so hung up on Edwardian ideas about education that we forget this.

Saying it is harmful to learn coding from reading the code is like saying it is harmful for writers to read books. The blog rant you reference is making assumptions about what a beginner can or cannot do, without support.

In the end, the author points out that "Pure source code offers no advantages and so many pitfalls that it is simply never a good choice." ... but you don't find the pure unadorned code the author speaks of when he says "Source code is devoid of context. It’s simply a miscellaneous block of instructions, often riddled with a fair bit of implicit assumptions about preconditions, postconditions, and where that code will fit in to the grand scheme of the original author’s project." Not in a mature FOSS project like a media player. Go look - it's all commented - including handy notes like "fixme".

I will agree that uncommented code is not useful. hat's why it is considered "bad practice". OTOH: code written according to the philosophy in the link I presented will be very useful.

Meanwhile - neither you, nor Josh Petrie, have had anything constructive to add. You think the source route is a bad idea? Fine: suggest something else!

Last edited by Simon Bridge; 05-08-2008 at 10:13 AM.
 
Old 05-08-2008, 10:24 AM   #8
ciden
Member
 
Registered: Dec 2006
Location: New Delhi, India
Distribution: PCLinuxOS 2010
Posts: 246
Blog Entries: 1

Rep: Reputation: 31
A reminder for me to comment my source.
I really cant figure out what I have written if I look at it after a week.
I have really bad memory and cant code anything except the simplest programs without consulting first a tutorial and then a reference manual. Not very uncommon, you might say but I have been doing just that for 4 years now.
 
Old 05-08-2008, 10:52 AM   #9
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
Of course, when you get as old as the pixie there, you can write bad code and people just say it's "obfusticated". You know you're good when your regexp's are indistinguishable from line noise.

The other end of the spectrum is RMS... a guy who sits down in front of a terminal and plays the thing like a piano. Just keep the non-coke caffeinated cola flowing...
 
Old 05-08-2008, 11:38 AM   #10
95se
Member
 
Registered: Apr 2002
Location: Windsor, ON, CA
Distribution: Ubuntu
Posts: 740

Rep: Reputation: 32
Yeah, I'd say reading the existing code of a media player is a bad idea too. A media player is a significant piece of software and trying to make heads or tails of it when you are just starting will be very hard. Not only that, you'll be spending hours just reading and trying to figure out what the code does, instead of actually programming. You'll learn much faster if you can get coding faster.

I'd say... Learn C++ first. Then, learn some general media libraries; start with the most abstracted first, like SDL, or gstreamer, then get into the more concrete if you wish to. There are tons of tutorials and small snippets of code for these types of libraries. You'll also need to learn about GUI programming, so try out some tutorials for Qt or GTK+. Once you feel you have a solid feel of how you may stick a media player together, you can start checking out the source for other projects and see how other people did it, where you feel they went wrong, where they went right, etc.
 
Old 05-08-2008, 10:00 PM   #11
jaepi
Member
 
Registered: Apr 2007
Location: Urban Jungle
Distribution: Ubuntu
Posts: 189

Original Poster
Blog Entries: 1

Rep: Reputation: 30
I'm actually doing programming in c++ for a year now, I've been doing some kid stuff before now I want to take it to another level and a media player is my choice. Thanks for the advice
 
Old 05-08-2008, 10:57 PM   #12
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,756
Blog Entries: 4

Rep: Reputation: 3966Reputation: 3966Reputation: 3966Reputation: 3966Reputation: 3966Reputation: 3966Reputation: 3966Reputation: 3966Reputation: 3966Reputation: 3966Reputation: 3966
Okay, then ... "a media player."

Well, "a media player" is realistically going to be an amalgam of existing software-tools. In other words, it's probably going to presuppose (and therefore, require) the existence of some shared system-library that knows how to play media. The application itself is going to give the user an easy and convenient way for the end-user to avail herself of that functionality.

The first objective that you will have, therefore, is to precisely define both "what your application will do" and "how the application is to go-about doing it."

For nearly every shared-library, there is probably a C++ class that will greatly-simplify the procedure of successfully using that library. Go and find it.

Search for, and then build your application from, the highest-level tools that are available to you ... given that you have elected to build your app in C++.
 
Old 05-09-2008, 02:52 AM   #13
jaepi
Member
 
Registered: Apr 2007
Location: Urban Jungle
Distribution: Ubuntu
Posts: 189

Original Poster
Blog Entries: 1

Rep: Reputation: 30
@sundialsvcs - thanks sir, I will look for shared-lib that will handle media specs.
 
Old 05-09-2008, 05:07 AM   #14
jaepi
Member
 
Registered: Apr 2007
Location: Urban Jungle
Distribution: Ubuntu
Posts: 189

Original Poster
Blog Entries: 1

Rep: Reputation: 30
i found the shared library of vlc player. would that be ok?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Seeking for a firewall grautu Ubuntu 20 11-10-2007 04:42 AM
Newbie seeking help 2 sulvereagle59 Linux - Laptop and Netbook 53 06-10-2007 09:59 AM
Newbe seeking Help sulvereagle59 Linux - Laptop and Netbook 7 06-05-2007 08:38 AM
Seeking recommendation satimis Linux - Hardware 9 01-05-2006 02:07 AM
Seeking directions jk2silly Linux - Newbie 3 10-20-2003 10:05 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:41 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration