• C++ Programming for Financial Engineering
    Highly recommended by thousands of MFE students. Covers essential C++ topics with applications to financial engineering. Learn more Join!
    Python for Finance with Intro to Data Science
    Gain practical understanding of Python to read, understand, and write professional Python code for your first day on the job. Learn more Join!
    An Intuition-Based Options Primer for FE
    Ideal for entry level positions interviews and graduate studies, specializing in options trading arbitrage and options valuation models. Learn more Join!

Compile Errors != Linker Errors, BTW why do I get Linker errors?

I highly recommend that you study this (HOW COMPILER WORKS)
https://www.youtube.com/watch?v=QXjU9qTsYCc
No doubt a compiler course for a student of Computer Science is very important (as well for any one who is involved in coding), it makes clear what is going on when you hit F7 in VS, and even more it helps to create efficient and optimal code even in terms of time execution. The dis-advantages of C/C++ vs Python can be learned when you take Compilers I / II
 
I abandoned that instruction long time ago, the only ones for I/O I use is cin / cout
yes, it's ancient, but updating it is a time-consuming project.

On an off-topic: much of the Fortran cod embedded in Python libraries was written in the 1970s. Production systems create wrappers around legacy code. One client in offshore in Rotterdam still uses Microsoft VC++ 6.0 for their critical dredging equipment.
 
Last edited:
yes, it's ancient, but updating it is a time-consuming project.

On an off-topic: much of the Fortran cod embedded in Python libraries was written in the 1970s. Production systems create wrappers around legacy code. One client in offshore in Rotterdam still uses Microsoft VC++ 6.0 for their critical dredging equipment.
I made that mistake long time ago, I refused to transport my VC++ 6.0 code to updated versions. Then I faced the big struggle to go over the whole of it (+60K lines of code C/C++). Now every time there is another version of VS I do transport it right away, VS does all the job. Currently Visual Studio 2019
 
Porting MVC++ 6.0 to C++11 is an impossibility.
The whole application should be written from scratch.
 
One exhibit from the report

“Stochastic” is just a scientific-sounding word for “random”. That’s not a problem if the randomness is intentional pseudo-randomness, i.e. the randomness is derived from a starting “seed” which is iterated to produce the random numbers. Such randomness is often used in Monte Carlo techniques. It’s safe because the seed can be recorded and the same (pseudo-)random numbers produced from it in future. Any kid who’s played Minecraft is familiar with pseudo-randomness because Minecraft gives you the seeds it uses to generate the random worlds, so by sharing seeds you can share worlds.

Clearly, the documentation wants us to think that, given a starting seed, the model will always produce the same results.

Investigation reveals the truth: the code produces critically different results, even for identical starting seeds and parameters.
 
How one Covid-19 Software model (Neil Ferguson/Imperial College) was developed.

A damning report

Well, the first sentence in that link says:

"Imperial finally released a derivative of Ferguson’s code. "

after that sentence, all bets are off. I have seen Ferguson's report. It's a thing of beauty, 400+ pages of information.

To be honest, I trust Ferguson's model a little bit more than this thing:

Trump's advisers released a 'beyond stupid' mathematical model of coronavirus deaths created in Excel by a controversial economist
 
Well, the first sentence in that link says:

"Imperial finally released a derivative of Ferguson’s code. "

after that sentence, all bets are off. I have seen Ferguson's report. It's a thing of beauty, 400+ pages of information.

To be honest, I trust Ferguson's model a little bit more than this thing:

Trump's advisers released a 'beyond stupid' mathematical model of coronavirus deaths created in Excel by a controversial economist
You should read a bit more, especially what software developers say. Don't be fooled by cute reports.
The wording 'derivative' is a misnomer (a better word is 'clone'); it is an attempt to remove the bugs. It could be called a second version in C++ (12 years too late). The software is the issue, not beautiful plots.
Your line of thought is not very logical.

Introducing another model into the discussion is unfortunate.
 
Last edited:
Alright then, I downloaded the revamped Imperial Covid C code, built the project and got it running in console mode (it uses GDI which I haven't used since 1992 ... it is deprecated big time and is impossible to find GDI drivers),

I will write up a precise and detailed report in the coming days (BTW I have written code on projects large and small since 1972).

It is going to be a very rough ride; fasten seatbelts. BTW the Microsoft/Github code is still C running under Visual Studio.

Even this new ported code is not fit for purpose
Even this new ported code is not fit for purpose


Watch this space.

Reminds me of the quote from Local Hero

“My parents were Hungarian immigrants. They took the name MacIntyre 'cause they thought it sounded more American!”
 
Here is a quote with which I disagree completely. It is very, very bad:

"I hate anything that asks me to design on the spot. That's asking to demonstrate a skill rarely required on the job in a high-stress environment, where it is difficult for a candidate to accurately prove their abilities. I think it's fundamentally an unfair thing to request of a candidate."

In fact, answering this question show that you can break a problem into independent subproblems and that you create language-independent model;s before jumping into coding marathons.

This would never happen more mature software development. It leads to

“A Big Ball of Mud is a haphazardly structured, sprawling, sloppy, duct-tape-and-baling-wire, spaghetti-code jungle. These systems show unmistakable signs of unregulated growth, and repeated, expedient repair. Information is shared promiscuously among distant elements of the system, often to the point where nearly all the important information becomes global or duplicated. The overall structure of the system may never have been well defined. If it was, it may have eroded beyond recognition. Programmers with a shred of architectural sensibility shun these quagmires. Only those who are unconcerned about architecture, and, perhaps, are comfortable with the inertia of the day-to-day chore of patching the holes in these failing dikes, are content to work on such systems.”
 
Last edited:
C++:
    float x = 0.1;
    x -= 0.1;

    double y = 0.1;
    y -= 0.1;

    std::cout << "x, y: " << x << "," << y << '\n';
 
Small remark on new(?) C++ behaviour. Interesting to see how legacy code reacts.

Seems that the C++ compiler reacts differently these days to template protected data t; if you want to directly access t in derived class you must use this->t (BTW for concrete types you can get away with just using t).

// Of course, protected data is bad practice but is useful for testing with many derived classes.

Maybe I've done it wrong.

Here's the template code



template <typename T>
class B
{
protected:
T t;
public:
B() {}
B(T n) : t(n) {}
};



template <typename T>
class D1: public B<T>
{
private:

public:
D1(T n) : B<T>(n)
{
this->t = 10;
}


void whatever()
{
std::cout << t << '\n'; //NOT WORK, identifier t not found
// std::cout << this->t << '\n'; // WORKS
}
};



And the good ole non-template version where it does work



class B2
{
protected:
int t;
public:
B2() {}
B2(int n) : t(n) {}
};



class D2: public B2
{
private:

public:
D2(int n) : B2(n)
{
t = 10; // Works
}


virtual void whatever()
{
std::cout << t << '\n'; // WORKS

}
};



A nice variant (not) is when 'int t' is both base and derived classes. Talk about Information Hiding..

You can try it during the holiday period if you get bored.
 
"I definitely agree that the Advanced C++ course would be a great way to hone your skills. The prerequisites for the advanced course are as follows:

· Proficiency in OOP, inheritance, polymorphism.

· Proficiency in generic programming (C++ templates).

· Deep understanding of C/C++ memory management (dynamic allocation), pointers, references, memory leaks, etc.

· Understanding of the importance and usage of const-correctness, data hiding, etc.

· Experience using Boost libraries.

· Experience with basic STL containers/data structures.

· Solid experience with Object Oriented design (i.e., abstract classes, composition vs. inheritance, class design).

· Great coding habits (best C++ practices, code commenting, code format, etc.)

All of the above are covered in detail and practiced in the first C++ course (the first two levels are more of a 'review' of C whereas the later levels go into detail regarding the above). If you are proficient in the above, then the Advanced course would be for you -- feel free to enrol. Otherwise, the first C++ course should be taken first to get your skills up to par. You may decide what you are most comfortable with.


0Errigal-Mountain-looking-east-Donegal-on-the-Wild-Atlantic-Way-1024x680.jpg
 
Question: I plan to move from VS 2019 to VS 2022. What's the easiest way?
 
Back
Top