• Hey, guest user. Hope you're enjoying NeoGAF! Have you considered registering for an account? Come join us and add your take to the daily discourse.

Programming |OT| C is better than C++! No, C++ is better than C

injurai

Banned
As a thought experiment, I wonder what would happen if you took the reverse approach. Only teach pointers right from day 1. You want to read two numbers and add them? Well, make 2 int*'s, new them both, read their values, print the result, then delete them. You wouldn't have to explain what the news and deletes were for, similar to how you don't really explain why you have to type int main(int argc, char **argv) to someone starting out. Just say that's how you make variables. Then, 3 months down the line, say "oh, by the way. Here's a neat little trick. If you don't use the *, you can skip all that new / delete stuff".

Reminds me of the way I was taught calculus. You learn derivatives the "hard way" with differential forms, then they teach "oh yea, you can actually just subtract 1 from the exponent and multiply by the coefficient".

This is genius. I am a big fan of learning things the hard way. Always. It's my number 1 gripe with my CS program. The stuff I wanted and was ready to do, was the stuff it took until my junior year to get to. These programs are designed just as farming houses to produce java monkeys, and I have hated it since the beginning. They also teach you a bunch of algorithm theory before you even touch systems programming, so you don't have a good hands on way of practicing the theory that you learn.

I still don't know how to distribute a java project to anyone that doesn't have the jdk and same ide installed. The tendency to lean on abstraction is a crutch that I feel only hurts developers from full learning the foundation of what they are using.
 

tokkun

Member
The thing about C++ books in an academic context is that teaching C++ from the ground up is kind of anachronistic these days. The majority of programs transitioned away from teaching C or C++ to Java as a first HLL a while ago, and the transition is now underway to Python. A lot of programs never teach C, or if they do it is part of an OS or architecture course rather than one focused on software design.

At this point, it is probably more realistic to assume that the majority of people reading a C/C++ book already know some other language first. For those people, teaching the basics of programming is a waste of time, and it makes sense to quickly get into the things that make C/C++ different.
 

injurai

Banned
Solid points Tokkun. I'm pretty staunch that python is one of the worst first introductions to programming. Honestly I think the best way to introduce someone would be to command line java project management, and programming. Then move them to the graphical, ide style of development. That way less magic is happening behind the scenes.
 

GK86

Homeland Security Fail
Is 4gb of ram enough for programming? Or should I aim for 8gb?

Edit - This would be for a laptop. Not upgradeable.
 
Solid points Tokkun. I'm pretty staunch that python is one of the worst first introductions to programming. Honestly I think the best way to introduce someone would be to command line java project management, and programming. Then move them to the graphical, ide style of development. That way less magic is happening behind the scenes.

I don't understand this line of thinking. Python is a good intro because syntactically it's extremely simple and let's you focus on learning the cores to programming. Things like assignment, functions, classes/inheritance, loops, recursion, etc without being bogged down by remembering a bunch of steps (compare creating a simple function to print a statement in Java vs Python).

Then when they know that stuff transitioning to other languages is just a matter of learning new syntax. I will say, dynamic typing is one thing that might trip people up going from python to some other languages, but it's a fairly simply thing to grasp

And this is coming from a person who started with Java
 

survivor

Banned
Wonder if my school will ever ditch teaching C as intro programming language for all engineers with the exception of software, computer and CS (these three majors take 2 Java intro courses instead). All my friends from other engineering programs who had to take the C course kept complaining about it and they never once had to use the language in later courses. Infact Java and Matlab was used more by them later on.

Is 4gb of ram enough for programming? Or should I aim for 8gb?

Edit - This would be for a laptop. Not upgradeable.
I like 8GB which is what I have for my laptop. More future proof, and gives you more flexibility if you wanna play around with VMs or whatever programming area you wanna dive into.
 

tokkun

Member
I don't understand this line of thinking. Python is a good intro because syntactically it's extremely simple and let's you focus on learning the cores to programming. Things like assignment, functions, classes/inheritance, loops, recursion, etc without being bogged down by remembering a bunch of steps (compare creating a simple function to print a statement in Java vs Python).

Then when they know that stuff transitioning to other languages is just a matter of learning new syntax. I will say, dynamic typing is one thing that might trip people up going from python to some other languages, but it's a fairly simply thing to grasp

And this is coming from a person who started with Java

One of the things you learn when you get into education is that individuals have their own preferred learning styles. The one you are seeing on display here is top-down vs bottom-up. Injurai sounds like he/she is a bottom-up learner - someone who prefers to understand things at an atomic level and gradually combine low-level concepts to form high-level ones. Other people are top-down learners, and prefer to understand the context and use cases of information before they drill down to understand the details of its implementation.

I think historically most STEM subjects have been taught in the bottom-up approach (basically influenced by Euclid's approach to teaching geometry from first principles). The movement toward Python reflects a pushback from students who complain that it takes too long to do anything tangible in their courses and concern that this is leading to students dropping out or transfering to other majors. You see the same thing with "Intro to Engineering" courses in a lot of schools these days, where they have freshman-level classes that are focused on simple, hands-on design. There is a lot more concern about attrition in STEM fields these days due to political pressure to produce more graduates for the job market, so I expect to see the top-down approach to stay en vogue until we start getting pushback in the opposite direction where we are graduating too many manager-type engineers who are weak in theory and fundamentals.

To be honest, though, it may be a simple fact that we are at a point where the world needs more people with a broad understanding of a lot of languages at a high level rather than people with a deep understanding of a few languages at a low level. The last company I was at preached an "85/15" rule that stated that only 15% of the engineers needed to understand how to write performant code, and the other 85% just had to understand how to interface to it.
 

wolfmat

Confirmed Asshole
Solid points Tokkun. I'm pretty staunch that python is one of the worst first introductions to programming. Honestly I think the best way to introduce someone would be to command line java project management, and programming. Then move them to the graphical, ide style of development. That way less magic is happening behind the scenes.

Python gets you going fast, so that's good, but more to-the-metal languages like C or whatever build better grounds for when things get performance-oriented enough to be in the low-level-understanding realm.

Trying to say it's not black and white. Depends on what you want to be in 10 years, I'd say. If you want to go places, you're better off starting with low-level languages. If you want to get stuff done, you might end up being happier with Python. Or VBA, for that matter -- gets stuff done in Excel, which is good if you're in Excel all the time, right?

Regarding command line development, Python is just as programmable in that environment as Java is, so I don't think that's a proper reason to pick one or the other, regardless of whether you're a beginner or not.

Java is much more strict regarding its structure, whereas Python lets you go crazy. You'll have a harder time working sans OOP in Java for sure. I'd say that could be construed as an argument against Java, in fact.

Java might be more suited for beginners because there's decades of material for getting beginners going in the language. Python is sort of "here's how you get shit done now go crazy" when it comes to related education material online. Might be construed against Python, surely.

Anyway, hard to recommend either language for beginners without being unfair to the other one. I like Java, I like Python. Both are sound in design. Both are weird when things get tough. Both are rather high-level, so they make it easier to "get" project-thinking, and they both promote "implemented elsewhere" well; but on the other hand, both make it hard to "get" the under-the-hood things, like for example data structure alignment, or the fine culture of letting go of memory early; stuff like that.

I'd probably recommend a coin toss if Python and Java are the only options. You'll learn good stuff in both cases for sure.
 
I don't understand this line of thinking. Python is a good intro because syntactically it's extremely simple and let's you focus on learning the cores to programming. Things like assignment, functions, classes/inheritance, loops, recursion, etc without being bogged down by remembering a bunch of steps (compare creating a simple function to print a statement in Java vs Python).

Then when they know that stuff transitioning to other languages is just a matter of learning new syntax. I will say, dynamic typing is one thing that might trip people up going from python to some other languages, but it's a fairly simply thing to grasp

And this is coming from a person who started with Java
Yeah, Java is very unlike other programming languages in that there's a extremely large ecosystem of IDEs and build systems based on it.

Much of what's out there to assist Java programmers is specifically made to keep them from doing command line Java. It's what I've seen in large scale shops that do most of their work in Java, like Oracle. And many people who are drawn to the Java ecosystem prefer it for the IDEs that, in their words, do most of the work for them. I know hardware guys who wouldn't touch anything else in software programming because they like IntelliJ that much. But then, those few folks I know in hobbyist hardware prefer not to do much software programming at all. :)

I don't think that has much to do with teaching Python as a first language, it's just how Java has grown up as a programming environment. The IDE and build system ecosystems are mature enough that most people who "know Java" don't really know how to use it outside of an IDE like Eclipse, NetBeans, and IntelliJ, and Maven for project management. And Hudson/Jenkins for automated builds of all kinds.
 

NotBacon

Member
I don't understand this line of thinking. Python is a good intro because syntactically it's extremely simple and let's you focus on learning the cores to programming. Things like assignment, functions, classes/inheritance, loops, recursion, etc without being bogged down by remembering a bunch of steps (compare creating a simple function to print a statement in Java vs Python).

Then when they know that stuff transitioning to other languages is just a matter of learning new syntax. I will say, dynamic typing is one thing that might trip people up going from python to some other languages, but it's a fairly simply thing to grasp

And this is coming from a person who started with Java

I think it depends on the method of teaching.
Do you want them to pick up general syntax really quickly, or do you want them to understand what the hardware is doing, or do you want them to understand the notion of projects first? etc.

Is 4gb of ram enough for programming? Or should I aim for 8gb?
Edit - This would be for a laptop. Not upgradeable.

Obligatory "real programmers program on 4kb of vram"

4gb is fine, 8gb is better, an SSD is the best.

Not the same component, but SSD will make a far far greater impact on development than 4gb more of RAM.
 
I'd probably recommend a coin toss if Python and Java are the only options. You'll learn good stuff in both cases for sure.
I tend to lean towards Python and JavaScript based on what I've seen in terms of progress in the Java language.

JavaFX is kind of a non-starter, and it has been for some time as the "next gen" GUI programming framework. Swing is still the preferred GUI programming framework and it's still awful. I don't care as much about things like lambdas, they're not necessary, but the GUI programming story makes me lean towards other options for beginners who want to make a long term investment in a given language.

Python has some neat infrastructure for getting simple games up and running, like RenPy and PyGame. And I like how comprehensive its standard library happens to be with many everyday programming tasks.

JavaScript, there's enough inertia behind it and most modern JS frameworks are setting their sights on more important, modern programming concepts like run loop management and event handling. And there's nothing that beats the ease of access of having a text editor + a browser on every computer.
 

wolfmat

Confirmed Asshole
I tend to lean towards Python and JavaScript based on what I've seen in terms of progress in the Java language.

Yeah well, if you want to promote progressive programming, where the fastest-evolving language wins, I'd probably also hold JS high, especially if you think about advanced stuff like nodejs or whatever, which totally just gets. you. a. job. if you have competence there.

You just have to get over classic awfulness like
Code:
> '10' + 1
"101"
> '10' - 1
9
 
Yeah well, if you want to promote progressive programming, where the fastest-evolving language wins, I'd probably also hold JS high, especially if you think about advanced stuff like nodejs or whatever, which totally just gets. you. a. job. if you have competence there.

You just have to get over classic awfulness like
Code:
> '10' + 1
"101"
> '10' - 1
9
I'm not quite sure what you're getting at, besides that no programming language is perfect. Java and Python have their bad points too, but I'm not going to get into PL wars about it.

Related.
 

wolfmat

Confirmed Asshole
I'm not quite sure what you're getting at, besides that no programming language is perfect. Java and Python have their bad points too, but I'm not going to get into PL wars about it.

Related.

Not getting at anything in particular. It's just one of the funnier things in JS.

Python for example has stuff like that as well, of course:
Code:
In [1]: def poop(*args):
     for arg in args:
         print(arg)
         

In [2]: 

In [2]: poop("eins", "zwei")
eins
zwei

In [3]: poop("eins" "zwei") # Forgetting the comma can lead to weirdness and almost untraceable bugs
einszwei
 

injurai

Banned
Tokkun is spot on in his assessment of me. I think I actually discovered my preference for low level stuff in college. Partly because I felt like it took a long time for someone to give me a good insight into the reality of the systems I was programming on. Never mind the majority of the higher level stuff had proven thus far to be just as fruitless in what I could create with it. It wasn't until after my systems and OS classes that I finally did what I would consider a valuable higher level project. Which was an XNA/C# project that focused on design patterns. Well it was team oriented so I still ended up losing sight of the overall project structure. But I made my component modular and extensible as fuck.

Like Jonathan was saying though, Java has this whole structure built up around it. The IDE's, Maven, etc. I just find it to be in large unnecessarily cumbersome for anything that isn't a personal pet project. Trying to do anything serious that could be distributed in a portfolio has only caused me more frustration than it was worth. Because I didn't have that bottom up experience with java, I felt left to the wind. While with the C# project the whole point was to take C#/XNA as the foundation and work up from there. Different motivation, the take away was the experience of structuring a project. Not all the other bookkeeping that one might find them dealing with out of necessity.

One of my favorite experiences that combined low level and higher level IDE development was using C to program FPGA's. It was for an electrical course, and it involved writing to live memory. That's the type of stuff I feel is far more valuable in uniting high level with low level. I never see the "whole stack" of Java development touched on.

I think I would prefer a stalagmite/stalactite approach. Where you work your way to the center. But that seems hardly touched upon ever.
 
I'm also a low level person, always have been. I feel like the industry is moving more towards high level stuff, and the low level guys like myself are a dying breed. So I guess in 15 years I'll either be out of a job, or I'll be in huge demand because there won't be many people left.
 
I'm also a low level person, always have been. I feel like the industry is moving more towards high level stuff, and the low level guys like myself are a dying breed. So I guess in 15 years I'll either be out of a job, or I'll be in huge demand because there won't be many people left.
I've heard a sentiment, that there's more programmers than ever but few who are especially good at it, especially when it comes to getting close to bedrock.


A few personal anecdotes;

1) My grandfather, who once worked on the B5000 project*, tells me that he look a look at the less ambitious high-level languages of the 70s like C (BCPL) and thought they were really stupid. That high level languages like that had no chance of beating out closer to metal assembly, even though C didn't deviate far from assembly best practices.

This was also before RISC became a hardware trend and Intel's then-unusual brand of CISC wasn't even close to an industry standard, so hand-written assembly was a bit more elegant back then compared to the machine generated stuff we see out of compilers today.

The last time I saw him, I showed him a few articles about LLVM and the always changing LLVM IR, and he was absolutely blown away by how far compilers have come to generating good, efficient code.

2) Counter to that, we're in a situation where we are building on many layers of programming stuff, all of which are varying levels of less than perfect.

The higher up you go, the more likely you are to trip over something dumb. Worse, people who only work that high up are not likely to have an inkling as to why things were built that way, farther down. The law of leaky abstractions at work.


I think the market for people closer to metal may shrink slowly, but the demand for people who really know their stuff will continue to grow.

The catch is, it may mean having to spend some time with a language that was absolutely not developed in an ivory tower like JavaScript. To keep your head in what's going on in the industry at large, or to build solutions that higher level programmers are more likely to use.

JavaScript and OpenGL are kind of proof positive that competition in the industry and decisions made by standards bodies will not generate great products. But until we get to that kinder, loving industry that respects better architecture over marketable things and petty junk that's good enough to ship, this is the state of humanity that we're stuck with today.


* -
You have no idea how delighted I was that Shin Megami Tensei IV's AI assistant is named Burroughs. That was the first sign I was going to really enjoy that game.
 

injurai

Banned
I think the market for people closer to metal may shrink slowly, but the demand for people who really know their stuff will continue to grow.

The catch is, it may mean having to spend some time with a language that was absolutely not developed in an ivory tower like JavaScript. To keep your head in what's going on in the industry at large, or to build solutions that higher level programmers are more likely to use.

JavaScript and OpenGL are kind of proof positive that competition in the industry and decisions made by standards bodies will not generate great products. But until we get to that kinder, loving industry that respects better architecture over marketable things and petty junk that's good enough to ship, this is the state of humanity that we're stuck with today.

I can totally understand why low level stuff has lost it's placed in much of the industry. It's just not applicable to delivering results in time frames. It's especially not good for creating extensible codes bases. My bias for low level stuff certainly comes from academia cathedral style development. And yeah I do tend towards those ivory towers like haskell.

I really hope Rust ends up taking off, because for the most part. I enjoy static typed, compiled languages. Who knows if it will take off but it's the shift in low level programming that I would like to see. In my mind it's still just above assembly, and ends up painting C more as syntactic sugar for assembly.

You mention OpenGL, and just this week we are hearing about Vulkan. Which is once again another shift in the industry to lift itself up by it's bootstraps with it's newly acquired hindsight.

Both of these are in my mind attempts to remedy the foundations of computer science with something better. In hopes that our imperfect sloppy higher level noodling will now be even more powerful than it was last decade. Then the cycle will repeat and newer and improved foundations will be laid.
 
JS is amazing in how damn versatile it became.

That's all I have to contribute. Learning JS will eventually become required at some point in life I think (okay exaggerating but you catch my drift).

It's a fun language, I like it well enough even though I'm no guru.
 

Ledbetter

Member
So I was trying to implement merge sort in a linked list using this in C++:

Code:
void List::Mergesort(Node** headRef){
    Node* head = *headRef;
    Node* a;
    Node* b;

    if (head == nullptr || ancla->getNext() = nullptr){
        return;
    }

    /* Split head into 'a' and 'b' sublists */
    FrontBackSplit(head, &a, &b);

  /* Recursively sort the sublists */
    Mergesort(&a);
    Mergesort(&b);

  /* answer = merge the two sorted lists together */
    *headRef = SortedMerge(a, b);
}

void List::FrontBackSplit(Node* source, Node** frontRef, Node** backRef){
  Nodo* fast;
  Nodo* slow;
  if (source->getNext()==nullptr){
    // length < 2 cases 
    *frontRef = source;
    *backRef = nullptr;
  }
  else
  {
    slow = source;
    fast = source->getSiguiente();

    /* Advance 'fast' two nodes, and advance 'slow' one node */
    while (fast->getNext() != nullptr)
    {
      fast = fast->getNext();
      if (fast->getNext() != nullptr)
      {
        slow = slow->getNext();
        fast = fast->getNext();
      }
    }

    *frontRef = source;
    *backRef = slow->getNext();
    slow->setNext(nullptr);
  }
}

Node* List::SortedMerge(Node* a, Node* b){
  Nodo* answer = nullptr;

  /* Base cases */
  if (a == nullptr)
     return(b);
  else if (b==nullptr)
     return(a);

  if (a->getElement().name > b->getElement().name){
     answer = a;
     answer->setNext(SortedMerge(a->getNext(), b));
  }
  else{
    answer = b;
    answer->setNext(SortedMerge(a, b->getNext()));
  }
  return(answer);
}

I used letters to see if it works, for example: the original list is Z->C->M->A. But when I sort the list it gives me back A->M->C->Z. And then if I sort again I get back the original list. I don't know in which part of my implementation I'm doing something wrong. Sorry for the long code.
 
So I was trying to implement merge sort in a linked list using this in C++:

I used letters to see if it works, for example: the original list is Z->C->M->A. But when I sort the list it gives me back A->M->C->Z. And then if I sort again I get back the original list. I don't know in which part of my implementation I'm doing something wrong. Sorry for the long code.

Try using only 2 letters as input. A->Z. Much easier to find the bug this way, because you don't have to worry about recursion at all. What OS are you on? You could also try running it under a debugger. Should allow you to figure out the problem very quickly.

BTW: What's the data type of Node::Element::name?

Also, I think there is a bug here:

Code:
    slow = fuente;
    fast = fuente->getSiguiente();

    /* Advance 'fast' two nodes, and advance 'slow' one node */
    while (fast->getNext() != nullptr)
    {
      fast = fast->getNext();
      if (fast->getNext() != nullptr)
      {
        slow = slow->getNext();
        fast = fast->getNext();
      }
    }

imagine the situation where you have
Code:
| node | next | next2 | nullptr |
You will start with slow = node, fast = next. You enter the while loop, and now fast = next2. Since next2->getNext() == nullptr, you won't enter the if statement, and you won't execute the while loop again either. You end now with slow = node, fast = next2. So fast is 2 nodes ahead of slow.
 

Ledbetter

Member
Try using only 2 letters as input. A->Z. Much easier to find the bug this way, because you don't have to worry about recursion at all. What OS are you on? You could also try running it under a debugger. Should allow you to figure out the problem very quickly.

BTW: What's the data type of Node::Element::name?

Also, I think there is a bug here:

imagine the situation where you have
Code:
| node | next | next2 | nullptr |
You will start with slow = node, fast = next. You enter the while loop, and now fast = next2. Since next2->getNext() == nullptr, you won't enter the if statement, and you won't execute the while loop again either. You end now with slow = node, fast = next2. So fast is 2 nodes ahead of slow.

Alright. So I put the slow = slow->getNext(); outside the if statement so the list splits how it should. I tried Z->A, sort once and I get A->Z but sort again and I get the original.

I'm on Windows using Code::Blocks, I don't know how to use the debugger but I will look up how to do so. The data type is char name[25], because I'm working with fixed lenght records (File structures).

Thanks!

Edit: So I realize that I have to use strcmp(a->getElement().name,b->getElement().name) < 0) instead of comparing with just the > operator. Now it works perfectly.
 
Alright. So I put the slow = slow->getNext(); outside the if statement so the list splits how it should. I tried Z->A, sort once and I get A->Z but sort again and I get the original.

I'm on Windows using Code::Blocks, I don't know how to use the debugger but I will look up how to do so. The data type is char name[25], because I'm working with fixed lenght records (File structures).

Thanks!

Edit: So I realize that I have to use strcmp(a->getElement().name,b->getElement().name) < 0) instead of comparing with just the > operator. Now it works perfectly.

Yep, that was my first guess. The reason I asked about the type is because your list contained only single letters, so it might have been a char, in which case it would have worked and the bug was somewhere else.

By the way, debuggers are your best friend. Not sure about Code::Blocks, but in visual studio press f9 to set a breakpoint, then f5 to run. You can then step over, into, or out of functions with toolbar items, and use the watch window to view the value of variables at each line. Using this you can quickly find the exact line that the code strays from the behavior you expected. Of course there's lots more you can do too, but that's the basic idea.
 

upandaway

Member
Personal projects count! They count quite a bit. Don't feel intimidated or that you must do big OSS blah blah, just showing that you can code things good makes a super big difference and it really matters. Like, it is hard enough as it is to find people who can write anything usable, to begin with.

If you'd like to describe the repos, that would help. At least, it would provide context if you don't have blog posts or READMEs that can explain it to a not-technical person. I guarantee you that the HR people who will be the first to look at this aren't very technical people.
Thanks a bunch, just finished uploading everything (if you're curious, here), wrote the resume with a bit about each of them, will hope for the best.
 

wolfmat

Confirmed Asshole
I gotta say, for someone who's been in the field for quite some years, and then seeing the youngens pushing everything up to bitbucket et cetera as a portfolio of sorts, it's a bit frustrating because there's just no way I can put in the time for that while working. So if it's time to switch jobs at some point, all I can put on the table as a portfolio right now is the old shit from when I was young, which absolutely doesn't match my actual experience level, and work stuff, which is confidential in terms of code (I may only present concepts, snippets and architecture).

The issue then arises that if the first guy who looks at my portfolio is just some HR guy, he can't really evaluate my expertise properly without just trusting in me, and on the other hand, he's got all the cool repos from the kids out there with flashing icons and whatnot. So chances are I'm not gonna be the trivial choice from that perspective if the stars do not align.

Not a superbig deal, because it really isn't all about raw code, there's also ability to work in a team, general charisma, fast thinking, good problem-solving skills and all. But those are just factors if you get to the stage where you talk to a person.

I guess times have changed. I might have to put good private code on the internet at some point, like the kids. I wish the day had 48 hours.
 
I gotta say, for someone who's been in the field for quite some years, and then seeing the youngens pushing everything up to bitbucket et cetera as a portfolio of sorts, it's a bit frustrating because there's just no way I can put in the time for that while working. So if it's time to switch jobs at some point, all I can put on the table as a portfolio right now is the old shit from when I was young, which absolutely doesn't match my actual experience level, and work stuff, which is confidential in terms of code (I may only present concepts, snippets and architecture).

The issue then arises that if the first guy who looks at my portfolio is just some HR guy, he can't really evaluate my expertise properly without just trusting in me, and on the other hand, he's got all the cool repos from the kids out there with flashing icons and whatnot. So chances are I'm not gonna be the trivial choice from that perspective if the stars do not align.

Not a superbig deal, because it really isn't all about raw code, there's also ability to work in a team, general charisma, fast thinking, good problem-solving skills and all. But those are just factors if you get to the stage where you talk to a person.

I guess times have changed. I might have to put good private code on the internet at some point, like the kids. I wish the day had 48 hours.

Your resume is your portfolio. If you're competing over jobs with people where you think them having a portfolio vs. you not having a portfolio is going to make a difference, then I would argue that you're selling yourself short, and not setting your sights high enough.
 

upandaway

Member
I gotta say, for someone who's been in the field for quite some years, and then seeing the youngens pushing everything up to bitbucket et cetera as a portfolio of sorts, it's a bit frustrating because there's just no way I can put in the time for that while working. So if it's time to switch jobs at some point, all I can put on the table as a portfolio right now is the old shit from when I was young, which absolutely doesn't match my actual experience level, and work stuff, which is confidential in terms of code (I may only present concepts, snippets and architecture).

The issue then arises that if the first guy who looks at my portfolio is just some HR guy, he can't really evaluate my expertise properly without just trusting in me, and on the other hand, he's got all the cool repos from the kids out there with flashing icons and whatnot. So chances are I'm not gonna be the trivial choice from that perspective if the stars do not align.

Not a superbig deal, because it really isn't all about raw code, there's also ability to work in a team, general charisma, fast thinking, good problem-solving skills and all. But those are just factors if you get to the stage where you talk to a person.

I guess times have changed. I might have to put good private code on the internet at some point, like the kids. I wish the day had 48 hours.
Isn't experience in a whole other tier of importance though? I'd rather pick someone who worked for a month than myself, nevermind a couple of years. Anyone who studied Java in high school can piece together an open source library to create a Bejeweled clone or whatever I see on any of my friends' gits.

Hell you don't even need high school, there are youtube videos that guide you through it. I can't imagine anyone will hire people like that over people who know what they're doing.
 

wolfmat

Confirmed Asshole
Your resume is your portfolio. If you're competing over jobs with people where you think them having a portfolio vs. you not having a portfolio is going to make a difference, then I would argue that you're selling yourself short, and not setting your sights high enough.
The thing is that under some circumstances, it's not the best choice to set sights high. So for instance, if the job market in your area does not offer positions at a level where experience is key, and you can't really move without disrupting your quality of life significantly, then you're doomed to compete on that level.
I mean, that's not what I fear, but I'm just saying... Imagine all you can get in the area is a web developer frontend gig, and moving 200km away destroys the relationship with the girlfriend. Reason enough to compete on exactly that level.
Isn't experience in a whole other tier of importance though? I'd rather pick someone who worked for a month than myself, nevermind a couple of years.
It depends on the business you're talking to. Fast-expanding small houses with little to lose might hire first and ask questions later, and a year later, they're stuck with a guy. I've seen it happening. You'll see students who somehow sorta slipped into the job and are kept on staff although they're incompetent, that while experienced developers can be hired for the same wages.

Also, what's not being mentioned here for a variety of reasons: Being able to get stuff up and running fast is important to decision makers in young businesses. The ability to mature a concept, keep a project alive, bring it to the next level in terms of growth and such, that's necessary once it's rolling. Github profiles with like 15 projects on them suggest that the guy behind that can just shit out one project after another. So if growth and see-what-sticks mentality is what the business is about, it's not really that clear-cut.
 
Hey guys, I've been lurking for a couple of months.

I'm job hunting for the first time in my life after graduating last December, and to my horror I've just found out that programming portfolios are really that important, and I'm panicking hard because I'm afraid I don't really have anything exciting to show off.

The best thing I've done was during an internship, so I can't show that code (Well, has anyone tried to ask their previous employer for permission, maybe hiding the code behind a password or something?). I've got a couple of class projects that also are interesting, but I don't really have any "personal projects that show off my interests". I got really great grades, but I'm not even sure what would be the equivalent to my degree in the UK (I think it's Computer Science Engineering, it's a 5 year degree and from what I read it would be something like a BSc + MSc), so I don't really want to boast about it since I may be misleading someone because I don't really have a Master's, for example.

Anyways, what I wanted to ask is, is it really important to have many different projects, or uploading two or three non-trivial ones would be enough? Do HR people really look through code? (I'm asking because I guess I'll have to translate my comments to English, then). Also, could anyone PM their portfolio website or link some good looking ones? I need to work on that ASAP, and although I've been seeing some examples online I would like to see some that really helped someone get a job.

Thanks!
 

tokkun

Member
I'm also a low level person, always have been. I feel like the industry is moving more towards high level stuff, and the low level guys like myself are a dying breed. So I guess in 15 years I'll either be out of a job, or I'll be in huge demand because there won't be many people left.

The Internet of Things(tm) will probably keep the market for low level programmers healthy for a while more due to the focus on hardware cost and energy efficiency.

One my friends used to work at a contract house for embedded software design, and he would be working on stuff like automatic paper dispensers for public restrooms. That kind of stuff is not going to support interpreted languages or garbage collection any time soon.
 
Hey guys, I've been lurking for a couple of months.

I'm job hunting for the first time in my life after graduating last December, and to my horror I've just found out that programming portfolios are really that important, and I'm panicking hard because I'm afraid I don't really have anything exciting to show off.
Ah, don't worry. You can build that stuff up naturally in your spare time, if you'd like. Even just a few things where you can do the unexpected, or just something that looks challenging, or just something astoundingly practical and useful, or just something that's competently written and runs, that should be enough.

The best thing I've done was during an internship, so I can't show that code (Well, has anyone tried to ask their previous employer for permission, maybe hiding the code behind a password or something?).
Yes. With a small shop, they were okay with sharing it for interviews. Asking's fine, worst thing that can happen is they say no.

I've got a couple of class projects that also are interesting, but I don't really have any "personal projects that show off my interests". I got really great grades, but I'm not even sure what would be the equivalent to my degree in the UK (I think it's Computer Science Engineering, it's a 5 year degree and from what I read it would be something like a BSc + MSc), so I don't really want to boast about it since I may be misleading someone because I don't really have a Master's, for example.

Anyways, what I wanted to ask is, is it really important to have many different projects, or uploading two or three non-trivial ones would be enough?
Two or three sounds good, yeah.

Do HR people really look through code? (I'm asking because I guess I'll have to translate my comments to English, then).
They can forward your resume to an engineer that knows their stuff if it looks interesting to them. I doubt the HR folk will judge you for comments and spacing.
 
Hey guys, I've been lurking for a couple of months.

I'm job hunting for the first time in my life after graduating last December, and to my horror I've just found out that programming portfolios are really that important, and I'm panicking hard because I'm afraid I don't really have anything exciting to show off.

The best thing I've done was during an internship, so I can't show that code (Well, has anyone tried to ask their previous employer for permission, maybe hiding the code behind a password or something?). I've got a couple of class projects that also are interesting, but I don't really have any "personal projects that show off my interests". I got really great grades, but I'm not even sure what would be the equivalent to my degree in the UK (I think it's Computer Science Engineering, it's a 5 year degree and from what I read it would be something like a BSc + MSc), so I don't really want to boast about it since I may be misleading someone because I don't really have a Master's, for example.

Anyways, what I wanted to ask is, is it really important to have many different projects, or uploading two or three non-trivial ones would be enough? Do HR people really look through code? (I'm asking because I guess I'll have to translate my comments to English, then). Also, could anyone PM their portfolio website or link some good looking ones? I need to work on that ASAP, and although I've been seeing some examples online I would like to see some that really helped someone get a job.

Thanks!

Have you considered jumping into some open source projects?
 
JS is amazing in how damn versatile it became.

That's all I have to contribute. Learning JS will eventually become required at some point in life I think (okay exaggerating but you catch my drift).

It's a fun language, I like it well enough even though I'm no guru.
Oh yes, there's some really interesting people who have been involved in the ECMAScript 6 spec, like longtime Smalltalk-80 expert Allen Wirfs-Brock (recent talk, also history lesson).

It's in better hands than it was in the Netscape/IE days. That much is certain.
 

OlympicTechno

Neo Member
What would be the best way to implement a GUI within a webpage? I have began implementing it with Javascript but it is becoming tiresome and I'm just wondering if there is a better way to do it?

I'm basically creating a GUI of a restaurant seating layout in which users can choose the table they wish to book after giving details of their booking such as time, date etc.

Thanks!
 

Megasoum

Banned
Hey guys so I decided to finally start learning C# a couple of days ago...

I have a bit of C++ history but that was over 10 years ago so..yeah..

Anyway I've started working on a simple windows form app using the BackgroundWorker class but for some reason I can'T even get the MSDN example to run lol... I'm not getting any errors when compiling, it just never goes in the DoWork function.

Anybody has an idea?

I just have a form with 2 buttons (start/stop), a label and the backgroundWorker1 component.

If I use a breakpoint I can see it go in StartButton_Click and run through RunWorkerAsync but it never actually goes in DoWork.

Code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace FreeSpace
{
    public partial class Form1 : Form
    {

        bool isActive = false;
     

        public Form1()
        {
            InitializeComponent();
            backgroundWorker1.WorkerReportsProgress = true;
            backgroundWorker1.WorkerSupportsCancellation = true;
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }

        private void StartButton_Click(object sender, EventArgs e)
        {
            if (backgroundWorker1.IsBusy != true)
            {
                // Start the asynchronous operation.
                backgroundWorker1.RunWorkerAsync();
            }
        }

        private void StopButton_Click(object sender, EventArgs e)
        {
            if (backgroundWorker1.WorkerSupportsCancellation == true)
            {
                // Cancel the asynchronous operation.
                backgroundWorker1.CancelAsync();
            }
        }

        private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
        {
            BackgroundWorker worker = sender as BackgroundWorker;

            for (int i = 1; i <= 10; i++)
            {
                if (worker.CancellationPending == true)
                {
                    e.Cancel = true;
                    break;
                }
                else
                {
                    // Perform a time consuming operation and report progress.
                    System.Threading.Thread.Sleep(500);
                    worker.ReportProgress(i * 10);
                }
            }
        }

        // This event handler updates the progress. 
        private void backgroundWorker1_ProgressChanged(object sender, ProgressChangedEventArgs e)
        {
            StatusLabel.Text = (e.ProgressPercentage.ToString() + "%");
        }

        // This event handler deals with the results of the background operation. 
        private void backgroundWorker1_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            if (e.Cancelled == true)
            {
                StatusLabel.Text = "Canceled!";
            }
            else if (e.Error != null)
            {
                StatusLabel.Text = "Error: " + e.Error.Message;
            }
            else
            {
                StatusLabel.Text = "Done!";
            }
        }


    }
}
 
Hey guys so I decided to finally start learning C# a couple of days ago...

I have a bit of C++ history but that was over 10 years ago so..yeah..

Anyway I've started working on a simple windows form app using the BackgroundWorker class but for some reason I can'T even get the MSDN example to run lol... I'm not getting any errors when compiling, it just never goes in the DoWork function.

Anybody has an idea?

I just have a form with 2 buttons (start/stop), a label and the backgroundWorker1 component.

If I use a breakpoint I can see it go in StartButton_Click and run through RunWorkerAsync but it never actually goes in DoWork.
It looks like you probably haven't wired up the callbacks to the buttons (or the BackgroundWorker). When you create a button in the Windows Forms designer, you double-click on it and it'll create a method stub for a click handler. In this case, since you already have the methods created, you can just add the callbacks in the Form1 constructor. Adding a callback (I think it's called Event in C#-speak) looks something like this:
Code:
button.Click += buttonClickHandler;
Click is the button's click event and buttonClickHandler is the method you want to call when the button is clicked.

By the way, if you want to write code that runs in the background, there's an easier way in C# by using async/await: https://msdn.microsoft.com/en-us/library/hh191443.aspx
It lets you basically write code as you normally would and the compiler will do the work of making it work in the background, without having to use BackgroundWorkers or even bare threads and stuff like that.
 

NotBacon

Member
Hey guys so I decided to finally start learning C# a couple of days ago...

I have a bit of C++ history but that was over 10 years ago so..yeah..

Anyway I've started working on a simple windows form app using the BackgroundWorker class but for some reason I can'T even get the MSDN example to run lol... I'm not getting any errors when compiling, it just never goes in the DoWork function.

Anybody has an idea?

I just have a form with 2 buttons (start/stop), a label and the backgroundWorker1 component.

If I use a breakpoint I can see it go in StartButton_Click and run through RunWorkerAsync but it never actually goes in DoWork.

Code:

Are you leaving out some code? Somewhere you need to actually create your backgroundWorker1

Also you need to register those methods as events with your backgroundWorker1 object with something like this
Code:
public Form1()
{
    ...
    backgroundWorker1.DoWork += new DoWorkEventHandler(backgroundWorker1_DoWork);
    backgroundWorker1.ProgressChanged += new ProgressChangedEventHandler(backgroundWorker1_ProgressChanged);
    backgroundWorker1.RunWorkerCompleted += new RunWorkerCompletedEventHandler(backgroundWorker1_RunWorkerCompleted);
}

Edit: and yeah ^ async/await is very handy
 

Megasoum

Banned
It looks like you probably haven't wired up the callbacks to the buttons (or the BackgroundWorker). When you create a button in the Windows Forms designer, you double-click on it and it'll create a method stub for a click handler. In this case, since you already have the methods created, you can just add the callbacks in the Form1 constructor. Adding a callback (I think it's called Event in C#-speak) looks something like this:
Code:
button.Click += buttonClickHandler;
Click is the button's click event and buttonClickHandler is the method you want to call when the button is clicked.

By the way, if you want to write code that runs in the background, there's an easier way in C# by using async/await: https://msdn.microsoft.com/en-us/library/hh191443.aspx
It lets you basically write code as you normally would and the compiler will do the work of making it work in the background, without having to use BackgroundWorkers or even bare threads and stuff like that.

Are you leaving out some code? Somewhere you need to actually create your backgroundWorker1

Also you need to register those methods as events with your backgroundWorker1 object with something like this
Code:
public Form1()
{
    ...
    backgroundWorker1.DoWork += new DoWorkEventHandler(backgroundWorker1_DoWork);
    backgroundWorker1.ProgressChanged += new ProgressChangedEventHandler(backgroundWorker1_ProgressChanged);
    backgroundWorker1.RunWorkerCompleted += new RunWorkerCompletedEventHandler(backgroundWorker1_RunWorkerCompleted);
}

Edit: and yeah ^ async/await is very handy

Those 3 lines dit it NotBacon.. Thanks!

Not sure why MSDN would leave those out of their example? I took their code as is.... Anyway...

I will look into async/await though.

Thanks a lot guys!
 
Does anyone else feel like Xcode has a completely nonsensical UI? i absolutely hate using this thing. Maybe it's just a paradigm shift from what I'm used to (Visual Studio), but the whole way you manage project settings and build settings is just completely insane to me.

And those are just the high level issues. I could nit pick all day. Like you're editing a project's include paths and there's no way to copy/paste between the fields. You have to re-type every single entry one by one. And it took me and another guy (who actually uses Xcode!) like 15 minutes to figure out that you can change the target by clicking some little small arrow at the top of the project settings page.

Then when I try to debug, nothing works. Where's the menu item for "just put a fucking breakpoint"? I figured out that you can click in the gutter to put a breakpoint, but there's all these menu options for all these special types of breakpoints that ask for more information, but not the "just put a goddamn breakpoint here" option. And even then, I couldn't get them to work. I put a breakpoint in an inlined which I think was probably inlined, and it wouldn't hit.

I could keep going, but I guess I'll stop.
 
It's been like that since Xcode 4's UI went all iTunesy, integrated Interface Builder, and dropped the entire IB plugins interface.

I just checked a few longtime third-party Apple developers' Twitter accounts. Yep, complaining about Xcode is still a thing.
 
It's been like that since Xcode 4 went all iTunesy, integrated Interface Builder, and dropped the entire IB plugins interface.

I just checked a few longtime third-party Apple developers' Twitter accounts. Yep, complaining about Xcode is still a thing.

It's so weird, I mean I literally don't know how people even use it. Such a basic feature like tabbing the windows of your source files appears to be completely absent. So you can only have one file open at a time. You can double click to open a file in a new window, but you can't just have 100 files open in tabs, so that you can easily click to get to a different one.

I hope that I'm just missing some settings or options somewhere. But even if I am, that still doesn't answer the question of why the default settings are so terrible to work with.
 
What would be the best way to implement a GUI within a webpage? I have began implementing it with Javascript but it is becoming tiresome and I'm just wondering if there is a better way to do it?

I'm basically creating a GUI of a restaurant seating layout in which users can choose the table they wish to book after giving details of their booking such as time, date etc.

Thanks!
I'd kick this one over to the web development community thread, I'd expect them to have more experience (and more favoritism) over JavaScript frameworks.

Naked JavaScript is fine, but you might find something like AngularJS or Polymer enjoyable, depending on what you're trying to do. And of course React is the hip new thing; its main selling point is that it has the infrastructure to do an iPhone/Android table view-ish thing quite well in JavaScript, so that might be worth taking a look at too.
 
I'd kick this one over to the web development community thread, I'd expect them to have more experience (and more favoritism) over JavaScript frameworks.

Naked JavaScript is fine, but you might find something like AngularJS or Polymer enjoyable, depending on what you're trying to do. And of course React is the hip new thing; its main selling point is that it has the infrastructure to do an iPhone/Android table view-ish thing quite well in JavaScript, so that might be worth taking a look at too.

I'll concur. I'm more of a backend developer but have had to touch our frontend (Angular) quite a bit lately. It takes a little bit to wrap your head around their paradigm, but once you do it's pretty slick.

I wouldn't even try to use vanilla JavaScript these days. There are so many production ready libraries that do the heavy lifting for you.
 

Two Words

Member
I can't tell if my code is actually deleting the detached nodes of a linked list. Here's the code for the delete function. It is simply supposed to delete the first node of the linked list, as a queue.

void delNode(node *&head)
{
node *temp = head;
head = temp->next;
delete [] temp;
}


The program works, but I am not sure if I am actually deleting it.
 
Top Bottom