What is the best way to learn code?

61 replies
What is the best way to try to learn code? I am learning php using a book and am finding it hard work. I am always astounded by how quickly a coder can read and pick up any errors in it. I was wondering how do programmers look at a line of code to they focus on one element (i.e the variable) at a time or do they try to analyze it all. For me there are usually to many different things going on at the same time and this disorientates my logical thought process leading to panic!
I am thinking of trying a new method whereby I will just read hundreds of lines of code every day to get a feel of it, almost like photoreading it. This will be like how we learn say the English language. Reading is now such second nature that we can immediately spot misspellings or bad grammar because it jars and hits us in the face. Maybe that's how programmers are with code. Would this approach be useful or do you have to be more systematic?
#code #learn
  • Profile picture of the author doylesoft
    Programming is an art. If a programmer tries to debug code, they are VERY good at it because they know exactly what they are looking for. They have probably been writing code for years and years.

    All I can say is, learn the basics. Just keep working at it. I admit that it is hard to learn when doing self study.

    Good luck!
    Signature

    Brandon Doyle
    http://doylesoft.com Simple, effective, and affordable software. Knowledge Base software.

    {{ DiscussionBoard.errors[394378].message }}
    • Profile picture of the author maxsynergy
      Originally Posted by doylesoft View Post

      Programming is an art. If a programmer tries to debug code, they are VERY good at it because they know exactly what they are looking for. They have probably been writing code for years and years.

      All I can say is, learn the basics. Just keep working at it. I admit that it is hard to learn when doing self study.

      Good luck!
      Yeah little by little you will be becoming a better programmer but it takes time and dedication.
      {{ DiscussionBoard.errors[422918].message }}
  • Profile picture of the author write-stuff
    Yeah, it does take a lot of experience. People who have done programming for a long time already know roughly how a piece of code needs to work before even looking at it. Then, they skim over it to get the basic layout, followed by a breakdown of the code into sections, functions, procedures, etc.

    You just have to keep at it. It takes time. Good luck. - Russ
    {{ DiscussionBoard.errors[394404].message }}
  • Profile picture of the author madison_avenue
    doylesoft and Russ thanks for your replies guys. Yes it seems to me there is no quick fix, as you say, it is a matter of keeping going. I will never be an expert at it I just want to know enough to recognize the basics.
    {{ DiscussionBoard.errors[394441].message }}
  • Profile picture of the author Valdor Kiebach
    the way to learn php is by writing some code.
    Get yourself a simple open source or plr script and experiment with it.
    When you know what a piece of code should do you will be able to see whats wrong if it doesnt work, also check the php error log as this tells you what the error is and what page / line the error is on, remember that something as simple as a missed comma or semi colon will break it.
    {{ DiscussionBoard.errors[395324].message }}
    • Profile picture of the author Karen Blundell
      Originally Posted by Valdor Kiebach View Post

      the way to learn php is by writing some code.
      Get yourself a simple open source or plr script and experiment with it.
      When you know what a piece of code should do you will be able to see whats wrong if it doesnt work, also check the php error log as this tells you what the error is and what page / line the error is on, remember that something as simple as a missed comma or semi colon will break it.

      when I started coding this is the method I used...not just PHP, but also HTML, XHTML, and CSS
      I find the only way for me to learn is not from books, but from actually tearing code apart and putting it back together again!
      Signature
      ---------------
      {{ DiscussionBoard.errors[399800].message }}
  • Profile picture of the author madison_avenue
    Thank you Valdor, I will try your method out. I have a package of small PHP scripts which I will now open.
    {{ DiscussionBoard.errors[395353].message }}
  • Profile picture of the author palger
    Hi,

    I am a php developer, so I wanted to put in my 2 cents.

    My first suggestion would be to approach the learning process with
    a task in mind that you wish to accomplish.

    It has been my experience that unless you are focused on something
    specific, it's difficult to put the pieces together.

    In addition, it's most beneficial when you create your first script and
    get it to work. ( My examples will be php scripts )

    <?php
    echo "This is my page" ;
    ?>

    Next you would want to understand internal language functions
    and logical structures, ( while () for() if then etc )

    You might take the first example and locate snippets on the net
    that you can add to your script.


    <?php
    echo "This is my page" ;

    $i = 0 ;
    while ( $i < 10 ) {
    echo "Index " . $i ;
    $i++ ;
    }

    ?>

    The idea is to make baby steps in terms of the pieces that you learn,
    in preparation for an overall solution to your task ultimately. Your task
    is broken down into steps that you can implement through the process of
    learning the functions and logical structures.

    Of course, this is a much larger topic, but that's how you can get started.

    I did assume that you
    1 You use a text edit for the script creation
    2 Have a web host that supports php
    3 Know how to ftp the example scripts you make.

    I hope you find this useful

    Regards,
    Phil Alger




    ?>
    Signature

    Recession Proof Income Generation
    http://advancedleadgeneration.com

    {{ DiscussionBoard.errors[399100].message }}
    • Profile picture of the author salonmar
      WoW! you guys are heavy. I just throught they were speaking about HTML code..simple stuff. I'm in the wrong place for now.
      Signature

      P.Y., 40 years Small Biz Veteran.
      Shares 21 Biggest Mistakes Made

      {{ DiscussionBoard.errors[1020381].message }}
  • Profile picture of the author madison_avenue
    Phil, thanks you for your input, you suggest:

    "The idea is to make baby steps in terms of the pieces that you learn,
    in preparation for an overall solution to your task ultimately. Your task
    is broken down into steps that you can implement through the process of
    learning the functions and logical structures."

    This is a more structured and and incremental approach than I am trying. This is building from the ground up. Your idea of a strong purpose is interesting and may provide me with a stronger focus by having a practical target. Yes I do have a host runing PHP and can use FTP. I will try out your method (which must have been successful for you), by trying to run mini-scripts and see how it develops from there.

    regards
    fazal
    {{ DiscussionBoard.errors[399475].message }}
  • Profile picture of the author rarebiz
    The best way is not starting from zero.

    Start with the best opensource code out there.
    There are lots of thing that are not written in the book.
    Just best practice.

    Start with framework. Learn PHP? start with KohanaPHP or code Igniter.
    You want content site. Learn Wordpress.

    Just don't start from basic. That's my method. Hope it works for you.
    {{ DiscussionBoard.errors[399573].message }}
  • Profile picture of the author rarebiz
    Other reason you need is community.
    Mailing list is the best place to ask something very2 stupid, umm beginner.
    Forum you have to read before asking stuff etc. Etiquette blablah.
    {{ DiscussionBoard.errors[399576].message }}
  • Profile picture of the author kishorem
    internet is your friend.

    you can find any pieces of code online

    all you need to do is just know how to read it and piece them together
    Signature

    Best Regards,
    Kishore M

    Brand New 2015 Product Launch on Clickbank
    ~ Reciprocation Mailing is Guaranteed ~
    http://www.extremefxprofit.com/jv

    {{ DiscussionBoard.errors[400871].message }}
  • Profile picture of the author madison_avenue
    For others who are learning, I have found this neat little program helpful, it makes learning the basic concepts easy. It's free and you can download it from Microsoft.com:

    Small Basic
    {{ DiscussionBoard.errors[400985].message }}
  • Profile picture of the author Alfer
    I know exactly what you mean. I learned to program by hanging out with gurus as a teenager, and at one point I even thought I was stupid because everything that was effortless to them was far above my head.

    The stuff you're reading is confusing because you don't yet have the feel of the language and the flow of things down. Programming really becomes instinctual at some point. If you tell someone how to pedal a bike, they can awkwardly follow instructions and move forward a few feet, but they won't have to think about their feet or handlebars once they really get going.

    The most important part is trial and error & getting experience in writing code. When you get to a part that makes you want to give up, ask on forums for help. Find a mentor that will give you a visual aide or whatever is necessary when you hit a sticking point. When you make a thread, be sure to post the code that you tried so they see you aren't just asking without first making an effort on your part to figure it out.
    {{ DiscussionBoard.errors[403968].message }}
  • Profile picture of the author Sybiz
    I think the best way to learn is to just start coding and learn as you go along. That way you can also experiment with what you're learning and things will make a lot more sense. If you read too much you will get confused because a lot of it won't make sense but if you start playing with the code and then slowly try to modify it to do different things you'll start to understand how it all works.

    The first program I ever coded before I knew anything about programming was a simple "Hello World" program where I just have one textbox with a button that makes the textbox say Hello World when pushed. From there I moved onto more advanced things.

    Looking at open source code can be a great way to study and learn as well but make sure once you study it, you modify and update it to do other things. I would often do this with complex pieces of code and would then run into a lot of errors trying to make it do different things. It was in the process of fixing those errors that most of my learning occured - because then I finally understood exactly what each line of code was doing whereas when I was just studying it I only had a basic idea.
    {{ DiscussionBoard.errors[422237].message }}
  • Profile picture of the author baca85
    Sybiz learning by making mistakes is the best way. Best way you are gonna remember things.
    {{ DiscussionBoard.errors[422764].message }}
  • Profile picture of the author CPAmethods
    My 2 cents would be the best way to learn coding is to get a 1 on 1 coach .. Someone that will help you if you get stuck and lead you through it.
    {{ DiscussionBoard.errors[425378].message }}
    • Profile picture of the author maxsynergy
      Originally Posted by CPAmethods View Post

      My 2 cents would be the best way to learn coding is to get a 1 on 1 coach .. Someone that will help you if you get stuck and lead you through it.
      That works too but if you have dedication like I said you can learn by yourself by reading tutorials online or buying books.
      {{ DiscussionBoard.errors[426121].message }}
  • Profile picture of the author maknmoney
    i think karning the basic of any programming language will really help you.
    because any language can be perfect with you if you have its stong basics.
    {{ DiscussionBoard.errors[426307].message }}
    • Profile picture of the author Kelvin Nikkel
      Hi Madison.

      I learned to program back before Windows was introduced to the world. I had formal training in it so it gave me an indepth understanding of how coding works.

      With that in mind when it came time for me to learn PHP and HTML, I just got a good editor, I use PSPad. It is free and available at editor PSPad - freeware HTML editor, PHP editor, XHTML, JavaScript, ASP, Perl, C, HEX editor plus it is available in many different languages. I found it easy to use and to learn.

      Anyway what I did was to fire PSPad up and pull up my website on an internet browser.

      And as Palger mentioned, have a specific goal set out. Change something. Maybe starting with the header image. Find the code, take something out using the PSPad and save it. Then see how it affects your website. If it is not what you want simply reverse the step with the undo arrows and no harm has been done.

      I HIGHLY recommend that NOBODY edit their websites with the WP Theme Editor if they can get away with it. Especially when something like PSPad is FREELY available for everyone.

      Just my 2 cents.

      Kelvin
      {{ DiscussionBoard.errors[427937].message }}
      • Profile picture of the author spyder9176
        why not use the wp theme editor?

        does anyone know of a good online course on php. one the has assignments and dead lines.
        {{ DiscussionBoard.errors[448692].message }}
  • Profile picture of the author gcaine
    Something I haven't seen mentioned here.

    Install Linux, Apache, php and mySql on your own computer and do your testing there.

    It's faster than uploading each piece of code and finding out it doesn't work the way you planned and if you get into an endless loop you can just kill the script
    Signature

    Weekend Golfers affiliate manager.

    Do you have a golf related site?
    Join our affiliate team and earn commissions on our golf instruction courses.

    {{ DiscussionBoard.errors[450412].message }}
    • Profile picture of the author Matt Fulger
      Originally Posted by madison_avenue View Post

      What is the best way to try to learn code? I am learning php using a book and am finding it hard work. I am always astounded by how quickly a coder can read and pick up any errors in it. I was wondering how do programmers look at a line of code to they focus on one element (i.e the variable) at a time or do they try to analyze it all. For me there are usually to many different things going on at the same time and this disorientates my logical thought process leading to panic!
      I am thinking of trying a new method whereby I will just read hundreds of lines of code every day to get a feel of it, almost like photoreading it. This will be like how we learn say the English language. Reading is now such second nature that we can immediately spot misspellings or bad grammar because it jars and hits us in the face. Maybe that's how programmers are with code. Would this approach be useful or do you have to be more systematic?
      I can't say what the "best way" is to learn code since that really just depends on the individual. Some people like working from a book, others like just ripping into php files, changing things up (making a backup first)and testing the new file.

      In some cases, you can find very well documented scripts, within the scripts themselves. For an example download the SMF forum from Home of SMF: Free PHP and MySQL forum software and take a look at some of the .php files. You will find a good bit of useful information within these files which tries to explain what is about to happen in the script. Not only does this help you figure out the code, it also shows you a good way to comment your own coding projects to help you remember what everthing is doing within each specific chunk of code.

      I know this sounds a bit cryptic right now, but if you download the forum software and browse the files in any text editor or PsPad, you will start to see what I mean.

      For a decent tutorial to get you started writing and understanding a script, take a look at the following tutorial:

      [Tutorial] PHP/MySQL Authentication System

      I hope this helps.

      Originally Posted by Kelvin Nikkel View Post

      Hi Madison.

      I learned to program back before Windows was introduced to the world. I had formal training in it so it gave me an indepth understanding of how coding works.

      With that in mind when it came time for me to learn PHP and HTML, I just got a good editor, I use PSPad. It is free and available at editor PSPad - freeware HTML editor, PHP editor, XHTML, JavaScript, ASP, Perl, C, HEX editor plus it is available in many different languages. I found it easy to use and to learn.

      Anyway what I did was to fire PSPad up and pull up my website on an internet browser.

      And as Palger mentioned, have a specific goal set out. Change something. Maybe starting with the header image. Find the code, take something out using the PSPad and save it. Then see how it affects your website. If it is not what you want simply reverse the step with the undo arrows and no harm has been done.

      I HIGHLY recommend that NOBODY edit their websites with the WP Theme Editor if they can get away with it. Especially when something like PSPad is FREELY available for everyone.

      Just my 2 cents.

      Kelvin
      Thanks for showing us all a pretty sweet looking freeware, Kelvin. I've already downloaded and installed it and will be playing around with it here shortly. I can't believe I hadn't come across this before. LOL

      Originally Posted by spyder9176 View Post

      why not use the wp theme editor?

      does anyone know of a good online course on php. one the has assignments and dead lines.
      I'm just guessing, but the WP Theme Editor probably produces sloppy code (could be wrong) and is inferior to freeware like the PsPad Editor that Kelvin mentioned.

      As for the tutorial; see above, under my reply to Madison. It's not assignments with dead lines, but could still be helpful to learn some php code and working with databases.

      Originally Posted by gcaine View Post

      Something I haven't seen mentioned here.

      Install Linux, Apache, php and mySql on your own computer and do your testing there.

      It's faster than uploading each piece of code and finding out it doesn't work the way you planned and if you get into an endless loop you can just kill the script
      Very good suggestion. I've done this myself a few times and need to do it again soon. Here's a list of just a few free webservers:

      Hope this helps.

      Peace & Prosperity,
      Matt Fulger
      {{ DiscussionBoard.errors[458890].message }}
    • Profile picture of the author rlnorthcutt
      Originally Posted by gcaine View Post

      Something I haven't seen mentioned here.

      Install Linux, Apache, php and mySql on your own computer and do your testing there.

      It's faster than uploading each piece of code and finding out it doesn't work the way you planned and if you get into an endless loop you can just kill the script
      Excellent point!

      You can also download "packages" of apache, php and mysql for windows and set it up VERY easily. Here are two good packages:

      apache friends - xampp

      Install PHP 5 Apache MySQL on Windows : WampServer

      Ron
      {{ DiscussionBoard.errors[469572].message }}
  • Profile picture of the author coolhobo
    Hi Guys,

    There are a number of good suggestions, as for myself I started learning to code years ago. I actually started writing games in assembler before getting into higher level languages, self taught I might add (I'm showing my age here).

    Anyway I best way I found to pick things up was having a specific task in mind that helps you focus on the key things you need to know to get the job done. That way you can start to build a foundation of knowledge about the language you're working with and expand from there. The other key thing I found that helped me was being able to bounce things off someone more experienced because they will steer you in the right direction.

    There will come a time when it just clicks, after that you can look at code written in any language and be able to make some sense of it, very empowering when you get to that stage.

    Best of luck with your efforts.

    Byron
    {{ DiscussionBoard.errors[459358].message }}
    • Profile picture of the author garyk1968
      Originally Posted by coolhobo View Post

      Anyway I best way I found to pick things up was having a specific task in mind that helps you focus on the key things you need to know to get the job done. That way you can start to build a foundation of knowledge about the language you're working with and expand from there. The other key thing I found that helped me was being able to bounce things off someone more experienced because they will steer you in the right direction.
      I would agree with that 100%. You must have a task (ideally to deliver it for someone else) otherwise there is no deadline and no goals to meet. Here is what I say to people who want to learn development or learn a new language.

      Find a friend/family member who has a business that needs a specific problem solving where a bespoke solution would help
      Then offer to build that solution for free and set a realistic timeframe

      So first off you *have* to get it done as you have a deadline to meet. Second you actually have a piece of work which now forms part of your portfolio/case study to help you get other work.

      It isn't easy and there are no shortcuts, you have to stick at it for quite some time. I have always tried to keep my skillset pretty narrow but very focused on what I do, it always makes me smile when I read someone who claims to be an 'expert' in C++/Java/PHP/Ruby/Perl etc

      What I would say also is pick your language stick with it and you must add SQL to your weaponry. It doesnt matter what dev tool/language you pick you will sooner or later need to access a database, make sure it is at least ansi 92 sql compliant so you are learning standard SQL and not some obscure flavour of it.

      Gary
      {{ DiscussionBoard.errors[926048].message }}
      • Profile picture of the author CDarklock
        Originally Posted by garyk1968 View Post

        it always makes me smile when I read someone who claims to be an 'expert' in C++/Java/PHP/Ruby/Perl etc
        Experts know the language is largely irrelevant. It's not about whether your loop is "for(int x = 0; x < 10; x++)" or "(1..10).each"; it's about why you need the loop. All programming boils down to sequence, selection, and iteration. Everything else is an implementation detail.
        Signature
        "The Golden Town is the Golden Town no longer. They have sold their pillars for brass and their temples for money, they have made coins out of their golden doors. It is become a dark town full of trouble, there is no ease in its streets, beauty has left it and the old songs are gone." - Lord Dunsany, The Messengers
        {{ DiscussionBoard.errors[930591].message }}
        • Profile picture of the author garyk1968
          Originally Posted by CDarklock View Post

          Experts know the language is largely irrelevant. It's not about whether your loop is "for(int x = 0; x < 10; x++)" or "(1..10).each"; it's about why you need the loop. All programming boils down to sequence, selection, and iteration. Everything else is an implementation detail.
          Agreed but with each language there is a framework and these frameworks are pretty big and *that* is something where you cannot be an expert in *all* of them. Look at C#, yeah you can learn the basic constructs and as a 3gl there aren't that many commands. To deliver a solution you need to understand the .net framework and that is pretty big.
          {{ DiscussionBoard.errors[1008761].message }}
  • Profile picture of the author rlnorthcutt
    I think that the best way to learn coding is to do it!

    Create a simple site using Drupal or Joomla that will allow you to put PHP code into the pages. Then use the support and forums online to help you figure out what code you need.

    Personally, I love Drupal and the support/documentation is fantastic.

    You can also pick up Freelancing gigs on RentACoder or similar. Start with easy jobs and work your way up. You'd be surprised how many people are willing to pay money for a solution that only takes a few minutes on google to figure out... get paid to learn!

    Ron
    {{ DiscussionBoard.errors[461870].message }}
  • Profile picture of the author lhai_14
    Object oriented programming is essentially building a program around self-contained collections of data and code to modify that data.

    For me the best way to learn code is to experiment the art of programming. It is so hard to learn but you achieved a great reward from this.

    Trust your self and God will give you knowledge and wisdom!
    {{ DiscussionBoard.errors[464583].message }}
    • Profile picture of the author Matt Fulger
      Originally Posted by lhai_14 View Post

      Object oriented programming is essentially building a program around self-contained collections of data and code to modify that data.

      For me the best way to learn code is to experiment the art of programming. It is so hard to learn but you achieved a great reward from this.

      Trust your self and God will give you knowledge and wisdom!
      Welcome to the Warrior Forum lhai_14.
      {{ DiscussionBoard.errors[465850].message }}
  • Profile picture of the author gcaine
    Ron, on RentACoder they have what's called "work for hire" which essentially means that your customer has full copyright to the product.

    How does that relate to the various functions that are in the code? It seems that I would have to rewrite all the functions for any new project rather than just use them again.
    Signature

    Weekend Golfers affiliate manager.

    Do you have a golf related site?
    Join our affiliate team and earn commissions on our golf instruction courses.

    {{ DiscussionBoard.errors[469247].message }}
    • Profile picture of the author Matt Fulger
      Originally Posted by gcaine View Post

      Ron, on RentACoder they have what's called "work for hire" which essentially means that your customer has full copyright to the product.

      How does that relate to the various functions that are in the code? It seems that I would have to rewrite all the functions for any new project rather than just use them again.
      Hey Gary,

      Welcome to the Warrior Forum. BTW, I couldn't resist taking a look
      at your Singles Cafe site. According to your quiz, I should be teaching
      you how to get laid. LOL
      {{ DiscussionBoard.errors[469538].message }}
  • Profile picture of the author rlnorthcutt
    GCaine,

    The only time this would be an issue is if the customer was trying to create a software product that they wanted to copyright and resell. Usually in this case, they will have you sign a NDA and will be very specific.

    Web-based systems rarely have/need a specific copyright because they are hosted and the user won't be able to "steal" the code. Of course you can always ask!

    I use open source code as often as possible, and I explain this in my bid. The reason is that by reusing code, we can develop MUCH faster and the time to develop is often a major price factor. This can also help in maintaining a more robust end product.

    Alot of Open Source code does have a GPL (or similar) license, which means you HAVE to provide the source when you sell/transfer it... and sometimes that applies to the custom code you create. So be aware of this issue (again - it doesn't really apply for a hosted web solution as there is no code transfer!)

    I have never had a client (RAC or otherwise) that wanted me to start from scratch. Not that they aren't out there, but there wouldn't be many.

    Consider that even if you program in Visual C++ or something, there are common objects and functions that EVERYONE uses. Its the same thing. If you write a function, and then you rewrite it for another client but its identical, is that copyright infringement? NO way... only so many ways to skin a cat, and we all have our own preference.

    BOTTOM LINE:

    When in doubt - ask. Just make sure they know that if you start from scratch that will really increase the development cost and time.

    Ron
    {{ DiscussionBoard.errors[469557].message }}
  • Profile picture of the author gcaine
    Matt, I didn't write the quiz, only the code to make it work. The publisher of the ebook wrote the quiz.

    It did work pretty good as an ad for a while, but it seems to have slowed down.

    Ron,
    If i write some php code that will be hosted on his server there is code, it's just not visable to the users.

    I use a lot of my own functions.

    Anyway I wouldn't worry too much about reusing my code.

    Now I need to find a few bids I can win to get a rating
    Signature

    Weekend Golfers affiliate manager.

    Do you have a golf related site?
    Join our affiliate team and earn commissions on our golf instruction courses.

    {{ DiscussionBoard.errors[469701].message }}
    • Profile picture of the author rlnorthcutt
      Originally Posted by gcaine View Post

      Matt, I didn't write the quiz, only the code to make it work. The publisher of the ebook wrote the quiz.

      It did work pretty good as an ad for a while, but it seems to have slowed down.

      Ron,
      If i write some php code that will be hosted on his server there is code, it's just not visable to the users.

      I use a lot of my own functions.

      Anyway I wouldn't worry too much about reusing my code.

      Now I need to find a few bids I can win to get a rating
      Yes - get your rating up on RAC and it helps alot. I did some smaller/faster jobs at a lower price than normal to help boost it up... and not all coding!

      I did some graphics work, video tutorials, voice work and even some sales work. There are tons of jobs on there, and lots are fun.

      If you keep your eyes open, you can also get some work in the IM field. I had some IM related work that was great... I got to read/learn the systems (one I did video tutorials for) and got paid

      RAC can be a really fun game.

      Ron
      {{ DiscussionBoard.errors[470608].message }}
  • Profile picture of the author Ethan Evans
    Originally Posted by madison_avenue View Post

    What is the best way to try to learn code? I am learning php using a book and am finding it hard work.
    There are some fantastic responses in this thread. What helped me learn PERL a long time ago was creating a game with what I was learning. Some have mentioned the best way to learn is by doing. I agree. You should create small programs or scripts that do something fun or practical. You will quickly learn the ins-and-outs of the programming language.
    {{ DiscussionBoard.errors[469789].message }}
  • Profile picture of the author Moflow
    Banned
    [DELETED]
    {{ DiscussionBoard.errors[470181].message }}
  • Profile picture of the author Gezawy
    Learning a programming language is just one part of the deal. You also need to learn problem solving techniques and other programming related skills and paradigms that are not language specific (though they might be specific to a broad family of languages). Consequently, I would not advise learning two programming languages from scratch simultaneously since you may end up bogged down in details and thus miss the forest for the trees.
    {{ DiscussionBoard.errors[648854].message }}
  • Profile picture of the author spikyy
    Best way to learn how to code is NOT learning php first. The best way is to start with pseudocode (search this on wikipedia). After you understand the pseudocode try to make simple programs (write them on your notebook). The next step after pseudocode programming is the C language. And after you know the C language and you understand it, it will be very easy for you to learn ANY programing language. Take Care.
    {{ DiscussionBoard.errors[648889].message }}
  • Profile picture of the author viane
    You should learn it using your work. You should make some scripts yourself to do practice and you will get more and more knowledge
    {{ DiscussionBoard.errors[650573].message }}
  • Profile picture of the author arcdigital
    I learned all of my programming skills by immersing myself in it. I just said alright, i'm going to learn, then I just started creating a script from scratch and learned as I coded. Bit by bit, I learned all of the language. I don't read code line by line, or all at once. I read it in "Blocks". I look and say, ok this "block" is causing the problem. Then I go through it line by line and I evaluate 1) What is it supposed to do, 2) What is it doing, 3) How do I fix it?.
    {{ DiscussionBoard.errors[653881].message }}
    • Profile picture of the author corsair
      I always find when learning a new language I can read all the books and think I have a firm grasp, but when I actually start to code something the knowledge is often not as strong as it could be !

      The languages I have learnt the best are the ones which I HAD to learn to do something for my job - you pick up what you need to know for a specific task and then expand your knowledge around that core to do things quicker / better etc.
      {{ DiscussionBoard.errors[656719].message }}
  • Profile picture of the author MemberWing
    How i always learn new stuff:

    - Get the thinnest book or shortest tutorial on a subject. That will get you up and running quickly and get somewhat productive with your first ugly piece of code. But early satisfaction means a lot. You don't want to trust these 1000 pages "Learn rocket science in 24 hours" type of manuals. Size matters - and in this case - the smaller - the better.

    - Set relatively interesting but easy task for yourself and do it on your own using any available source of info.

    - Get the fattest and most complete book on the subject and get on with more serious project now.


    Gleb
    {{ DiscussionBoard.errors[660066].message }}
  • Profile picture of the author diegor
    Best way to learn is in big chunks of time i.e. 5-6 hours at a time, instead of the typical 1 hour of learning a day. Following tutorials, as well as seeing how other people make their websites also helped me.
    {{ DiscussionBoard.errors[851377].message }}
  • Profile picture of the author Tim Franklin
    Wow lots of good responses here, Well I have to say that learning code is really just like learning a new language.

    If english is your native language, when you look at spanish, or another of the romance languages, you may see a few things you recognize, but for the most part, unless you study it you will not know anything about what the language is saying.

    But spend a few weeks studying the language and learning what the language is saying and after a while you will begin to see and also understand the language.

    Learning code is no different, I see no difference between a page written in english and one that is written in PHP, did that happen overnight, Nope, do I understand everything as well as english, No again, but I understand it much better now than I did in the past and in the future I will understand it even more.

    My advice is to learn by doing, install scripts, debug code, trace down errors, the more time you spend working and learning, (hands on) the more you will understand and learn.

    Hope this was helpful,);
    Signature
    Bitcoin | Crypto | Blockchain Secrets |
    {{ DiscussionBoard.errors[851569].message }}
  • Profile picture of the author hire_us
    I think if you are good at Maths...You can be easily good at coding...

    if you are learning some HTML tags,,,then you can go for photocopying whatever you find...

    but when it comes to do some thing on your own...I mean developing a logic..you got to be careful...can't learn by remembering some code...

    Try learning C first...just learn the basics...not even Pointers...Just some tatements and looping and all...

    and try to implement any Math problem that comes to your mind...I mean adding two numbers...then Multiplying...

    and then try Multiplication using addition...

    what i am trying to say...in the world of programming you can code anything if you can implement your logic using the basic elements...no need to go for complex structures...

    but that doesn't mean they are not needed...first grab the basics...and then ....a lot more...

    hope this helps...
    {{ DiscussionBoard.errors[853990].message }}
  • Profile picture of the author SethTheUBotGuy
    lots and lots of trial and error. also I learn well from videos
    {{ DiscussionBoard.errors[899280].message }}
  • Profile picture of the author Karl Wirtz
    Learning programming and all of the coding are not really easy. Programmer should know the logic of his program first even before you can make the coding. Well, I guess you need to have lot of exercise codes to practice on. Good luck
    {{ DiscussionBoard.errors[899569].message }}
  • Profile picture of the author jeffsolochek
    Look at open source sites like Sourceforge. You can see how other programmers have gotten certain things to work. There are a lot of PHP editors out there but many of them have a price. I use Netrbeans.org for all my coding plus they have a TV site with a lot of PHP coding screencasts
    Signature

    Jeff Solochek
    http://www.jeffreysolochek.com/blog
    http://www.networkcelebrity.com

    I also build blogs for companies and individuals

    {{ DiscussionBoard.errors[924196].message }}
  • Profile picture of the author newbyr
    I use ultraedit. This shows me the errors in my code right away via color differentiation. Give it a try when examining your code.
    {{ DiscussionBoard.errors[928589].message }}
  • Profile picture of the author zain654321
    The best way to learn and programming code is to watch the vedio tutorials rather than text book. Also use online text tutorials with full examples. The best online programming tutorial site is W3Schools Online Web Tutorials.

    Start with small progammes and then try others.
    I hope it i will help you to learn as well as get experience.
    {{ DiscussionBoard.errors[1008429].message }}
  • Profile picture of the author Tatsh
    I really strongly suggest learning C first. If you're going to do web design only, I don't see how PHP could hurt but it is also very similar to C/C++. Has elements of both, and some clarity that C/C++ does not have (such as variables always start with $).

    You need to be curious while programming. This helps when you run into problems. You cannot be seriously interested in programming if you will quickly give up on simple errors. You can even Google a common compiler error and more than likely find a solution of some kind, although it may need to be adapted.

    A piece of (bad) code for fun (and yes, this does compile):
    Code:
    #include <stdio.h>
    
    void help() {
      printf("These are the help options:\n");
      printf("  --help, -h -- Show this information\n");
    }
    
    int main(int argc, char *argv[]) {
      if (argv[0] == "--help" || argv[0] == "-h") /* This would work fine in PHP and Javascript */
        help();
    
      printf("My bad program.\n");
    
      return 0;
    }
    Yes, the desired functionality (the user gives -h or --help for arguments, stored in array argv, which is actually an array of pointers to characters) works, but -a, -b, -c will also call help(). Why? Because the program is asking if argv[0] (the VERY first element of the array) is "-", not "--help" or "-h". It's only testing the first character. Instead that line should say if (strcmp(argv[0], "-h") == 0 || strcmp(argv[0], "--help")). This does NOT solve the issue if -h or --help were in argv[7] for example.

    Actually, this is one of the big differences in C vs other languages that have come after. String comparisons are done either manually or with the standard C library (string.h). Learning to manipulate strings (arrays) is another very helpful, along with dynamic memory allocation (malloc, yes), and all that other fun stuff.

    You have to want it, you need the curiosity, and you CANNOT give up so easily no matter what. There is a 99% chance that there is a way to get things to work the way you desire.

    If you have any PHP questions, I am happy to help a little here and there.
    {{ DiscussionBoard.errors[1008758].message }}
  • Profile picture of the author developerholic
    Best way to learn on how to code is to start from the basic, which is flowchart a.k.a logic formulation.

    No matter what programming language you use, if you have a strong foundation, you are good to go
    {{ DiscussionBoard.errors[1008846].message }}
  • Profile picture of the author rlpruitt
    There's no magic to writing code. It's no different than learning any other skill or discipline. In fact, it's just like learning to ride a bike.

    In the beginning you struggle. Your brain hasn't formed any neural patterns for coding so everything is new and everything is difficult.

    As you continue working with PHP, you'll get more neurons joining the party. As your neural network grows you begin to more easily recognize patterns in programs.

    As you gain even more experience, the number of patterns you recognize will increase. The complexity of patterns that you recognize will also increase.

    Debugging is simply being able to determine when and where in a program a pattern is has been violated. Your debugging skills will improve in direct correlation with the increase in pattern recognition.

    Unfortunately, growing neural networks and increasing pattern recognition takes time and experience. Unless your a genius - where your pattern recognition skills expand almost immediately - you can't do much to accelerate the process.

    The only thing you can do is to continue regularly working with PHP code and programs. I'd suggest dissecting as many working PHP programs as possible. One easy way to do this is with something like WordPress. If you've got a WP site, download a few plugins and wade thru the code. Figure out how they do what they do. Once you think you've got it figured out, modify the plugin code to add or change features.

    And, above all, have fun.

    Ralph
    Signature
    Tell me if I'm dumb, stupid, or just feakin' out of my mind!
    The Marketing Power Pak - FANTASTIC! marketing plugins for WordPress
    {{ DiscussionBoard.errors[1011423].message }}
  • Profile picture of the author Sonam22
    Whenever you want to learn a new language, then best thing is to download snippets of code that do exactly what you are after and change the code.If you are just learning PHP. Do not bother with the web frameworks like EasyPHP/XAMPP as Ikke mentioned above. They are more complicated and you will then have both the language to learn and a heavy featured IDE.
    {{ DiscussionBoard.errors[1012608].message }}
  • Profile picture of the author greenexit
    You should check out Stack Overflow. It's such a useful and great site for coders.
    {{ DiscussionBoard.errors[1020515].message }}
  • Profile picture of the author quickcash
    Firstly, if you know any basic programming language and the script has "some" comments you can easily figure out problems and have them solved.

    Now to the question, HOW PROGRAMMERS DO IT, they have experience, once yous tart programming, you can tell the error by just knowing it, without seeing the source code, so its just knowledge, more you know the more you apply and faster results
    {{ DiscussionBoard.errors[1021953].message }}
  • Profile picture of the author Marcel Pamphile
    Adopt good practices
    Make your code talk back to you when your developing so you see each step of the way.
    Look at professionally written code.

    It takes time + practice.
    Signature

    Business Funnels - http://businessfunnels.com

    {{ DiscussionBoard.errors[1057838].message }}

Trending Topics