Thread: How I have been learning C: Through a file manager

  1. #1
    Registered User
    Join Date
    Dec 2011
    Posts
    51

    How I have been learning C: Through a file manager

    Please feel fee to move this to a different place as applicable.

    I have been poking around with C and Ncurses for a little while trying to learn, and came up with this little file manager I called NFFM, short for Nothing Fancy File Manager. It is meant to run on Linux so that's why I post in this particular forum. C Board has been a great source of inspiration and I found a lot of answers without even asking lol.

    I put the code in github. So feel free to try it out. I must warn, it is a prototype and work in progress. There is also a boring screenshot available.

    Source code:https://github.com/mariostg/nffm
    Screenshot:http://www.mariostg.ca/nffm/nffm.png

  2. #2
    Registered User
    Join Date
    Mar 2012
    Posts
    56
    That looks pretty good, before you did this, how you actually learned c?

  3. #3
    Registered User
    Join Date
    Dec 2011
    Posts
    51
    Hi SuperMiguel.

    As I was trying to explain above, I am learning C on my own and this little file manager is pretty much my learning platform. I don't use sophisticated IDE. Vim does the job for me. If I want to implement a new function and I am not sure how to handle it. I will write it outside of the file manager program, play with it, test it, etc until it does what I want then basically rewrite or import it it in the file manager application. It forces lots of typing and help my little brain making new connections...

    I read some books but got quickly tired of prime, fibonacci and factorial examples that leads to nothing in my opinion. I really like C Programming: A Modern Approach and The Linux Programming interface. I refer to the K&R book too once in a while. I read this forum a lot too and Goole things. There is this link to I found good A development process .

  4. #4
    [](){}(); manasij7479's Avatar
    Join Date
    Feb 2011
    Location
    *nullptr
    Posts
    2,657
    Quote Originally Posted by mariostg View Post
    If I want to implement a new function and I am not sure how to handle it. I will write it outside of the file manager program, play with it, test it, etc until it does what I want then basically rewrite or import it it in the file manager application. It forces lots of typing and help my little brain making new connections...
    Great !
    That is almost exactly how I do something...seems pretty effective for me.
    I read some books but got quickly tired of prime, fibonacci and factorial examples that leads to nothing in my opinion.
    Since you can already comprehend the logic and the language well... read up on algorithms and data structures (if you already have a very good idea, disregard this post! ).. many of which are not easy or intuitive to grasp at first.

  5. #5
    Registered User
    Join Date
    Dec 2011
    Posts
    51
    @manasij,
    Good to hear my methodology is not so bad. Interesting your mention about algorithms and data structures as I bought just a couple of weeks ago the books Algorithms in C. I did not mentionned it because I just skimmed throught the first couple of chapters. Looks extremely interesting.

  6. #6
    Master Apprentice phantomotap's Avatar
    Join Date
    Jan 2008
    Posts
    5,108
    Good to hear my methodology is not so bad.
    It isn't bad, but you could do a lot better in a way.

    Invest in a distributed source repository system (like "Mercurial" or "Git").

    With such a system in place you can fork the source and play with new features "in situ" where if they work you can merge back into branch but if they completely break something you can revert with only a few commands.

    Soma

  7. #7
    Registered User
    Join Date
    Dec 2011
    Posts
    51
    Soma, I use git and Github. My source code is on Github as per first post. I am rather new to this too I must admit.

  8. #8
    Master Apprentice phantomotap's Avatar
    Join Date
    Jan 2008
    Posts
    5,108
    O_o

    Sorry for the confusion. (Part of which was my misuse of the word "fork" which I don't recommend.)

    I'm not talking about using such a system with a central distribution point like "GitHUB".

    You can do that too. I don't, but you certainly can use such a distribution point.

    I'm talking specifically about using a branch.

    I don't know that it would look like, and I'm much to lazy to find out, but I'm talking about the following kind of system.

    Example (Success!):

    Code:
    pull source
    branch "awesome new feature"
    comment "w00t! the implementation worked"
    merge "awesome new feature"
    commit
    Example (Failure!):

    Code:
    pull source
    branch "awesome new feature"
    comment "i totally borked the idea"
    commit
    Such systems let you play with new features, new code, and new fixes in place without polluting the main code and can serve as documentation history for where features were born and when they were merged or when they died.

    Soma
    Last edited by phantomotap; 07-11-2012 at 03:58 PM.

  9. #9
    Registered User
    Join Date
    Dec 2011
    Posts
    51
    I think we are talking alike. So I am learning git too and actually just notice that my .gitignore is not quite working like intented. I did something wrong.

  10. #10
    Registered User
    Join Date
    Mar 2012
    Posts
    56
    Quote Originally Posted by mariostg View Post
    @manasij,
    Good to hear my methodology is not so bad. Interesting your mention about algorithms and data structures as I bought just a couple of weeks ago the books Algorithms in C. I did not mentionned it because I just skimmed throught the first couple of chapters. Looks extremely interesting.
    Which one you got?

  11. #11
    Registered User
    Join Date
    Dec 2011
    Posts
    51
    Quote Originally Posted by SuperMiguel View Post
    Which one you got?
    I got both.

  12. #12
    Registered User
    Join Date
    Mar 2012
    Posts
    56
    Quote Originally Posted by mariostg View Post
    I got both.
    i meant which book u got for Data structures and algo

  13. #13
    Registered User
    Join Date
    May 2012
    Posts
    1,066
    He's talking about Robert Sedgewick's "Algorithms in C" which is split into two books:
    Algorithms in C, Parts 1-4
    Algorithms in C, Part 5

    Bye, Andreas

  14. #14
    Registered User
    Join Date
    Dec 2011
    Posts
    51
    Quote Originally Posted by AndiPersti View Post
    He's talking about Robert Sedgewick's "Algorithms in C" which is split into two books:
    Algorithms in C, Parts 1-4
    Algorithms in C, Part 5

    Bye, Andreas
    Bingo.

  15. #15
    Master Apprentice phantomotap's Avatar
    Join Date
    Jan 2008
    Posts
    5,108
    O_o

    Those books are kind of gross, but you could do a lot worse for such technical content expressed in a reasonable way.

    Soma

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 0
    Last Post: 07-30-2009, 07:14 AM
  2. file manager
    By beene in forum C++ Programming
    Replies: 21
    Last Post: 10-29-2007, 01:09 PM
  3. Learning Dos and learning Windows
    By blankstare77 in forum C++ Programming
    Replies: 8
    Last Post: 07-31-2005, 03:48 PM
  4. Web-based file manager
    By ChadJohnson in forum Tech Board
    Replies: 1
    Last Post: 06-28-2005, 07:13 AM
  5. What is a file manager?
    By Nutshell in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 02-22-2002, 06:07 PM