PDA

View Full Version : need a mentor or personal trainer



cjminton
January 27th, 2010, 07:01 AM
hello i was wondering if anyone could mentor me so that i could help develop for ubuntu or just programs for ubuntu. i know a little c++ but i don't really know how to get started making actual programs. i have all the time in the world at the moment and feel like i need a job and some good experience, so put me to work or train me first.

Bodsda
January 27th, 2010, 09:00 AM
Well, showing that you are willing to help us help you by helping youself is usually a good start to anything.

How to start programming - guides and links for many languages (http://ubuntuforums.org/showthread.php?t=333867)
Read Before Posting: Forum FAQ's, how to learn to program, and Linux programming (http://ubuntuforums.org/showthread.php?t=1006666)
Programming Tools and References (http://ubuntuforums.org/showthread.php?t=1006662)

You dont need a personal mentor, you just need the resources.

Kind regards,
Bodsda

Senesence
January 27th, 2010, 09:23 AM
You dont need a personal mentor, you just need the resources.

Resources, patience, persistence, and motivation. ;)

Actually, you can think of this forum as being your "personal mentor"; just ask your questions, and we will try our best to provide a suitable answer.

cjminton
January 27th, 2010, 12:10 PM
Haha thanks for the tutoring. I had to ask though because ubuntu.com (http://www.ubuntu.com/community/participate/developerzone) told me I could find a mentor within the development community. Apparently there's a bunch of mentors on here by the name of Rtfm.

Habbit
January 27th, 2010, 12:32 PM
Well, Rtfm is a good mentor indeed! ;)

Seriously now, most of us are (there's no need to hide it) a bunch of computer geeks with the teaching talents of a book shut, bound, drowned in cement and dropped to the bottom of the Marianas trench... and then annihilated in a matter-antimatter reaction. We can usually answer concrete points quite well, but looking for "a mentor" which can patiently and successfully guide you through the difficult path of program design is... well... tough.

That is not to say we lack our wise people: there are great minds here and there, like our resident C++ guru dwhitney67, or CptPicard, etc. You can see them patrolling the forums, righting wrongs and all that, but I guess most of them have their lives and jobs. Mentoring is a nearly full-time occupation, and I doubt anybody would do it just for the sake of it.

nvteighen
January 27th, 2010, 03:17 PM
Also, keep an eye open for people's projects... Some people run interesting projects that could be the best ways for being mentored.

cjminton
January 27th, 2010, 11:36 PM
Thanks for the feedback I'll be looking forward to the upcoming projects to learn from.

Schotty
January 28th, 2010, 12:20 AM
Well I dont know your situation, but have you thought about auditing some of the college courses for challenge ideas? Most colleges around me will let you audit for free, so cost is minimal (cost of gas really :D ). Then you can do this for more advanced coding courses and use their homework plan as a challenge guide.

A few friends of mine did this. Intermingling with some of the other students may not be so bad an idea.

Otherwise scratch an itch you got. Thats precisely what I am doing. Or an itch your woman or guy has. If its too difficult, break it down to something that isn't so hard. For example, redoing the premise of Bittorrent with a new protocol is a daunting challenge, but doing a bittorrent client isnt nearly as bad. So start off with the client first.

HTH

cjminton
January 28th, 2010, 01:31 AM
For example, redoing the premise of Bittorrent with a new protocol is a daunting challenge, but doing a bittorrent client isnt nearly as bad. So start off with the client first.

HTH

I agree. I got starting learning programming about 6 months ago, started with reading Sam's Teach Yourself C++. My goal was too big though which was to make like some awesome kind of 3D video game and then once I found out that I had to learn something called an API (OpenGL) next I got overwhelmed and said screw programming. So I took a break for a few months and now I'm back with just the plan to make something small first like a mp3 tag editor or something else that's actually needed now. Also once I got about 450 pages into the book and learning about virtual class functions it seemed just a little too much unneeded crap.

I know I'm a amateur and my opinion doesn't really mean jack but I kind of think C++ is just C made for people that need a lot fail safes and seat belts for their lack of quality writing skills. I really got super bored and tired learning about classes but I guess I have to if I ever want to get hired to work for money some day. So back to the books.

Anyway I guess my point is dream big but think small when starting out.

dwhitney67
January 28th, 2010, 01:39 AM
I know I'm a amateur and my opinion doesn't really mean jack but I kind of think C++ is just C made for people that need a lot fail safes and seat belts for their lack of quality writing skills.

Yes, you are correct.

nmccrina
January 28th, 2010, 01:52 AM
I know I'm a amateur and my opinion doesn't really mean jack but I kind of think C++ is just C made for people that need a lot fail safes and seat belts for their lack of quality writing skills.



Yes, you are correct.

I'm an amateur at this point too, but I disagree. Object Oriented Programming is (at least, for me) an extremely helpful way to think about things. I get annoyed at times by my professors who see OOP as some sort of holy grail (I think they come from business backgrounds, where OOP is used, to paraphrase Paul Graham, as a means of keeping large teams of mediocre programmers from doing too much damage, precisely because of the 'seat belts' it has), but if it comes down to doing a linked list in C or C++, I'm taking C++ because it allows me to define the problem in a lot simpler terms. This is even more true if the problem is to make some kind of huge app like a game. I've heard that functional languages like Lisp or Haskell blow the doors off of both in terms of paradigm, but I haven't delved into those as much.

I guess I'm saying (hoping?) that using C++ does not imply a lack of quality writing skills. ;)

cjminton
January 28th, 2010, 03:13 AM
I guess I'm saying (hoping?) that using C++ does not imply a lack of quality writing skills. ;)

I definitely wasn't talking about the intelligence of the people who use it, I'm just remarking on the reason why it's pushed onto people - why it's "better" than C.

nvteighen
January 28th, 2010, 11:53 AM
I know I'm a amateur and my opinion doesn't really mean jack but I kind of think C++ is just C made for people that need a lot fail safes and seat belts for their lack of quality writing skills. I really got super bored and tired learning about classes but I guess I have to if I ever want to get hired to work for money some day. So back to the books.


One of the best diagnoses I've read on C++ :)

Though, read my reply to nmccrina right below...


I'm an amateur at this point too, but I disagree. Object Oriented Programming is (at least, for me) an extremely helpful way to think about things. I get annoyed at times by my professors who see OOP as some sort of holy grail (I think they come from business backgrounds, where OOP is used, to paraphrase Paul Graham, as a means of keeping large teams of mediocre programmers from doing too much damage, precisely because of the 'seat belts' it has), but if it comes down to doing a linked list in C or C++, I'm taking C++ because it allows me to define the problem in a lot simpler terms. This is even more true if the problem is to make some kind of huge app like a game. I've heard that functional languages like Lisp or Haskell blow the doors off of both in terms of paradigm, but I haven't delved into those as much.


It's not about OOP, which is great and should be learned, as it's one of the best and more intuitive way to organize code... you know, we humans tend to think in objects rather than in other categories.

It's about C++'s way to do OOP. If you look at Objective-C (to mention another C-offspring), you'll be surprised on how easy it is to do "normal" OOP in it without learning lots of exceptions to lots of rules... and also stuff with not quite legitime reason to be ("friendship"... which sounds to me like treasoning your own encapsulation).

About Lisp, it's actually the Common Lisp Object System or "CLOS" (which was ported to Scheme too...), which is an implementation of "multiple dispatched OOP". Smalltalk-based languages (Objective-C, for example) also feature a similar system with another name ("messaging-based OOP"). The idea is that you create methods that can be applied to different objects, telling how to apply it depending on the object's type. But (and this is the important thing), methods are also objects, so you can combine a method call at runtime. In C++, you can't save method 'a' into variable 'b' and then expect to run 'someobj.b()'.

Habbit
January 28th, 2010, 01:39 PM
In C++, you can't save method 'a' into variable 'b' and then expect to run 'someobj.b()'.


class my_class {
float parse_and_round(const char*, int);
float density_of_codepoint(const char*, int);
// Whatever
};
typedef float (my_class::* my_method)(const char*, int);

// In some function
my_method func = &my_class::parse_and_round;
my_class obj;
cout << "result: " << (obj.*func)("75.257", 1);

And yes, it also works as expected with virtual functions. Also, the STL <functional> header (http://www.cplusplus.com/reference/std/functional/mem_fun/) incorporates the mem_fun and mem_fun_ref utility functions to allow easy use of member functions with STL algorithms like sort or remove_if.

CptPicard
January 28th, 2010, 04:17 PM
Interesting use of a class member function pointer, I didn't know that's possible in C++. Will have to remember that, I tend to use that sort of patterns a lot in other languages...

Now, if only we got proper closures or at least forward closures on the stack (implementable without a garbage collector as in the GNU extensions to gcc), I would start feeling more comfortable in C++. There's still a lot of messing with the type system though :p

The really great idea in CLOS is the fact that objects and methods are separate. A method does not "belong" to some class/instance; that is, there is no "this pointer". The multiple-dispatching mechanism then selects and builds the effective method combination based on the types of all the parameters, not just the implicit "this" parameter... it always felt insane to me that the method would be selected only based on "this" when I was learning Java OOP... and my gut feeling was vindicated when I became a Lisper.

nvteighen
January 28th, 2010, 06:03 PM
class my_class {
float parse_and_round(const char*, int);
float density_of_codepoint(const char*, int);
// Whatever
};
typedef float (my_class::* my_method)(const char*, int);

// In some function
my_method func = &my_class::parse_and_round;
my_class obj;
cout << "result: " << (obj.*func)("75.257", 1);

And yes, it also works as expected with virtual functions. Also, the STL <functional> header (http://www.cplusplus.com/reference/std/functional/mem_fun/) incorporates the mem_fun and mem_fun_ref utility functions to allow easy use of member functions with STL algorithms like sort or remove_if.

Hm... ok, I was aware of this, as it's what Objective-C does (just that the whole function pointer is hidden as a "pointer to implementation"... the IMP type). The issue is that by using a function pointer, you're grabbing a certain impementation and not the method as an abstract "action", so you could easily apply the child class's implementation to the parent class and make your application crash; the nice thing in CLOS is that you'll always apply the correct implementation by just naming the method, unless you do something really awkward like grabbing the methods from the generic procedure data structure...

But, actually, I confused stuff :P "Multiple dispatch OOP" is about defining what implementation to use by not only the object's type, but also the other arguments'. You can have a class A with method X and have that method X specialized for A (of course), integer and string... and another implementation just for class Z... The idea is that you define methods for a generic function, not for the class. This, plus the dynamic nature of Lisp, gives you the power to do weird stuff like:



(defgeneric do-something (obj something-else))

(defclass class1 ()
((data :initarg :data
:initform 0
:reader data)))

(defclass class2 ()
((data :initarg :data
:initform "a"
:reader data)))

(defmethod do-something ((myobj class1) (mynum number))
(+ (data myobj)
mynum))

(defmethod do-something ((myobj class1) (mystring string))
mystring) ; Just return the string

(defmethod do-something ((myobj class2) (myobj1 class1))
(format nil
"~a~a"
(data myobj)
(data myobj1)))

(defmethod do-something ((something t)) ; Default case for *everything*
"hello!")

akvino
January 28th, 2010, 06:30 PM
Another interesting OO feature you tend to miss is Object Encapsulation and Reusability.

If you write a program called 'Living Room', then the code for your 'desk', 'cup', 'lamp', is the same in Quake, and, and Assassin, and Sims.

Something you just can't do that easy in C.