• 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

theecakee

Member
I don't know any of thise.

Since I have alot of time on y hands, which should i do first?

I feel like it could depend on what general direction you want to go in, web dev, mobile apps, data science, game dev, etc. This site is pretty cool for that.

If you don't know, I'd second the Python recommendation. Probably has the most resources for beginners to learn.

I wouldn't dwell too much on choosing a language, it turns out once you know one switching to another is pretty trivial. Just learn one first, and then decide where to go from there.
 

Koren

Member
I wouldn't dwell too much on choosing a language, it turns out once you know one switching to another is pretty trivial. Just learn one first, and then decide where to go from there.
Well, switching isn't always trivial. The first switch between langages that use names/references and those that use variables can feel a bit strange, the first encounter of functional feels like you don't know what you do anymore.

Going from C to Haskell or Prolog can be nightmare fuel.

But indeed, the first one doesn't matter much as long as you find enjoyment learning it. Python is nice for this, plently of ressources, a lot libraries to do everything, fast returns over investment.

And when you're accustomed to different kind of languages, going from one to another is definitively easy.

(each time we discuss this kind of things and I remember I learned coding using the very first Microsoft Basic I think, that doesn't even have real function support, and where variable names enforce the typing, I feel old T_T What a shitty language it was, even assembly is nicer, and I still remember fondly of it...)
 

Gaaraz

Member
Almost 15 years of being a programmer, and I'm done.

Started out doing ASP, then PHP/JS/HTML/CSS and loved it. The job then moved in C#/ASP.NET which I didn't get on with, and I've since moved to a different company and I'm really struggling (despite them apparently being really happy with me, to the point of me being in line for a promotion)

Anyhow, today I had the chance to do a bit of work in Javascript (just helping out a friend, non-paid) and jumped at the chance to try to help out, and also do something I was more confident with... and even then I was completely overcome with feelings of helplessness looking through the code and felt completely overwhelmed.

It's been a long time coming I think, but I'm handing in my notice on Monday, and couldn't feel more relieved. Sorry for the rant :)
 

Slo

Member
Almost 15 years of being a programmer, and I'm done.

Started out doing ASP, then PHP/JS/HTML/CSS and loved it. The job then moved in C#/ASP.NET which I didn't get on with, and I've since moved to a different company and I'm really struggling (despite them apparently being really happy with me, to the point of me being in line for a promotion)

Anyhow, today I had the chance to do a bit of work in Javascript (just helping out a friend, non-paid) and jumped at the chance to try to help out, and also do something I was more confident with... and even then I was completely overcome with feelings of helplessness looking through the code and felt completely overwhelmed.

It's been a long time coming I think, but I'm handing in my notice on Monday, and couldn't feel more relieved. Sorry for the rant :)

If I were you I'd take a week or two of PTO and think it over. Perhaps start planning your next career and, if necessary, work your way through your next degree.
 

Gaaraz

Member
Thanks Slo, great advice and you're right that I shouldn't rush into a decision. I'm lucky in the sense that for a long while now (since the start of the decline) I've been following FI blogs like MMM and have managed to build up a bit of a buffer.

This has been a long time coming for me tbh, but going back to the language I used to love and still hating it has made me realise I'm just not cut out for it any more :(

I'm still hoping to do a little bit of work and programming from home, maybe even enough to maintain our pretty modest lifestyle - though the way I feel right now I never want to see another line of code again x_x
 
How do I code sign a generic binary on MacOS? I have a developer license.

I have never done this before! This is really funny.

Check the UNIX man page for codesign (just type in "man codesign" in the OS X terminal if you're not familiar), that has the documentation for code signing binaries via the codesign command line tool. "--sign identity" and "SIGNING IDENTITIES" should help. Examples are near the bottom.

You'll need the command line tools that I think still come with Xcode to do this, it's based on a proprietary fork of LLVM and Clang.

When in doubt, Stack Overflow or refer to the other official references.
 

Koren

Member
Maybe you just gotta try something new for programming to be fun again. I don't see any functional languages in your list ;)

http://learnyouahaskell.com/
Well, there's javascript ;)

I also think functional languages are nice (although except for purity and aesthetics, I'd prefer OCaml or F# to Haskell), but if the change from PHP to C# felt annoying, the jump to Haskell will seem like starting from scratch again ;)
 

Koren

Member
Speaking of Javascript...


I recently started playing with NodeJS to develop javascript code outsive of a webpage environment.

If I'm not mistaken, the proper way to create an "interactive shell" in javascript is to add a listener function to stdin (and use console.log to reply?)


What I'm not sure is how to properly exit the program when you type something like "bye".

Of course, process.exit(0) works, but it seems that's not a good way to do this, because stdout is buffered, and it may not be flushed properly. Seems also harsh in an event-based program.

So I just set process.exitCode and tried to remove the listener using removeAllListeners, but the program don't stop (the listener is stopped, though, because it doesn't react to input anymore)

I guess there's still an event loop waiting for something. How do I exit properly?
 
I graduated with a degree in CS from a p reputable engineering school this year and am currently working for a company that does various web dev contracting, primarily regarding the telecom industry. it's been fun and i've learned quite a bit about web design/photoshop i didn't already know, but it's also extremely easy. I'm looking for a challenge, but i've also realized that I'm incredibly out of touch when it comes to a lot of programming principles, having been 6-8 months since I've seriously developed something from the ground up (outside of basic web stuff and google/shell scripts for process improvement things at work).

so i've been doing more online challenges and reading 'cracking the code' to prep for some technical interviews and it's definitely helping bring a lot to stuff back fairly quickly. I'm trying to lock down what I actually want to do with my degree and coming up short, however. I definitely enjoyed the systems level / comp org classes the most throughout the school as they offered a healthy challenge, but i don't think i'd actually be interested in a full-time job based around that.

what i need to do is find some cool and personal medium-scale programming projects to work on over the next month or so. I've been toying around with some vive development via unity and that's fun, but I'd also like to build some stuff that isn't gaming related. I know once i have something to work on I'll enter my coding flowstate and just grind it out and enjoy the work, but I'm struggling to think of a good project to build. Any ideas?
 

Makai

Member
I graduated with a degree in CS from a p reputable engineering school this year and am currently working for a company that does various web dev contracting, primarily regarding the telecom industry. it's been fun and i've learned quite a bit about web design/photoshop i didn't already know, but it's also extremely easy. I'm looking for a challenge, but i've also realized that I'm incredibly out of touch when it comes to a lot of programming principles, having been 6-8 months since I've seriously developed something from the ground up (outside of basic web stuff and google/shell scripts for process improvement things at work).

so i've been doing more online challenges and reading 'cracking the code' to prep for some technical interviews and it's definitely helping bring a lot to stuff back fairly quickly. I'm trying to lock down what I actually want to do with my degree and coming up short, however. I definitely enjoyed the systems level / comp org classes the most throughout the school as they offered a healthy challenge, but i don't think i'd actually be interested in a full-time job based around that.

what i need to do is find some cool and personal medium-scale programming projects to work on over the next month or so. I've been toying around with some vive development via unity and that's fun, but I'd also like to build some stuff that isn't gaming related. I know once i have something to work on I'll enter my coding flowstate and just grind it out and enjoy the work, but I'm struggling to think of a good project to build. Any ideas?
Beat Shenzhen I/O then code a game in it.

https://www.youtube.com/watch?v=geT2uP7MYGc
 

Gaaraz

Member
but if the change from PHP to C# felt annoying, the jump to Haskell will seem like starting from scratch again ;)
Annoying doesn't even come close, I just can't do it. Not sure why :(

Just looking at Haskell now also, and nope. Thanks for the recommendation, but I wrap my head around that either :(
 

Koren

Member
Annoying doesn't even come close, I just can't do it. Not sure why :(
Well, I'd say that you were interested in the creating/building part, not by the algorithmic part behind. When programming is mostly a tool, I'm not surprised you can lose interest in it, and be annoyed at changes.

Don't take any decision in haste, but you may be right into looking for something else... Should you choose to change direction, I wish you the best...


Just looking at Haskell now also, and nope.
Can't say I'm surprised, I thought you were after more than a different, fresher way to look at algorithmics ;)
 

Makai

Member
Can't say I'm surprised, I thought you were after more than a different, fresher way to look at algorithmics ;)
Hey, sometimes learning something completely different is all it takes to make programming fun again. And you can't make functions without fun. :D
 

Two Words

Member
My internship is requiring that I do unit testing on all of my code. I've never done unit testing before. My work is being done in Python. I get the idea of unit testing after reading up on it, but I'm not sure how to execute it all. Primarily, I am unsure when it comes to unit testing void methods. A method that has a return statement seems pretty easy to unit test. You assert that some given input should return some specified output and let the test check as your method changes on a test set. But a void method will typically have side effects instead of return values. How is unit testing a void method typically done?
 
My internship is requiring that I do unit testing on all of my code. I've never done unit testing before. My work is being done in Python. I get the idea of unit testing after reading up on it, but I'm not sure how to execute it all. Primarily, I am unsure when it comes to unit testing void methods. A method that has a return statement seems pretty easy to unit test. You assert that some given input should return some specified output and let the test check as your method changes on a test set. But a void method will typically have side effects instead of return values. How is unit testing a void method typically done?

A non-void method can have side effects just as easily as a void method. Forget about return values, you should be thinking about "does the function actually do what it's supposed to do?" That includes verifying return values and side effects.

For example, maybe you're writing a vector class that doubles its capacity once it has to overflow. So you do something like this:

Code:
v = vector()  // initial capacity is 2, for the sake of illustration
VERIFY(v.capacity() == 2);
VERIFY(v.size() == 0);
v.add(1);
VERIFY(v.capacity() == 2);
VERIFY(v.size() == 1);
v.add(2);
VERIFY(v.capacity() == 2);
VERIFY(v.size() == 2);
v.add(3);
VERIFY(v.capacity() == 4);
VERIFY(v.size() == 3);

OTOH, maybe it's better to try a higher number, since there can be edge cases around small numbers. So you might try something like this.


Code:
std::vector<int> v;  // initial capacity is 16
VERIFY(v.capacity() == 16);
VERIFY(v.size() == 0);
for (int i=0; i < 16; ++i)
  v.push_back(i);
VERIFY(v.capacity() == 16);
VERIFY(v.size() == 16);
v.push_back(16);
VERIFY(v.capacity() == 32);
VERIFY(v.size() == 17);

This is a contrived example since you're not going to be writing unit tests for STL functions, but if you were the author of STL, you might write a unit test like to verify that your vector class is standards' compliant, for example.
 

Two Words

Member
A non-void method can have side effects just as easily as a void method. Forget about return values, you should be thinking about "does the function actually do what it's supposed to do?" That includes verifying return values and side effects.

For example, maybe you're writing a vector class that doubles its capacity once it has to overflow. So you do something like this:

Code:
v = vector()  // initial capacity is 2, for the sake of illustration
VERIFY(v.capacity() == 2);
VERIFY(v.size() == 0);
v.add(1);
VERIFY(v.capacity() == 2);
VERIFY(v.size() == 1);
v.add(2);
VERIFY(v.capacity() == 2);
VERIFY(v.size() == 2);
v.add(3);
VERIFY(v.capacity() == 4);
VERIFY(v.size() == 3);

OTOH, maybe it's better to try a higher number, since there can be edge cases around small numbers. So you might try something like this.


Code:
std::vector<int> v;  // initial capacity is 16
VERIFY(v.capacity() == 16);
VERIFY(v.size() == 0);
for (int i=0; i < 16; ++i)
  v.push_back(i);
VERIFY(v.capacity() == 16);
VERIFY(v.size() == 16);
v.push_back(16);
VERIFY(v.capacity() == 32);
VERIFY(v.size() == 17);

This is a contrived example since you're not going to be writing unit tests for STL functions, but if you were the author of STL, you might write a unit test like to verify that your vector class is standards' compliant, for example.
Well, let's say you had a void sort method that didn't return a sorted vector, but instead was an instance method that sorted the vector internally. How would a unit test for that look like?
 
Well, let's say you had a void sort method that didn't return a sorted vector, but instead was an instance method that sorted the vector internally. How would a unit test for that look like?

Code:
std::vector<int> actual = {3, 1, 2, 4, 6, 7, 5, 8, 9, 0};
std::vector<int> expected = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};

actual.sort();

VERIFY(actual == expected);
 

Two Words

Member
Code:
std::vector<int> actual = {3, 1, 2, 4, 6, 7, 5, 8, 9, 0};
std::vector<int> expected = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};

actual.sort();

VERIFY(actual == expected);

I see. Should unit tests always rely on some sort of language-native comparator? Like, would it be bad to create an isSorted method since that would have to be tested too?
 

KooPaL

Member
I see. Should unit tests always rely on some sort of language-native comparator? Like, would it be bad to create an isSorted method since that would have to be tested too?

Not sure about other languages but Python's unittest class has comparator methods in it where you pass the expected and the actual result values. The methods are not straight up equality test; some if greater than, less than, if it raises an exception or not etc. I believe C# also has the same but its been a while since I've written test cases for it.
 

Somnid

Member
I see. Should unit tests always rely on some sort of language-native comparator? Like, would it be bad to create an isSorted method since that would have to be tested too?

Generally yes, you shouldn't build tests that rely on the code you are testing. Unit tests should be independent, that is they (ideally) should not overlap and should not be based on the result of other tests (isSorted works). So in that case I'd build a test helper method that tests if the array is sorted. It might be a carbon-copy of an existing method in your codebase but at least then it's independent such that changes in isSorted won't cause issues with existing tests. Typically if your test utilities get complicated you need to build tests for those too but of course at some point you just need to ask yourself "how much value do I get from these tests?" if the answer is "not very much" then you should stop.
 

ty_hot

Member
Anyone with experience in R?

I wrote a simple code that needs to run several times (once a minute) during the whole day. So I created a while loop just to define when it should stop running:

while ( sys.time() < stoprunningtime ) {

timer <- sys.time() /gets the starting time

\my code// (vary between 1-3 seconds to run, because it download some things from the internet)

sleeptime <- timer + 60 - sys.time() /calculates how long the function should sleep before going back to check the while condition

Sys.sleep(sleeptime)

}

--

So, it runs perfectly in the first 10-20 iterations, then it starts to get fucked up and the next iterations runs after 61 62 or even 65 seconds after the previous one. It is a problem because I need it running for 18-24 hours and this makes a big difference in the end.

I am thinking maybe use another while inside the while, but I believe that would make the function heavier (?) ? Because it would be check the condition all the time during 57-59 seconds,wouldn't it put my cpu at 100%? Also, the sleep time that it calculates goes up to the 15th decimal so the problem ia not that the precision of that value.

I'm beginning to code so maybe nothing that I think makes sense.
 
I see. Should unit tests always rely on some sort of language-native comparator? Like, would it be bad to create an isSorted method since that would have to be tested too?

That's one reason that it would be bad to have an isSorted method, but there are plenty of others.

1) It's not good to clutter up a class's interface with code whose sole purpose is to aid in testing. Adding tests is supposed to increase your code coverage, not reduce it.

2) What if it's a stable sort, or a sort with a predicate, or a descending sort? isSorted is too specific.

3) It helps when reading a test to see the expected outputs. If the test fails, you want to look at it and see what's going on, often you can identify the bug without even debugging if you can see the actual vs expected outputs.

I could probably come up with some more.

That said, being a little pedantic, in my example I wasn't using a built-in comparator. vector operator== is overloaded. The point though is that you shouldn't rely on hard and fast rules like "i must only use built-in functions". The important thing is that the you are testing isolated functionality, the functionality you are testing is sufficiently complicated to warrant a test, and you are reasonably confident the test doesn't depend on broken code. There are lots of ways to achieve all of those, so don't stick to such rigid rules.
 

Koren

Member
Not sure about other languages but Python's unittest class has comparator methods in it where you pass the expected and the actual result values. The methods are not straight up equality test; some if greater than, less than, if it raises an exception or not etc.
Quoted for emphasis... There's a dedicated module for this in Python, I'd say it's the way to go.

Although that doesn't change much, you'll write exactly the same tests (although "using self.assertIn(element, mylist)" instead if "element in mylist"), it's just it'll be easier to launch them, especially if other people want to test the code.

Hey, sometimes learning something completely different is all it takes to make programming fun again. And you can't make functions without fun. :D
Well, I feel like the problem lies in programming not being the reason of the fun from the go.

And you *can* get rid of fun in ML if you want ;)
 

Koren

Member
1) It's not good to clutter up a class's interface with code whose sole purpose is to aid in testing. Adding tests is supposed to increase your code coverage, not reduce it.
About this...

In Python, nothing is private. Bad or not, at least, that makes tests easy to perform (and easy to break).


But let's return into C++ for example. You can create tests that check the good behavior of all public functions and methods.

When you've declared part of the class private (for example because implementation can change, and you want to be sure that people won't rely on it), should you totally avoid creating tests that check the good behavior of the current implementation part, and only check the public part?

Because I don't see how you can nicely test the behavior of the private part.

Of course, you may not care, but sometimes, finding a bug in the implementation just using public functions and methods can be a nightmare.

For example, in your STL example... you're lucky you have a v.capacity(). But you could want to hide this capacity() method because you could want to handle things differently in the future. But for the time being, having a capacity method (possibly not public) could be welcome for testing purposes...

I've toyed with friendship to deal with the problem, although not perfectly satisfying. Any suggestion? Should I just not care and only test public results?
 

Lagamorph

Member
Work have been getting me into Powershell scripting lately.
Takes me back to my University days coding C, HTML, VRML....good times.

Might try getting back into more regular coding at home in my spare time and pick up a book or two. Any good recommendations on a language (and book) to start picking things back up with? C++? C#? Something else? I've been out of the coding game too long.
 

Kalnos

Banned
Might try getting back into more regular coding at home in my spare time and pick up a book or two. Any good recommendations on a language (and book) to start picking things back up with? C++? C#? Something else? I've been out of the coding game too long.

What are you interested in making? That's the most important question to ask when picking a language. I'm a JavaScript/Golang webdev (formerly C#) who hasn't touched C++ since university 8 years ago and I'm enjoying relearning C++... it's amazing how badly I was taught C++ in hindsight, scared me off of the language somewhat. The two books I'm using are C++ Primer 5th and The C++ Programming Language. I'm basically learning C++ just to fuck around with OpenGL and because I have always wanted to.

If you're looking for something very different then try a functional language... Haskell, Elixir, etc. I ran through this Elixir book about a year ago and it was pretty good but I think it'd be challenging if you don't have much experience. Learning a functional language will definitely change how you approach all programming IMO.

I quite enjoy Go if you're interested in web development, small scripting, command line tools, etc. It has a really great standard library for all sorts of common tasks. Honestly you don't really need a book to learn Go, the website is quite thorough, but The Go Programming Language is supposed to be pretty solid if you want a book.
 

Lagamorph

Member
I suppose the issue is I'm not entirely sure what I want to do with it. I guess as gaming is a big hobby of mine something gaming related might be a good place to start since it'll help to maintain my interest and enthusiasm.
 

Kalnos

Banned
C# is a good option for games since Unity uses it and there are probably quite a few Unity books out there simultaneously teaching C#. C++ is a good option as well if you're interested in engines and lower level APIs.

You could make game related tools out of just about any language though!
 
About this...

In Python, nothing is private. Bad or not, at least, that makes tests easy to perform (and easy to break).


But let's return into C++ for example. You can create tests that check the good behavior of all public functions and methods.

When you've declared part of the class private (for example because implementation can change, and you want to be sure that people won't rely on it), should you totally avoid creating tests that check the good behavior of the current implementation part, and only check the public part?

Because I don't see how you can nicely test the behavior of the private part.

That's not even the worst of it. Lately I've started to lower my usage of private functions and instead prefer file static functions instead where possible. For example, instead of this:

Code:
class Foo {
public:
  void bar() { baz(); }
private:
  void baz();
};

I may instead now write this:

Code:
// Foo.h
class Foo {
public:
  void bar();
};

// Foo.cpp
#include "Foo.h"

static void baz(Foo &F) {}

void Foo::bar() {
  baz(*this);
}

because for technical reasons this can often be optimized better by the compiler. Even friendship doesn't work now.

For this reason, I often don't write tests for these types of functions. I mean, the whole reason for writing code like this anyway is that it's an implementation detail, and implementation details by definition are fragile and subject to change at any time, and so are not good candidates for writing a unit test.

On the other hand, if it's not an implementation detail but a genuinely useful utility function that you just need to call many times, maybe it can be separated out into a completely separate class, or abstracted somehow to make it useful to more than just the class where you've declared it private. Then you can test the other class.

Still, there's no One Rule. I admit I've used friendship before for testing as well, it's just something you have to figure out on a case by case basis and use your judgement to decide whether a test is really warranted.
 

Koren

Member
because for technical reasons this can often be optimized better by the compiler. Even friendship doesn't work now.
Interesting... I used this, but I haven't thought about this possibility.

For this reason, I often don't write tests for these types of functions. I mean, the whole reason for writing code like this anyway is that it's an implementation detail, and implementation details by definition are fragile and subject to change at any time, and so are not good candidates for writing a unit test.
Well, I agree, but when the implementation under the hood make some complex tasks, you can for example have a test that will create a segfault, showing an issue, but lacking tests with lower granularity on the actual, current implementation will make finding the error harder...

Somehow, I would like to have public unit tests, and (possibly a bit hidden) unit tests that check some implementation details. Of course, those tests are not future proof like the others, but I think they have their value for development purposes.

For example, in a class that handle a tree, I may have a list that holds nodes and list their parents. I may want to check whether all nodes have a living parent, but at the same time, I may avoid having a function that give access to the node list, since I may want to represent the tree differently later.

It's just that I don't know where to put those tests (I've even used a #include that add code in the file that define the class, a #include that will be remove when "shipping" the library"... I don't like it, but I didn't know what to do, and at least you don't pollute the code)

Still, there's no One Rule. I admit I've used friendship before for testing as well, it's just something you have to figure out on a case by case basis and use your judgement to decide whether a test is really warranted.
Indeed... I was just checking there weren't a well-known solution for this...
 
Interesting... I used this, but I haven't thought about this possibility.


Well, I agree, but when the implementation under the hood make some complex tasks, you can for example have a test that will create a segfault, showing an issue, but lacking tests with lower granularity on the actual, current implementation will make finding the error harder...

Somehow, I would like to have public unit tests, and (possibly a bit hidden) unit tests that check some implementation details. Of course, those tests are not future proof like the others, but I think they have their value for development purposes.

For example, in a class that handle a tree, I may have a list that holds nodes and list their parents. I may want to check whether all nodes have a living parent, but at the same time, I may avoid having a function that give access to the node list, since I may want to represent the tree differently later.

It's just that I don't know where to put those tests (I've even used a #include that add code in the file that define the class, a #include that will be remove when "shipping" the library"... I don't like it, but I didn't know what to do, and at least you don't pollute the code)


Indeed... I was just checking there weren't a well-known solution for this...

Yea, sadly not really. Usually what I would do is if I find an actual bug, make a regression test for the repro case. Like maybe a particular structure of tree was triggering some bug due to the internal management of node lifetimes. So identify the conditions that would cause it to fail (through debugging), try to reduce it down to a reasonable sized input e.g. "if a node has 3 right children, and the 3rd right child has a left child, and some relationship like a < b < c is satisfied between two of the nodes, then we'll get a segfault", and then just make a test on the public interface for that case.

Really what you're going for is code coverage. As long as all the code-paths of your private internal functions are exercised, it shouldn't matter whether you do it through a direct or indirect interface. It's just easier to isolate when you can test a function in isolation.
 

balgajo

Member
Guys, any tips about singleton template on multiples shared libraries(linux)?
Googled a bit but couldn't find solutions onLinux. The problem is that I'm getting one singleton instance for each shared library...
:(

EDIT: I'm talking about C++...lol
 

Pau

Member
I figured this would be the place to ask.

I'm going in for my first interview for a job in data processing and management. They said there would be a brief programming task and I'm not sure what to expect or how to prepare. The research team works almost exclusively in SAS, although the recruiter is aware that I don't know the language. Would it be safe to assume that the task would be in SAS?
 

Makai

Member
I figured this would be the place to ask.

I'm going in for my first interview for a job in data processing and management. They said there would be a brief programming task and I'm not sure what to expect or how to prepare. The research team works almost exclusively in SAS, although the recruiter is aware that I don't know the language. Would it be safe to assume that the task would be in SAS?
They're going to say, "use a language of your choice" or "use pseudo code"
 

Makai

Member
So I shouldn't waste time learning SAS in a week? :p Any tips on what I should do to prepare?
No idea - I don't even prepare for job interviews because who knows what they'll ask. But if this is your first programming interview ever maybe it's not a bad idea! Know the difference between array, array list, linked list, hashtable, and binary search tree. And the answer to any sorting question is probably "N log(N)."

http://bigocheatsheet.com
 

Fou-Lu

Member
I am trying to figure out where I should go next with my learning. I have been using more coding lately and learning that I absolutely love it. I even think I might like to do it for a job eventually. I also am leaning toward trying to program my own games. I have a very Physics and Applied Math based knowledge of programming. I know how to use C++, ROOT and R for Monte carlo, statistics and a bit of machine learning. I have also done some assembly coding with microcontrollers. My actual comp sci knowledge is limited to one first year course and what I have picked up doing physics programming.
 
Guys, any tips about singleton template on multiples shared libraries(linux)?
Googled a bit but couldn't find solutions onLinux. The problem is that I'm getting one singleton instance for each shared library...
:(

EDIT: I'm talking about C++...lol

Is your singleton defined in a static library that is linked into multiple different shared libraries?
 

Eridani

Member
I am trying to figure out where I should go next with my learning. I have been using more coding lately and learning that I absolutely love it. I even think I might like to do it for a job eventually. I also am leaning toward trying to program my own games. I have a very Physics and Applied Math based knowledge of programming. I know how to use C++, ROOT and R for Monte carlo, statistics and a bit of machine learning. I have also done some assembly coding with microcontrollers. My actual comp sci knowledge is limited to one first year course and what I have picked up doing physics programming.

I would recommend learning about data structures and algorithms. It's a very fundamental topic that's useful pretty much everywhere. This includes things like lists, trees, graphs, hash tables and algorithms used for sorting, graph/tree traversal etc. It's especially useful for game programming, since you mentioned that.
 
Top Bottom