"C" programming

Discussion, in general

Re: "C" programming

Postby Malfeasinator » Fri Apr 13, 2018 5:09 pm

AURORA BOREALIS? AT THIS TIME OF YEAR

no wait

LEARN C? IN SIX WEEKS? NOT GREAT AT COMPUTERS? IN THIS PART OF THE COUNTRY, LOCALIZED ENTIRELY IN YOUR KITCHEN

no wait

I'm trying to get my head around this

breathe, Dan, breathe

Okay. Dude.

*breathes*

Okay.

Listen. Experts can sometimes forget what it was like to be new. You're so new you don't yet know the extent of what you don't know yet. You're going to be gung ho and I mean I know you will really, really give it your all, but you're going to hit a wall. Then you're going to feel stupid (and you're not). Then you're going to feel burned out. Then your dreams are basically going to be crushed.

It will not be good. I've tutored people like this in math who took the 8 week course. They'd be so tired that even if I explained something three or more times, it just wouldn't sink in. Like when you try to ask a little kid who needs a nap to clean up their toys, it's just not happening. I'm not saying you'll be rolling around on the ground throwing a temper tantrum, but it's highly possible.

Six weeks is barely enough time to get a sense of what's really happening. You need time to sleep. You need time to reflect on the things you've learned. The 17 week class is going to be difficult enough.

It seems like anything I try to program will always take 2X what I thought they were going to take, even with conservative estimates. If the Starks had been programmers, their House words would have been "Unforseen Problems Will Emerge." This is made even worse when you're just starting out.
  • 7

User avatar
Malfeasinator
Time Waster
Time Waster
 
Posts: 1039
Joined: Sat Jul 27, 2013 5:17 pm
Location: Florida
Show rep
Title: this guy

Re: "C" programming

Postby cmsellers » Fri Apr 13, 2018 5:28 pm

Malfeasinator wrote:It seems like anything I try to program will always take 2X what I thought they were going to take, even with conservative estimates. If the Starks had been programmers, their House words would have been "Unforseen Problems Will Emerge." This is made even worse when you're just starting out.


Hofstadter's Law wrote:It always takes longer than you expect, even when you take into account Hofstadter's Law.


Bliss's Rule wrote:The formula to translate a programmer estimate into an actual schedule is to double the estimate and then move to the next unit of measure.

1 hour == 2 Days
2 Days == 4 Weeks
1 Week == 2 Months
3 Months == You aren’t going to get it this year. . .and next year is looking iffy
  • 7

User avatar
cmsellers
Back-End Admin
Back-End Admin
 
Posts: 9316
Joined: Sun Apr 14, 2013 7:20 pm
Location: Not *that* Bay Area
Show rep
Title: Broken Record Player

Re: "C" programming

Postby 52xMax » Sat Apr 14, 2018 12:00 am

Then again

Image
  • 3

"When in doubt... well, don't ask me!"
User avatar
52xMax
Knight Writer
Knight Writer
 
Posts: 3058
Joined: Mon Apr 29, 2013 6:38 pm
Location: In all the wrong places.
Show rep
Title: Salmon the Wise

Re: "C" programming

Postby A Combustible Lemon » Sat Apr 14, 2018 6:07 am

Malfeasinator it'll take years to learn C programming, but the six week course will teach you the language and how to use it, and most probably also how to program. It's just not as hard to switch around between languages as people are painting it out to be. As I already pointed out, if you're on the no-languages-at-all level, C is a shitton simpler to learn since it can be split directly into algorithms, control flow and function calls, followed by a much harder half featuring structs, unions and pointers.

Most languages in use today are in the C family and use the same function call syntax, most fors and ifs take after the C variant of fors and ifs, and even the ones that aren't from C are common between languages, so more than half of this will be stuff that's completely generic. And the second half is super important because memory models are really underemphasised in programming. Java wants to say it doesn't use structs and pointers just because it doesn't use the virtual table, but that's just not true. Java references are only barely not pointers, and there's really no way to actually put giant structs on the call stack without heap allocations anyway. First Class objects are just an easier way of doing the exact same thing, and as any experienced programmer will tell you "Learn the hard way first and use the easier way to save time".

On the whole, the C++ way of doing something:
Code: Select all
struct Counter {
   int count = 0;
   
   Counter(int i);
   ~Counter();
   
   int advance();
}

Counter::Counter(int i)  {
      count = i;
   }

Counter::~Counter() {
   }

int Counter::advance() {
      return count++;
   }

is pretty much identical to the C way of doing the exact same thing:
Code: Select all
struct Counter {
   int count;
};

Counter *makeCounter(int i) {
   Counter *rt = malloc(sizeof(Counter));
   rt->count = i;
   return rt;
}

int deleteCounter(Counter *counter) {
   free(counter);
}

int advance(Counter *counter) {
   return counter->count++;
}


and Java's no less complex either

Code: Select all
public class Counter
{
    int count;

    public Counter()
    {
   count = 0;
    }
   
    public Counter(int i)
    {
   count = i;
    }

   public int void advance()
    {
   return count++;
    }
}
  • 5



WE ARE ALL FLOATING IN THE WINDS OF TIME. BUT YOUR CANDLE WILL FLICKER FOR SOME TIME BEFORE IT GOES OUT -- A LITTLE REWARD FOR A LIFE WELL LIVED. FOR I CAN SEE THE BALANCE AND YOU HAVE LEFT THE WORLD MUCH BETTER THAN YOU FOUND IT, AND IF YOU ASK ME, said Death, NOBODY COULD DO ANY BETTER THAN THAT...
User avatar
A Combustible Lemon
TCS Regular
TCS Regular
 
Posts: 486
Joined: Thu Sep 25, 2014 7:25 pm
Location: The Internet, India
Show rep
Title: Grenadier

Re: "C" programming

Postby satan_n_stuff » Sun Apr 15, 2018 12:05 pm

Windy wrote:Learn high level languages first, then work your way down to machine code.

:roll:
Unless you like the idea of optimizing for every possible combination of hardware, stay the hell away from machine code. We have compilers for a reason.
  • 2

Image
"edit: satan_n_stuff beat me to it " was also the entry god made in his journal after "tomorrow I'll make animals for Australia" - Flotze
"But you're beautiful Satan. You can do modeling or porn or something." - cmsellers
User avatar
satan_n_stuff
Frequent Poster
Frequent Poster
 
Posts: 234
Joined: Wed Nov 18, 2015 3:24 pm
Show rep
Title: The Dark One

Previous

Who is online

Users browsing this forum: No registered users and 25 guests