Advanced vs. Simplistic Programming.

Pages: 12
I am not entirely asking this just so I can learn them and be like "I know this hahahaha", but mostly because I am curious on what it looks like. By know I can easily identify C++, by the STL functions used and, really, just the look of it. I know that in C, new[] and delete[] don't exist, but instead it is malloc() and free(), and that you have to declare functions before use, so I can distinguish them.

But, with the advanced advanced stuff (I have a feeling in my brain that everything I know now is Kindergarten stuff for a professional programmer with a real job), what does that look like? Is there really an "advanced-advanced" way to look at it? Is there some sort of fine line between "simple" and "state-of-the-art programming"?
In my opinion, the only difference is the scope of the project. Advanced programming just contains a lot of simple programming. It becomes about the design of the project as a whole, not the individual lines of code.
Template metaprogramming is what I would consider advanced. I have spent months on and off working on a still-incomplete project that uses TMP to the extremes:

https://github.com/LB--/hSDK/blob/de6ccfc06fa0c46f64598f4621d81f4ac30a20ea/include/hSDK/Extension.hpp

https://github.com/LB--/hSDK/blob/de6ccfc06fa0c46f64598f4621d81f4ac30a20ea/extensions/Template/TestExtension.hpp#L101-L150

The code interfaces between real C++ classes and a C plugin SDK to streamline the otherwise tedious or non-portable alternatives. It's a lot of effort for a little benefit; I'm just working on it for fun (though I do plan to use it for a useful project if I complete it).

You should also check out many of the Boost libraries, some of that stuff is still way over my head. JLBorges has helped me learn a lot of the intricacies of TMP, though.
Last edited on
&LB
I don't understand Templates either, LB. They are in a very early beginner
programming book of mine, and I looked at them and said "I'll learn this when I find importance to it". Well, I realized around 4 months ago the importance of them, and I have put off learning them behind Unity, OpenGL, Direct2D / Win32, Qt, and other C++. I like to be a... jack-of-all-trades, as one would put it.

The only thing "simple" I don't understand are typedefs. I see them all the time, and I have actually put some effort into learning them. But I just don't get how to use them properly.
&ResidentBiscuit
I agree with what you said. Whenever I write something huge - with several classes and files to the program, I feel way more accomplished than I do when I write something pretty difficult with only 50 lines of code.
Typedefs help clarify the intended use of a type. There are many cases there the same type has multiple aliases with different intended uses:
1
2
using Column_t = int;
using Row_t = int;
As ResidentBiscuit points out, they also act as an abstraction layer - not only do they save your fingers from doom, they can easily be changed in one place to affect everywhere they are used.
Last edited on
Typedefs are nothing special. They just create a new name for some data type, though they have been replaced by using in C++11.

1
2
3
4
5
6
7
using AddressMap = std::map<std::string name, mynamespace::Address>;
//Or with typedef
type std::map<std::string name, mynamespace::Address> AddressMap;

//And with either of these, we can now use that long type in an easier way
AddressMap addr_map;
addr_map.clear();


They're used just to clarify what a type is in a more concise manner.
Last edited on
Oh... Yeah. It never really was explained to me, and I thought it was too small of a topic to post a whole thread about it. So, they are really just filler
-conversation = derailed-


Anyway, back to the original post... On the advanced side. Are there programmed computer programs, like there are unsolved math problems, such as the Goldbach Conjecture?

And if so, has anybody tried one?
Last edited on
There's a bunch, but most are mathematical questions. Just google "unsolved computer science problems" and you'll find a bunch of stuff.
ResidentBiscuit wrote:
There's a bunch, but most are mathematical questions.

Of course. Most computer science is mathematics. The rest is a combination of electronics and linguistics and other stuff that reduces to mathematics anyway.

CS is to maths what physics is to... maths.

[edit]
@LB
This guy has you beat: http://stackoverflow.com/a/275295
Last edited on
I have a feeling in my brain that everything I know now is Kindergarten stuff for a professional programmer with a real job),

You would probably be surprised how incompetent most professional programmers actually are, especially when it comes to C++. I think good C++ programmers are actually quite rare. I'll blame it on the idea that learning JAVA before C or C++ completely ruins people; most people will never be good programmers due to this. And college, at least mine, seams to make decent computer scientists, but very, very, bad software engineers.

Whatever you do, just stick to RAII as much as possible, or else I will track you down and kill you.

Last edited on
@chrisname: Woah, that's pretty impressive - thanks for the link!
I more or less agree with htirwin here, but I don't know if the term incompetent is fair. There are libraries of material on this stuff and the nuances are noticeably different between compilers. Just about anyone can show off with some obfuscated piece of fancy looking code. It takes completely different kind of talent to take a complex problem and write it out in a way that is both efficient and easily understood at a glance by your team members. To me a programmer would be good enough if they could demonstrate a functional understanding of the basics like variable lifetimes (RAII being part of that), variable binding, overload resolution, scope, operator precedence and the other behaviors that are well defined by the standard.

Templates for instance are useful, you absolutely must learn what they are and how to use them because they are used by libraries everywhere. Outside of libraries though, in production code, they become significantly less common. I would not expect someone fresh out of college to be able to create a useful template, but I absolutely would require them to know how to implement one. What do I know though, I'm not even a programmer :p.
My college recently swapped the order of CS classes so that C++ would be taken before Java (it wasn't before). In the middle of the swap though their system wasn't fixed and I was required to take the Java course despite my AP test score and my certification. The professor and I agreed, though, that you should learn C++ before Java.
My college recently swapped the order of CS classes so that C++ would be taken before Java (it wasn't before).

At my college, they taught C, then object oriented programming with C++, then data structures and algorithms with C++. The problem is that they didn't cover dynamic memory allocation( well maybe mentioned it), or the STL. They only covered member variables and functions, scope, operator overloading, namespaces and then threw a bunch of difficult homework programs at us, usually requiring we didn't use the STL. We didn't get any feedback on our code at all, and the TA's didn't know C++ and just spread lots of misinformation. It's no wonder so many people come here for help. In most cases, you probably get better educated about C++ software engineering, from young hobbies programmers here, than from the professors and TA's in college. However, at college you will learn a lot about algorithms. And my theory of computing teacher was world class and totally expanded my mind.
Last edited on
usually requiring we didn't use the STL.


I never understood this. "Learn how to write code the wrong way".


It's like teaching a Python class and saying you can't import anything.
Last edited on
htirwin wrote:
Whatever you do, just stick to RAII as much as possible, or else I will track you down and kill you.

But then how will you become a Three Star Programmer?

http://c2.com/cgi/wiki?ThreeStarProgrammer
Great link chrisname! This is exactly the kind of thing that I meant in my earlier post.

Also:
Also, what about nested #if,#else,#endif's?...

I'm glad I'm not the only one that feels this way. A lot of the time I'd rather have another fifty header files to search through then all of this #ifdef, #define, #endif, #else, #undefine, #define stuff that I see.
I never really use processor stuff except for macros and IDs. I maybe mistaken, and that is what they are used for, but, I am ignorant to that kind of stuff.

So, I know a lot of the STL, I am familiar with several libraries (Qt, OpenGL, SFML, Win32 / DirectX), and am pretty decent at programming overall - meaning I save memory a lot and am really good at organizing code. Where exactly would that put me on the line of experience :: inexperienced?
Last edited on
typeid(Experience).name() != typeid(Knowledge).name()

Tell us what you have done OP, then we can judge your ability.

@ OP: Do me a favor, avoid establishing this habit of seeking any kind of personal validation from others. You'll only end up burning yourself out by constantly fighting for the approval of users and sociopaths. If someone ignores your opinion in a given matter then someone in that informational transaction is wrong and it's either you or them. Your goal should be to reach the point where it is usually them.
Unfortunately, I've succumbed to heavily nesting macros. It's hard not to when it's the only way to determine what platform your on at compile-time.
Pages: 12