Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2 3

Author Topic: Programming course  (Read 5777 times)

3man75

  • Bay Watcher
  • I will fire this rocket
    • View Profile
Programming course
« on: August 27, 2015, 04:41:16 pm »

So I am currently taking a programming course and it seems kinda fun, if frustrating at times. This is the first time I have ever programmed and I wanted to ask how hard do people find it?

Currently my Proffesor said a 67 slide powerpoint showing mostly things about how to write clean code and special symbol stuff. While again not hard I am paranoid about being left behind to the wolves and I wanted to ask if there are any C++ veterans out their that can give me a tip on how to remember so much information.
Logged

Dutrius

  • Bay Watcher
  • No longer extremely unavailable!
    • View Profile
    • Arcanus Technica
Re: Programming course
« Reply #1 on: August 27, 2015, 05:04:34 pm »

I don't know much about C++, but this applies to any programming language:

Annotate your code. Include summaries of what each section does, so you can see what it does if and when you need to come back to it later.


Also, remember that with C++ and C#, literally everything exists within classes which need instantiating before you can use them. It can be confusing at first.
EDIT: Loaded up a new C++ project in Visual Studio. At a glance, it doesn't seem that C++ uses classes in the same way C# does, so take the above point with a pinch of salt.
« Last Edit: August 27, 2015, 06:17:26 pm by Dutrius »
Logged
No longer extremely unavailable!
Sig text
ArcTech: Incursus. On hold indefinitely.

Shook

  • Bay Watcher
  • ◦ ◡ ◦
    • View Profile
    • DeviantArt page
Re: Programming course
« Reply #2 on: August 27, 2015, 05:55:15 pm »

Programming is hard to get into at first, but once you've "gotten" the logic, learning new languages becomes much easier. By far the best way to learn how to do it is to get going with the exercises, perhaps reading up on cplusplus.com if something eludes you, since listening to a dry lecture for X hours will net you an astonishingly low long-term retention of what was actually said.

It's like learning a spoken language, really. There's grammatical rules and a violently pernickety grammar nazi in the form of a compiler, which will flip its shit if you as much as misplace a single comma or period (and god help you if you forget a semicolon). In other words, there's no real trick besides the usual learning by doing to hammer it in. :I (also keeping the above website handy)

Also, seconding Dutrius' notion about annotating/commenting. You may be able to easily figure out your code just after you've written it, but trust me, going back to read it after a few months is a fucking nightmare if you haven't annotated it. :P
Logged
Twitter i guess
also deviantART page
Quote from: Girlinhat
It may be worthwhile to have the babies fall into ring of fortifications or windows, to prevent anyone from catching and saving them.
Quote
[01:27] <Octomobile> MMM THATS GOOD FIST BUTTER

Dutrius

  • Bay Watcher
  • No longer extremely unavailable!
    • View Profile
    • Arcanus Technica
Re: Programming course
« Reply #3 on: August 27, 2015, 06:09:00 pm »

Yeah, I speak from experience there.

In regards to the syntax, most modern compilers will tell you exactly where you went wrong. The Visual Studio compiler will tell you if you make a mistake as you type.

They won't tell you about logic errors though. You have to be careful about those.


Another point: Use some way of creating a debug log. Either write your own implementation which outputs to a text file, as I did with Pascal when I learned that a couple of years ago for school, or use an in built debugging library if there's one available. If you are using Visual Studio, there should be one that comes with it.

Also, be prepared to tear your hair out if your program breaks for seemingly no reason. I once spent two weeks trying to figure out why a (Pascal) program kept throwing segmentation faults when I was deallocating a pretty large amount of memory. The logic looked fine. I never did find out what was causing it. I had to re-write a pretty large part of the code.
Logged
No longer extremely unavailable!
Sig text
ArcTech: Incursus. On hold indefinitely.

cerapa

  • Bay Watcher
  • It wont bite....unless you are the sun.
    • View Profile
Re: Programming course
« Reply #4 on: August 28, 2015, 05:40:52 am »

give me a tip on how to remember so much information.

The answer? Don't.

The correct way to program is with an internet connection, a couple dozen open tabs of the language documentation plus whatever tutorials you are using, and when that doesn't work, you google your problem and find someone who had a similar problem on Stack Overflow. If anyone thinks that you shouldn't do it like that, then they're an idiot with no practical experience.
« Last Edit: August 28, 2015, 05:42:33 am by cerapa »
Logged

Tick, tick, tick the time goes by,
tick, tick, tick the clock blows up.

Arx

  • Bay Watcher
  • Iron within, iron without.
    • View Profile
    • Art!
Re: Programming course
« Reply #5 on: August 28, 2015, 05:47:43 am »

give me a tip on how to remember so much information.

The answer? Don't.

The correct way to program is with an internet connection, a couple dozen open tabs of the language documentation plus whatever tutorials you are using, and when that doesn't work, you google your problem and find someone who had a similar problem on Stack Overflow. If anyone thinks that you shouldn't do it like that, then they're an idiot with no practical experience.

Plus one.

All you really need to memorise is the basic syntax and operations, and a good IDE will tell you if you mess those up. By and large, the memorisation will come with time.
Logged

I am on Discord as Arx#2415.
Hail to the mind of man! / Fire in the sky
I've been waiting for you / On this day we die.

Dutrius

  • Bay Watcher
  • No longer extremely unavailable!
    • View Profile
    • Arcanus Technica
Re: Programming course
« Reply #6 on: August 28, 2015, 06:16:19 am »

Logged
No longer extremely unavailable!
Sig text
ArcTech: Incursus. On hold indefinitely.

gimlet

  • Bay Watcher
    • View Profile
Re: Programming course
« Reply #7 on: August 28, 2015, 12:22:03 pm »

give me a tip on how to remember so much information.

The answer? Don't.

The correct way to program is with an internet connection, a couple dozen open tabs of the language documentation plus whatever tutorials you are using, and when that doesn't work, you google your problem and find someone who had a similar problem on Stack Overflow. If anyone thinks that you shouldn't do it like that, then they're an idiot with no practical experience.

Plus one.

All you really need to memorise is the basic syntax and operations, and a good IDE will tell you if you mess those up. By and large, the memorisation will come with time.
Plus another one.  But at least read through the references once so you get an idea of what all is in there so you know what you can look for, ideally read or skim through it once in a while because as your knowledge grows, you will be able to use more and more things that you didn't know were interesting or important before.  You'll remember the important parts that you use over and over, and know how to look up the rest quickly.
Logged

i2amroy

  • Bay Watcher
  • Cats, ruling the world one dwarf at a time
    • View Profile
Re: Programming course
« Reply #8 on: August 28, 2015, 06:39:35 pm »

Indeed. It's not about remembering everything, it's about remembering the basics and knowing how to quickly look up things that you need (which is why I love cplusplus.com, it's by far the best programming language documentation site I've encountered so far, though Python does come fairly close).

Honestly it's a lot easier than it seems most of the time, or at least is was for me. I'd probably compare the whole thing to a giant math word problem, where you are given a problem and have to break it down into a bunch of tiny logic/math steps. Once you've broken the problem down then it's just a matter of getting it onto paper and you're done. Due to the complexity of the problems, though, I'd highly suggest that you get in the habit of writing out your "answer" as you go, good documentation on what the different parts of a program do is essential as you get to later stages in programming, and good documentation in the code itself is also extremely important. And it doesn't matter if you are the only person intended to use the program, comment it anyways so when you come back in a month you can easily grasp how it works (and if it's for others your graders will love you).

Seriously, the average open source C++ project has 22% of it's lines as comments. That means that for every 4 lines of code you write you should be writing at least 1 line of comments. :P
Logged
Quote from: PTTG
It would be brutally difficult and probably won't work. In other words, it's absolutely dwarven!
Cataclysm: Dark Days Ahead - A fun zombie survival rougelike that I'm dev-ing for.

3man75

  • Bay Watcher
  • I will fire this rocket
    • View Profile
Re: Programming course
« Reply #9 on: August 28, 2015, 08:26:34 pm »

You sound like my teacher i2amroy :p

My school has blessed me with the ability to use free trial software until march or something. Which has given me access to the beloved visual studios 2013. Why not the newer one? I think the converting from compiler to compiler might get annoying. Plus I doubt theirs anything special...anywhoo thanks again to all who have given me advice. May god bless you all.
Logged

Dutrius

  • Bay Watcher
  • No longer extremely unavailable!
    • View Profile
    • Arcanus Technica
Re: Programming course
« Reply #10 on: August 29, 2015, 07:04:55 am »

You can use Visual Studio for free anyway. Both the 2013 and 2015 versions are free.
Logged
No longer extremely unavailable!
Sig text
ArcTech: Incursus. On hold indefinitely.

Thief^

  • Bay Watcher
  • Official crazy person
    • View Profile
Re: Programming course
« Reply #11 on: September 02, 2015, 06:54:39 am »

(which is why I love cplusplus.com, it's by far the best programming language documentation site I've encountered so far, though Python does come fairly close).
http://en.cppreference.com/ is pretty good too.
Logged
Dwarven blood types are not A, B, AB, O but Ale, Wine, Beer, Rum, Whisky and so forth.
It's not an embark so much as seven dwarves having a simultaneous strange mood and going off to build an artifact fortress that menaces with spikes of awesome and hanging rings of death.

Delioth

  • Bay Watcher
  • Mass Gauntlet Wizard
    • View Profile
Re: Programming course
« Reply #12 on: September 02, 2015, 07:34:12 am »

As another note of assistance to anyone with logic errors- flowcharts are your friends. Properly notated flowcharts might as well be code, and writing out what's happening in the whole program beforehand makes it much easier to actually code, especially if you really took the time to break down the problem.

((Note- general programming tip, I'm just starting with C++ too, but we're using a secure shell to a linux server- no fancy compilers here. Python's a breeze though.))
Logged
Help us write a story!
We're currently setting the scene and world- characters, civilizations, flora/fauna, cities, places, anything setting!
Products of my Boredom (Old)
Quote from: Shawtay
Delioth, you sir, are a wonderful, wonderful person.
When in doubt, Apply Magma

Thief^

  • Bay Watcher
  • Official crazy person
    • View Profile
Re: Programming course
« Reply #13 on: September 02, 2015, 11:34:10 am »

Correction: You probably are using a fancy compiler (gcc or clang, at a guess). What you're not using, is an IDE.
Logged
Dwarven blood types are not A, B, AB, O but Ale, Wine, Beer, Rum, Whisky and so forth.
It's not an embark so much as seven dwarves having a simultaneous strange mood and going off to build an artifact fortress that menaces with spikes of awesome and hanging rings of death.

3man75

  • Bay Watcher
  • I will fire this rocket
    • View Profile
Re: Programming course
« Reply #14 on: September 02, 2015, 09:05:53 pm »

By the way i'm still a junior college. Has anyone ever finished a BA or BS for computer science? How much reading do you do in an average week? My friend is a major in international relations and he says that he's reading ~100 pages a day in the beginning week. He's in a tier 1 college currently. I imagine for computer science the work load is that much larger but if I could get some estimates it could help me plan for the future.
Logged
Pages: [1] 2 3