Noob giving it a go at coding

Discussion in 'Mac Programming' started by ohla313, Apr 25, 2011.

  1. macrumors 6502a

    ohla313

    Joined:
    Apr 24, 2010
    #1
    I am a complete newb to programming or anything and want to get my feet wet. I am following the w3schools and lifehacker videos to make some sense of this all.

    I have a small question though, I am using TextEdit to try out my code (am too cheap to pay for TextMate, $60?! wow..) and I want to be able to see how my code is shown in a browser. I saved my file as an .html file but when I open it in Safari I see all my tags and not links being clickable. How do I change this to make it clickable?

    Thank you for your help!
     
  2. macrumors 65816

    jiminaus

    Joined:
    Dec 16, 2010
    Location:
    Sydney
    #2
    Check out TextWrangler either in the AppStore or http://www.barebones.com/products/textwrangler/.

    When you used TextEdit, this won't work.

    1. Enter HTML code
    2. File | Save
    3. File Format: Web Page (.html)

    The procedure above is meant to create an HTML rendering of a Rich Text Document. So you meant to use the WYSIWYG features to make a document and then let TextEdit create the necessary HTML code to replicate your formatting in a web browser.

    If you want to code HTML directly in TextEdit.

    1. Format | Make Plain Text. (You shouldn't see any formatting bar at the top of your document window).
    2. Enter HTML code
    3. File | Save and enter a filename ending .html
    4. In the "warning" dialog box, click Use .html (or just hit return).
     
  3. thread starter macrumors 6502a

    ohla313

    Joined:
    Apr 24, 2010
    #3
    Great! Thanks a lot that did the trick!

    Do you have any suggestions in how I should go about learning to code and if the resources I listed above are adequate?

    EDIT: Why are Text editors so expensive? TextMate at $60 and BBEdit at $100?? Will look at TextWrangler
     
  4. macrumors 604

    thejadedmonkey

    Joined:
    May 28, 2005
    Location:
    Pa
    #4
    I use textwrangler. It's amazing, and free :)

    (at least the version from 2 years ago was, IDK about now)
     
  5. macrumors 65816

    jiminaus

    Joined:
    Dec 16, 2010
    Location:
    Sydney
    #5
    While you could code your own GUI text editor in about 5 minutes, these editor go way beyond basic text editing.

    The strange thing though is that I have TextMate and use it as my primary editor (outside of XCode). And yet, I know vim well, and could do everything I do in TextMate (and probably more) in vim, vim is free, and it even comes pre-installed.

    As an infamous Australian politician once was renowned for saying, "Plz eksplane". (Sorry to the non-Ozzies, you won't get this).
     
  6. thread starter macrumors 6502a

    ohla313

    Joined:
    Apr 24, 2010
    #6
    How is TextMate? What is the learning curve like? i'll probably get Text Wrangler first to see where it goes. VIM pre-installed? I don't see it..

    and i get the joke, "Please explain" lol
     
  7. macrumors 6502a

    Joined:
    May 10, 2009
    Location:
    Des Moines, WA
    #7
    whereis vim
     
  8. macrumors 65816

    jiminaus

    Joined:
    Dec 16, 2010
    Location:
    Sydney
    #8
    There's a zero learning curve for the basic of functions of TextMate. The intermediate functions are intuitive, they'll behave just you'd expect them to, assuming you're used to Mac editors. You don't need to worry about the advanced functions for now.

    But I'd say just start with Text Wrangler because it's free. If you find yourself needing more than Text Wrangler provides, then look towards paying for an editor.


    You won't find VIM in the Applications folder because only the text version is installed. You've got to run it from the Terminal. You can get a GUI version from http://code.google.com/p/macvim/.
     
  9. macrumors 6502

    Joined:
    Sep 15, 2006
    #9
    You need to use the command line (e.g. the terminal)
     
  10. Moderator

    balamw

    Staff Member

    Joined:
    Aug 16, 2005
    Location:
    New England
    #10
    Learning how to use the CLI is actually very useful when learning programming beyond JavaScript. So don't be afraid of it.

    B
     
  11. thread starter macrumors 6502a

    ohla313

    Joined:
    Apr 24, 2010
    #11
    Thanks everyone for the help thus far. a couple questions though..

    Can I screw up my Mac through Terminal or is it pretty much a stomping ground to check things out?

    I'm learning basic HTML in w3schools site and JavaScript from LifeHacker, is this a good start?
     
  12. macrumors 603

    notjustjay

    Joined:
    Sep 19, 2003
    Location:
    Canada, eh?
    #12
    Pssst. "whereis vim" is a terminal command ;)
     
  13. macrumors 68020

    Cabbit

    Joined:
    Jan 30, 2006
    Location:
    Scotland
    #13
    Yes you can deleted absolutely everything on your mac just by typing in "rm -f -r *" in the wrong place. You get no dialog or warning, it just goes right for the delete.

    Though once you learn the basic commands its very easy, perhaps try a linux or bsd virtual machine to learn the terminal on first.
     
  14. macrumors 603

    notjustjay

    Joined:
    Sep 19, 2003
    Location:
    Canada, eh?
    #14
    Yes, you absolutely can screw things up, however, if you're careful, you should be just fine.

    You will do absolutely no harm exploring your file system using commands like "cd" and "ls", and probably can't do any harm by copying files using "cp".

    You do want to be very careful once you start playing with "mv" (move or rename files) and "rm" (to delete files). "rm" has a few switches that are very useful but can be tragic if not used carefully. "rm -f" will delete a file without asking you to confirm and overriding any "read only" attribute set on the file. "rm -r" will delete recursively everything in the folder tree you specify. "rm -rf" is a particularly potent combination -- it will recursively delete everything in the folder tree AND do it without asking you for confirmation. Apply that combination in the wrong place and you can end up with a LOT of files missing!
     
  15. macrumors 65816

    jiminaus

    Joined:
    Dec 16, 2010
    Location:
    Sydney
    #15
    The Terminal can be a dangerous place because the commands you run in it assume you know what you're doing. Don't let it scare you, just be careful. Before you hit return, always check two things. Check you've typed the command correctly. Check that you're in the right directory.

    But the usual mantra applies. Backup! If you use Time Machine, you're automatically getting hourly backups. So if you issue the wrong command or the right command in the wrong directory, you can restore the files very easily from Time Machine. If you manage to hose your whole system, boot from the Mac OS X DVD and do a full restore from your Time Machine backup. But don't let this lull you into a false sense of security.

    And a GUI can be just as dangerous. When I used Windows, I was in the habit of hitting shift+delete then enter to delete useless files that I wanted not to go into the Recycle Bin. When I went from Win XP to Vista, they changed the behaviour of Windows Explorer. A couple of times, I hit shift+delete then enter expecting to have deleted a file, but unexpectedly had the whole folder selected instead of just the file. Bam! Whole folder gone. Whole week's worth of the work gone. And no time machine! :(
     
  16. thread starter macrumors 6502a

    ohla313

    Joined:
    Apr 24, 2010
    #16
    Over the past days I was going over what I wanted to get out of coding and what I needed for a basic text editor. I realized what I needed.

    Which text editor will allow me to see the page I am coding? For instance, I am writing HTML and all that in one pane and I can see the web page changes in the pane next to it.

    Hopefully there's an editor out there that does that.

    Thanks!
     
  17. macrumors 65816

    jiminaus

    Joined:
    Dec 16, 2010
    Location:
    Sydney
    #17
    The free way I know to do that is to have a text editor and web browser side-by-side. Code in text editor. Cmd+Tab to web browser. Cmd+R to refresh web browser. Cmd+Tab back to text editor. Repeat.

    The only editor I know of that does live preview while HTML coding is Dreamweaver. But at USD 30 per month for a subscription or USD 399 outright, I wouldn't recommend you consider it. And you'd need to learn Dreamweaver onto top of HTML, CSS, JavaScript, etc.
     
  18. macrumors 6502a

    bpaluzzi

    Joined:
    Sep 2, 2010
    Location:
    London
    #18
    Coda has this functionality, but it's honestly not much more convenient than using two separate programs and switching between them. Once you really get into testing, you'll want to use multiple browsers, anyway.

    As for text editors, I use TextWrangler for 'separate' file editing, when I just need to make a quick change in something.

    For actual coding/project file manipulation, I use Eclipse. It's a full-featured IDE, featuring debugging, class inspector, auto-completion, and the like. It's also free! There are specific builds available for most common languages, or you can just download the "Classic" app.

    http://www.eclipse.org/downloads/
     
  19. thread starter macrumors 6502a

    ohla313

    Joined:
    Apr 24, 2010
    #19
    Thank you PghLondon and jiminaus for your responses. Sorry but could you dumb it down a bit on what you are saying?

    From what I read, Coda would be able to do this but it isn't that useful? And in order to see where my needs are, I should start with the free TextWrangler? Is having too many text editors on my MacBook ok? Should I worry about conflicts or anything? I might just want to try out TextWrangler, Coda, and TextMate at the same time and see.
     
  20. macrumors 6502a

    bpaluzzi

    Joined:
    Sep 2, 2010
    Location:
    London
    #20
    Yeah, it's not really that useful -- whether you're switching in between tabs in the same app, or switching between two apps is about the same, in my opinion. Honestly, it's easier for me to switch between apps, as I can just cmd-tab between them.

    No worries with having too many text editors. TextWrangler is a great text editor -- beginning or pro. It doesn't do auto-complete, but it does do color-based syntax highlighting. I use it on all of my development rigs.

    Coda combines a text editor (with the syntax coloring, like TextWrangler), an FTP client, an SSH/telnet terminal, and a WebKit (Chrome/Safari) "browser" for doing previews. It's a good idea in concept, but for me at least, I was able to work better using separate programs that are optimized for each of these tasks. Add in the fact that the "separate" versions of these programs can all be found for free, while Coda costs $100 (wow, they've really increased the price on that!), and it was a bit of a no-brainer (for me, at least)
     
  21. macrumors newbie

    Joined:
    May 25, 2010
    #21
  22. macrumors 6502

    Joined:
    Jan 28, 2011
    Location:
    Livingston, Scotland
    #22
    I do professional level website design in my spare time, and I use Panic's App called Coda. It's available from the App Store, and I paid $100 dollars (before it was in the App Store, don't know the price now) but it is the best text editor I have ever used. It supports syntax highlighting for loads of file types (htm, CSS, js...) and has a build in browser for real-time previewing. There's a 14 day trial available, and I recommend you give it a try =]
     

Share This Page