Monday, May 20, 2013

Xcode

Seeing as I do a fair bit of work on my Mac partition, I took the plunge and downloaded an IDE called Xcode.

I wanted to share some of the things I've discovered today while poking around with this powerful application:

  1. IDEs will require some sort of learning curve. Luckily, this one is very straight-forward, but I haven't investigated any for Windows or Linux systems yet. Yeah, go figure that after being so excited to get Linux on my zombiemac, I'm using Mac OSX more...
  2. There is a LOT of good information in the documentation for the IDEs, but chances are, you'll need to sift to get to what you're trying to figure out. The communities are pretty tight-lipped, it seems, and that's understandable. I think, perhaps, they want to protect the diminishing quality of really good coders who legitimately want to know what they're doing. But, that could be a brash opinion from a novice who doesn't really know the communities very well.
  3. For the kind of coding that is tackled in K&R and King, there really don't need to be any shiny bells and whistles. In Xcode, at least, just enter these programs into a "Command Line Tool". It uses C libraries automatically and opens up a Terminal window to produce the effects of the program. I have no idea if other IDEs will have settings like these, though.
  4. I just want to put this out there; Don't forget to compile the code after you've made a change. Seriously, you can make every change you want, but if you don't compile it after, it won't have any effect on your output. I found this out the hard way, despite this being a kind of common-sense thing (and I'm absolutely certain I've read it somewhere before and just forgot with the excitement of having things WORK in Xcode haha).
  5. Xcode can do a LOT of things. The other IDEs you might find are also designed to handle a TON of work. As with anything, take small steps and try not to get overwhelmed. If you don't need a feature (like a graphical interface), don't learn about how to code it right away!
Anyway, now that that's out of the way, here are a few things I was playing around with today. GO FIGURE that "hello, world!" was actually the program that fell victim to my lack of good knowledge with Xcode. After I got the F/C conversion table working, I didn't feel like I needed to go back and do it again, heh.


I'm hoping this can be read clearly enough... (Pro Tip: Open in New Tab, it will let you zoom reeeeal close)

The example to the far left is the original program. It takes the Fahrenheit values, in increments of 20, and calculates the Celsius value by using the algebraic formula.

The middle example converts the integers (int) of Fahrenheit and Celsius into floating-point numbers, so they can be converted with more accuracy. Floating-point numbers allow the usage of decimals.

The right-hand example shows an addition that was suggested by K&R as an exercise; a header to the table.

The next topic in K&R is the for statement. Yay for being excited to carry on with coding before delving into video games! I actually made my fiance go play ToR by himself after dinner so I could work on this stuff! Haha.

No comments:

Post a Comment