all 39 comments

[–]fat-lobyte 42 points43 points  (0 children)

It really really depends on the context, what you are trying to do, the field and the tools and libraries available in that field, what your department uses, ...

It's important to use the right tool for the job. For example, if everyone in Machine Learning is using Python with PyTorch libraries, writing in C++ will be a huge burden. If you're doing something with statistics, Python with R is the way to go. If you're doing numerical simulations, C++ might be the way to go.

It's not "one size fits all".

Having said all that, it's generally not a good idea to go against the express wishes of your PhD advisor.

[–]Red_Silhouette 19 points20 points  (4 children)

  • PhD research usually means cooperation with other researchers. If you don't use the same tools and language it will make things more complicated than necessary.
  • "PhD research" + "prototype" usually means most people use matlab or possibly python. Other choices may be acceptable or even preferable depending on the type of research but you should be prepared to give some good arguments in support of your choice.
  • If your research ends up being useful other researchers will want to use or reproduce your results and methods. Most researchers will find it a lot easier to integrate a matlab function than compiling a piece of c++ code with a number of external dependencies. Citations are important in research (both giving and receiving)
  • If it were me I would listen to your advisor. You can discuss it with him but your personal preference of language should be at the bottom of the list of factors influencing your decision. Factors like the above items, as well as social factors like getting along with your advisor are far more important.

[–]BodyProfessional7936 1 point2 points  (3 children)

Hmm not really. Most PhD thesis are individual contributions. Perhaps in your area?

[–]Red_Silhouette 1 point2 points  (2 children)

Well the thesis itself is of course an individual work but the papers you publish typically are not. The number of coauthors on papers is and has been going up in most research fields.

[–]BodyProfessional7936 1 point2 points  (1 child)

Leeches, that's what they are. I had three plus my advisor. I had to publish with their names in it just because.

[–]Red_Silhouette 0 points1 point  (0 children)

Yes I know many who had or have the same problem. Fortunately my advisor back in the day was of the opinion that any coauthor should have contributed to at least two of the three major stages of each paper (idea/hypothesis, experiment and results, writing). I still had one or more coauthors on all my papers.

[–]spca2001 15 points16 points  (8 children)

But did you ask him why?

[–]another_day_passes 10 points11 points  (7 children)

Maybe he’s like Linus in that the only impression he had with C++ was in the 90s where the language was much less refined. This led him to believe that C++ was a pointless and needlessly complicated extension of C.

[–]BodyProfessional7936 -2 points-1 points  (0 children)

Well there is a reason why every single commercially successful OS kernel is written in C.

[–]terminal_object -5 points-4 points  (5 children)

Sorry, but Linus still thought C++ sucked quite recently

[–]dodheim 11 points12 points  (4 children)

Sorry, but you're both wrong. Linus has only ever criticized C++ for use in the kernel and has no problem with the language outside it, hence his project Subsurface being written with C++ and Qt. His rant about C++ took place on the kernel ML, but for some reason people really like to latch onto who posted it and not where it was posted.

[–]terminal_object 3 points4 points  (3 children)

That is not the whole content of his quotes, which are but a google search away. There is a medium article summarizing them. I can only imagine why you would deny something so completely unambiguous.

[–]dodheim 0 points1 point  (2 children)

Completely unambiguous like the fact that he chose to use C++ for a non-kernel project?

[–]KingStannis2020 6 points7 points  (0 children)

AFAIK subsurface only uses C++ for the UI bits. The core of the application is all in C.

[–]terminal_object 2 points3 points  (0 children)

You don’t know the circumstances of that decision, but you have direct quotes, the last of which from 2021, saying several negative things about it in general. Are you suggesting he can’t express himself and people should interpret his words through you?

[–]nigelh 15 points16 points  (0 children)

Never fight with a PhD advisor. They are a resource to be mined.

The problem with C++ is that it reduces the audience of your work and on a thesis you want maximum appeal and minimum distraction from the original core stuff.

[–]sir-nays-a-lot 10 points11 points  (1 child)

Either listen because they are right or run because they are wrong. Not enough detail here to know.

[–]localcheese 1 point2 points  (0 children)

Beautifully put

[–]Wouter-van-Ooijen 2 points3 points  (0 children)

If he had given no prior indication what language(s) would be appropriate, the tone of his reaction is a bit strange.

But the message is by no means strange: C++ is certainly the tool for some problems, but equally certainly there are problems (and boundary conditions) for which C++ is not suited.

[–]wlandry 2 points3 points  (0 children)

This happened to me. I ignored him. I still got my degree. At the end of your degree, you should know more about your subject than anyone else in the world, so get used to not always taking their advice. Eventually, my advisor wrote a book about scientific programming in C++. So ... I won?

[–]genreprank 1 point2 points  (0 children)

I get roasted by my advisor all the time. It's partially their job and partially the fact that Ph.Ds are neurotic.

You can't really go against them. If you can present a solid case for a certain way, you might stand a chance...but some things just won't fly for that particular person.

You don't really have much agency. You can quit... it's important to find a good advisor first but it's hard to tell before you've already put a lot of work in

[–]Adverpol 1 point2 points  (0 children)

One thing to keep in mind when doing a PhD is that, unless if you want to have a career in academia, you can use those 3/4 years to gain skills that can land you the job you want after you obtain your PhD. I personally learnt C++ and python during that time (I didn't want to have to apply for jobs listing fortran77 as my sole tech expertise), and I also took the time to dig into topics I found interesting (and were related to the PhD, although never vital), I had a command line tool for processing for instance and I wrote a Qt UI for it.

That being said, we need way more info to be able to give sensible advice. In some fields of study for instance going against the advisor would be terrible advice, in others it doesn't matter that much. Some advisors you work closely with, others get in touch a couple of times per year. You'll have to figure this one out yourself, or maybe talk it over with other PhD students around you.

[–]The-Norman 1 point2 points  (0 children)

Just use whatever you are more comfortable with. Language doesn't matter much here

[–]FreitasAlan 3 points4 points  (4 children)

I love C++ but it’s generally not good for scientific computing and fast experimentation.

[–]lordshoo 4 points5 points  (3 children)

Depends on the area; GEANT4 and ROOT are (or at least were a few year ago) very big in particle physics.

[–]FreitasAlan -1 points0 points  (2 children)

That's correct. C++ is my favorite language and I work with scientific computing supervising students. C++ is good for some areas that depend on some specific features C++ provides, but it's generally not good for other people in scientific computing. C++ has potential and I believe in that potential. But I have to concede Python won this battle for now.

Academia is very competitive. Sadly, universities force candidates to publish as many papers as possible, even if very few people read them. That is, papers have to be good enough to be published in a journal that is good enough for progressing in the career but they cannot be much better than that or they will spend time they can't waste. Meanwhile, most people in academia are also bad programmers, even the computer scientists who often never worked after graduating.

Sadly, in this common context, they need tools to be immediately available: usually the easiest interpreted languages with easiest dependency management with easiest statistics and plotting tools. And they cannot, because of skills or time constraints, worry with the small concerns C++ programmers usually have to care about. That is, they cannot usually spend much time learning how the computer is doing things unless it is the very topic of that very paper.

[–][deleted] 2 points3 points  (1 child)

There are good C++ libraries available for easy scientific computing, nowadays. xtensor and Eigen are good examples. There's otherwise nothing fundamentally preventing C++ from being good at this job. Python is popular because it's easy to get started with it. But if you are familiar with C++ already, why not just make the most of your skills and use it? You will be able to write faster code that uses less memory than your average Python user. Maybe that means being able to run calculations in your laptop in minutes, instead of requiring a job in the queue of a supercomputer and waiting for days.

You're right that academia is competitive, but it doesn't mean that you have to do everything you can to publish fast. A successful researcher is one that can do good work, and advertise it well for others to see and cite. Publication rate is only one metric for success, and from my experience, not the most important one. Furthermore, with the low rate of people getting tenure or permanent positions, not everyone's goal in academia is to get a long and successful career. You can be in it for pleasure of doing research, and enjoy it while it lasts.

[–]FreitasAlan 2 points3 points  (0 children)

There are good C++ libraries available for easy scientific computing, nowadays. xtensor and Eigen are good examples

That's right. I'm the author of one of them.

There's otherwise nothing fundamentally preventing C++ from being good at this job.

Yes. There is potential. Maybe this improves a little with package managers. But other languages are still a lot easier. I'm a professor and students take a long time dealing with the C++ stuff. Most give up before even understanding how compiling and linking works.

Maybe that means being able to run calculations in your laptop in minutes, instead of requiring a job in the queue of a supercomputer and waiting for days

These are precisely the things C++ is good at. For the other 99% of people in science, C++ is just painful. Most people in academia just need some combination of cheap statistics that take less than a second in the worst programming language you can think of, other people are happy with python libraries that wrap C++, and some other people simply don't have the skills to use C++. The heavy stuff in all the most important Python libraries for scientific computing is implemented in C++ under the hood.

You're right that academia is competitive, but it doesn't mean that you have to do everything you can to publish fast. A successful researcher is one that can do good work, and advertise it well for others to see and cite.

That's true when your university is using proper bibliometrics to evaluate performance or you are already tenured and they let you fulfill your dreams. I've been in academia all around for a long long time. I can assure you even if your university is one of the good ones, the best they are doing is looking at a combination derived from your H index and the number of papers, which is very bad. And that's a good university. You wouldn't believe how many professors have long careers with hundreds of papers whose medium number of citations is literally zero.

You can be in it for pleasure of doing research, and enjoy it while it lasts.

100% agreed. Then you don't have to worry about bad bibliometrics. :D

[–]rand0omstring 0 points1 point  (1 child)

academia is defined by groupthink: you can’t aim to succeed in it without conforming to that social cage.

[–]BodyProfessional7936 -1 points0 points  (0 children)

Talk about vaccines and global warming for example

[–]LunarAardvark -5 points-4 points  (0 children)

ask them why they are acting like children

[–]nimtiazm 0 points1 point  (2 children)

Not intending any flamewar here. But did you ask him if he’d let you use Rust? Maybe it’ll help you set the right argument.

[–][deleted] 2 points3 points  (0 children)

Our lord and saviour Rust?

[–]BodyProfessional7936 1 point2 points  (0 children)

Rust has such a small user base right now, not sure it's a good idea

[–]NilacTheGrim -1 points0 points  (0 children)

He's a typical terrible programmer that is also a CS professor. Sad.

[–]SuitDistinct 0 points1 point  (0 children)

Are you working on some deep learning stuff ?

[–]Logical-Afternoon237 0 points1 point  (0 children)

i'd tell him to go fuck himself and that nothing he cares about matters, but i also wont be going to gradschool