• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 09:17
CEST 15:17
KST 22:17
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
[ASL22] Ro8 Preview: In A Tizzy9[ASL22] Ro16 Preview: Holy Diver5[ASL22] Ro16 Preview: Rough Waters10[ASL22] Ro24 Preview: Siren's Call8[ASL22] Ro24 Preview: Summer's End9
Community News
Weekly Cups (Sep 13-20): herO scores triple2BSL Season 236Weekly Cups (Sep 7-12): SHIN, ByuN, MaxPax double down1StarCraft open world shooter announced at BlizzCon101Weekly Cups (Aug 30-Sep 7): herO thrives amid growing schism10
StarCraft 2
General
Weekly Cups (Sep 13-20): herO scores triple Balance hotfix patch 5.0.16b (July 16) Blizzard Classic Cup @ BlizzCon 2026 - $100k prize pool How do you feel about the StarCraft shooter announcement at BlizzCon 2026? The Death of Cheese: From a Professional Cheeser
Tourneys
Stellar Fest TWO the Moon (Dec 16-20) Sparkling Tuna Cup - Weekly Open Tournament 2026 GSTL Announcement RSL Revival: Season 6 - Qualifiers and Main Event RSL goes to London! 2026 Offline Finals Nov 21-22
Strategy
[H] ZvP Mid-Late Game: Stalkers Collossi HT
Custom Maps
[M] (2) Frigid Storage
External Content
Mutation # 544 Double Trouble The PondCast: SC2 News & Results Mutation # 543 Enhanced Defenses Mutation # 542 The Ascended
Brood War
General
BW General Discussion NaDa's Body BSL Season 23 screpdb: new Starcraft reporting tool an AI researcher's take on the ladder bot
Tourneys
[ASL22] Ro8 Day 2 [ASL22] Ro16 Group D [ASL22] Ro8 Day 1 [IPSL] IPSL is Back With Winter 26-27!
Strategy
Cliff Jump Revisited (1 in a 1000 strategy) Replay Review Process - What do you do? Simple Questions, Simple Answers Odyssey Mineral Stack Saturation
Other Games
General Games
Nintendo Switch Thread Diablo IV Warcraft III: The Frozen Throne Stormgate/Frost Giant Megathread EVE Corporation
Dota 2
Dota 2 Champions League Season 3 Begins April 25! Official 'what is Dota anymore' discussion
League of Legends
[TL LoL EUW IHs] Teemo shall perish
Heroes of the Storm
Heroes of the Storm 2.0
Hearthstone
Deck construction bug
TL Mafia
TL Mafia Community Thread
Community
General
US Politics Mega-thread Russo-Ukrainian War Thread Artificial Intelligence Thread Things Aren’t Peaceful in Palestine All you football fans (soccer)!
Fan Clubs
MarineLorD Fan Club The Creator Fan Club The ShoWTimE Fan Club
Media & Entertainment
Movie Discussion! [Manga] One Piece Diablo Animated Series on Netflix
Sports
Football (Soccer) Thread TeamLiquid Health and Fitness Initiative For 2023 MLB/Baseball 2023
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
Recent Gifted Posts
Blogs
Gaming Intensity, Problemati…
TrAiDoS
38 yo Retired SWE loo…
PurE)Rabbit-SF
Can Bots Beat Pros?? Starcr…
namkraft
[meme] I finally understa…
LUCKY_NOOB
Regacy Esports:Our Goa…
regacyesports
Dreaming of BW patches (mod…
c3rberUs
Customize Sidebar...

Website Feedback

Closed Threads



Active: 7688 users

The Big Programming Thread - Page 962

Forum Index > General Forum
Post a Reply
Prev 1 960 961 962 963 964 1032 Next
Thread Rules
1. This is not a "do my homework for me" thread. If you have specific questions, ask, but don't post an assignment or homework problem and expect an exact solution.
2. No recruiting for your cockamamie projects (you won't replace facebook with 3 dudes you found on the internet and $20)
3. If you can't articulate why a language is bad, don't start slinging shit about it. Just remember that nothing is worse than making CSS IE6 compatible.
4. Use [code] tags to format code blocks.
Hanh
Profile Joined June 2016
146 Posts
May 26 2018 06:33 GMT
#19221
On May 26 2018 12:28 Liquid`Jinro wrote:
Show nested quote +
Python is often the first (and only) language a lot of people learn when they're really educated in something else (Like Maths or Physics) but need to make a program to do calculations for them. They often have a poor or no concept of good practices, optimisation, or how half the things they're doing even works. For instance: Deep Learning is, at the moment, almost exclusively done in Python. Not because C++ wouldn't be vastly superior for it, but simply because half the people working on it have no idea how to program when they start out, and they're just grabbing the easiest tool they can learn in the shortest amount of time.

so tl;dr: Yes.

For the people not actively developing new algorithms, what would the benefit be to working in C++ instead of Python? From what I can recall, the performance of most of the computational python libraries are basically c/c++ levels of performance (since they are just calling c/c++ anyway), and can in some cases even be improved with something like cython.

(I don't work in this field, just learning because I'm interested - I'm basically what you describe: only know python... and a little bit of R)


EDIT: I guess basically what bo1b said already.


To be clear, the scientific python libraries have good performance since they wrap highly optimized numeric C code but it doesn't mean that a python program using them will be fast. It depends on how much work will be executed by the libraries, how much data must be transferred back/forth from python to C memory space, how much vectorization could be used and many other factors.
For a different approach, have you tried Julia?
bo1b
Profile Blog Joined August 2012
Australia12814 Posts
Last Edited: 2018-05-26 08:17:43
May 26 2018 08:14 GMT
#19222
On May 26 2018 12:28 Liquid`Jinro wrote:
Show nested quote +
Python is often the first (and only) language a lot of people learn when they're really educated in something else (Like Maths or Physics) but need to make a program to do calculations for them. They often have a poor or no concept of good practices, optimisation, or how half the things they're doing even works. For instance: Deep Learning is, at the moment, almost exclusively done in Python. Not because C++ wouldn't be vastly superior for it, but simply because half the people working on it have no idea how to program when they start out, and they're just grabbing the easiest tool they can learn in the shortest amount of time.

so tl;dr: Yes.

For the people not actively developing new algorithms, what would the benefit be to working in C++ instead of Python? From what I can recall, the performance of most of the computational python libraries are basically c/c++ levels of performance (since they are just calling c/c++ anyway), and can in some cases even be improved with something like cython.

(I don't work in this field, just learning because I'm interested - I'm basically what you describe: only know python... and a little bit of R)


EDIT: I guess basically what bo1b said already.

The benefits of memory optimisation are hard to overstate, putting aside machine learning and other forms of scientific computing (which is still done in c/c++ btw, tensorflow is written in c++, even if it has an api in python), pretty much everything that is performance orientated is written in c/c++, or has an api which calls to c/c++. Any language at all which doesn't allow (and expect!) you to manually manage the memory is doing it for you, and as machine learning hasn't yet hit garbage collectors the performance losses are obscene. Take this with an enourmous grain of salt, every single one of these programs has had the books cooked:

https://benchmarksgame-team.pages.debian.net/benchmarksgame/faster/python3-gpp.html

Worth noting that for somethings memory management is not optional, I'm not sure if your learning at a university or not, but if you are, and the university is worth it's salt you'll do some operating system development, and see some practical examples of just how important memory really is.

On the other hand, there is very little benefit aside from performance that I can think of. Python is safer, faster and easier to get a program up and running then c/c++.

As an aside in theory c should compile down to a smaller faster executable than c++, yet I've noticed as the program gets more and more abstract, c++ gets comparatively faster.

As another aside, Rust is amazing, more people should use it.
Silvanel
Profile Blog Joined March 2003
Poland4769 Posts
Last Edited: 2018-05-26 08:37:47
May 26 2018 08:35 GMT
#19223
Well, if memory optimalization is important Python most likely isnt You desired solution.That should be obvious to anyone who knows how it works. However if speed of deployment is essential Python is the way to go. Thats why its so widely used for tests.

An example:
Since we work embedded most of our code is in C++ and most of our tests are in Python (even though we dont have standards for testing lanagauge and every team can chose what they want they mostly have chosen Python). So we have neatly optimazed code running on embedded product in C++ and quickly deployable tests run on PC where we dont need to worry about lack of resources. Chosing right tool for a job is important.
Pathetic Greta hater.
bo1b
Profile Blog Joined August 2012
Australia12814 Posts
May 26 2018 08:36 GMT
#19224
I think it's time the front page was updated tbh, is there someone I can pm with some useful resources to those thinking of studying cs?
Khalum
Profile Joined September 2010
Austria831 Posts
May 26 2018 08:55 GMT
#19225
On May 26 2018 09:05 nunez wrote:
[..] i really dislike the built-in "shared-pointer copy semantics" of openCV.


You mean that you explicitly have to ask for deep copies of matrices? I think that's pretty brilliant since memory operations are minimized but at the same time it's one hell of a trap if someone doesn't really know what they're doing.
Manit0u
Profile Blog Joined August 2004
Poland17843 Posts
Last Edited: 2018-05-26 09:16:07
May 26 2018 09:09 GMT
#19226
tofu is still active so hit him I guess.

Also, on the note of performance and all, it really depends on what you're working with. If you need to work with distributed systems and a lot of parallelism then it's hard to beat Erlang for example.

And I have no idea why they won't simply release a brand new C and C++ but with more friendly syntax. I mean, what matters is what it compiles down to right? Languages like Python and Ruby are also popular because they're simply a joy to write code with as you don't have to deal with metric tons of syntactic sugar and can focus on what you want to accomplish rather than how to write it properly.

The same thing in C:

int compare_int(const void* a, const void* b)
{
if (*(int*)a == *(int*)b)
{
return 0;
}

return *(int*)a < *(int*)b ? -1 : 1;
}

const size_t num_elem = 10;
int elements[num_elem] = { 3, 6, 1, 9, 8, 2, 0, 5, 7, 4 };
qsort(elements, num_elem, sizeof(int), compare_int);


Ruby:

ary = [3, 6, 1, 9, 8, 2, 0, 5, 7, 4]
ary.sort


Python:

nums = [3, 6, 1, 9, 8, 2, 0, 5, 7, 4]
nums.sort()


I know this is a really bad example...

I'm by no means an expert in C but I think it could really use some library manager (like Rust's Cargo) and a good batch of standard libraries that would implement stuff that people might want to use commonly (like arrays that contain values of different types and hash tables for example).
Time is precious. Waste it wisely.
emperorchampion
Profile Blog Joined December 2008
Canada9496 Posts
May 26 2018 09:22 GMT
#19227
That’s why you use C++
TRUEESPORTS || your days as a respected member of team liquid are over
Liquid`Jinro
Profile Blog Joined September 2002
Sweden33719 Posts
Last Edited: 2018-05-26 10:00:12
May 26 2018 09:53 GMT
#19228
On May 26 2018 17:14 bo1b wrote:
Show nested quote +
On May 26 2018 12:28 Liquid`Jinro wrote:
Python is often the first (and only) language a lot of people learn when they're really educated in something else (Like Maths or Physics) but need to make a program to do calculations for them. They often have a poor or no concept of good practices, optimisation, or how half the things they're doing even works. For instance: Deep Learning is, at the moment, almost exclusively done in Python. Not because C++ wouldn't be vastly superior for it, but simply because half the people working on it have no idea how to program when they start out, and they're just grabbing the easiest tool they can learn in the shortest amount of time.

so tl;dr: Yes.

For the people not actively developing new algorithms, what would the benefit be to working in C++ instead of Python? From what I can recall, the performance of most of the computational python libraries are basically c/c++ levels of performance (since they are just calling c/c++ anyway), and can in some cases even be improved with something like cython.

(I don't work in this field, just learning because I'm interested - I'm basically what you describe: only know python... and a little bit of R)


EDIT: I guess basically what bo1b said already.

The benefits of memory optimisation are hard to overstate, putting aside machine learning and other forms of scientific computing (which is still done in c/c++ btw, tensorflow is written in c++, even if it has an api in python), pretty much everything that is performance orientated is written in c/c++, or has an api which calls to c/c++. Any language at all which doesn't allow (and expect!) you to manually manage the memory is doing it for you, and as machine learning hasn't yet hit garbage collectors the performance losses are obscene. Take this with an enourmous grain of salt, every single one of these programs has had the books cooked:

https://benchmarksgame-team.pages.debian.net/benchmarksgame/faster/python3-gpp.html

Worth noting that for somethings memory management is not optional, I'm not sure if your learning at a university or not, but if you are, and the university is worth it's salt you'll do some operating system development, and see some practical examples of just how important memory really is.

On the other hand, there is very little benefit aside from performance that I can think of. Python is safer, faster and easier to get a program up and running then c/c++.

As an aside in theory c should compile down to a smaller faster executable than c++, yet I've noticed as the program gets more and more abstract, c++ gets comparatively faster.

As another aside, Rust is amazing, more people should use it.

Yeah I know the underlying stuff is in c/c++, I just mean't that a user of them don't need to know c/c++, since it has the nice and friendly python api available.

Thanks for the thorough answer, I'm just learning on my own, I still play poker full time but have taken a bunch of intro CS/data science courses because they are interesting, and python is quite handy when you want to analyze massive amounts of data which modern poker tends to generate.
Moderatortell the guy that interplanatar interaction is pivotal to terrans variety of optionitudals in the pre-midgame preperatories as well as the protosstinal deterriggation of elite zergling strikes - Stimey n | Formerly FrozenArbiter
Manit0u
Profile Blog Joined August 2004
Poland17843 Posts
May 26 2018 10:46 GMT
#19229
On May 26 2018 18:22 emperorchampion wrote:
That’s why you use C++


C++ is atrocious though
Time is precious. Waste it wisely.
bo1b
Profile Blog Joined August 2012
Australia12814 Posts
Last Edited: 2018-05-26 10:54:53
May 26 2018 10:54 GMT
#19230
The modern version of c tbh is rust, in a large number of ways. Unfortunately, I don't think it's possible to tidy up all the syntax without removing functionality an awful lot of people rely on. c++ is ridiculous a lot of the time, but a large part of the appeal is having all the functionality of any language you can think of (except modules of course) + the kitchen sink. I don't think you can have both that and simple syntax. Might want to look into std::sort as well, you can achieve a sorted array quite nicely without 10 lines of code in c++ something like this:

std::vector<int> sortThis = {3, 6, 1, 9, 8, 2, 0, 5, 7, 4};
std::sort(sortThis.begin(),sortThis.end());

The other reality is that an awful lot of people quite like the strict syntax, it's a feature to me not a pain.

Jinro unfortunately not everything is written in c/c++ with a python library attached, and for those many cases getting dirty with a lower level language is sometimes unavoidable. I also disagree to a certain degree about not needing to know the underlying library, if only because an awful lot of it is years or decades old and may not interface well with the newest version or w/e language you're running.

On May 26 2018 19:46 Manit0u wrote:
Show nested quote +
On May 26 2018 18:22 emperorchampion wrote:
That’s why you use C++


C++ is atrocious though


lol, I love and hate c++, simultaneously.
sc-darkness
Profile Joined August 2017
856 Posts
Last Edited: 2018-05-26 10:58:35
May 26 2018 10:58 GMT
#19231
On May 26 2018 19:46 Manit0u wrote:
Show nested quote +
On May 26 2018 18:22 emperorchampion wrote:
That’s why you use C++


C++ is atrocious though


That's because you don't understand its beauty. I think you prefer C, and I'll be glad if I never have to depend on your code simply because of inherently easy memory leaks there. Just use RAII and <memory> and forget about 99% of memory leaks.
bo1b
Profile Blog Joined August 2012
Australia12814 Posts
May 26 2018 11:00 GMT
#19232
C++ is a lot of things, but safe is a word I'd avoid.
sc-darkness
Profile Joined August 2017
856 Posts
May 26 2018 11:01 GMT
#19233
It's safer than C for sure. There's no discussion about it.
bo1b
Profile Blog Joined August 2012
Australia12814 Posts
May 26 2018 11:03 GMT
#19234
For every tool c++ gives you to be safe, it gives another weapon to shoot yourself in the foot with. There are many reasons os development is done with c, not c++.
sc-darkness
Profile Joined August 2017
856 Posts
Last Edited: 2018-05-26 11:08:00
May 26 2018 11:05 GMT
#19235
I don't do OS development, but I'm pretty sure C was chosen at the time for performance reasons. C, at least at the time, was still faster than C++. Now things are a bit different, sometimes C++ abstractions are as fast as C functions or sometimes slightly faster.

Edit: Also C is smaller in size.
bo1b
Profile Blog Joined August 2012
Australia12814 Posts
May 26 2018 11:10 GMT
#19236
With gratuitous template usage you can make c++ faster then c, at least when the problem crosses a certain threshold of complexity. There are many reasons c++ is used pretty much universally where time matters the most, more then anything. And then there are reasons why it's not used in operating system development, many to do with run time size and how it compiles, believe it or not c++ and c do not compile to the same machine code.

Again, c++ is only as safe as you allow yourself to be, as soon as you start using templates you'll start enjoying that "safety"
sc-darkness
Profile Joined August 2017
856 Posts
May 26 2018 11:13 GMT
#19237
What operating systems have been developed since C++ became popular though?
bo1b
Profile Blog Joined August 2012
Australia12814 Posts
Last Edited: 2018-05-26 11:29:13
May 26 2018 11:25 GMT
#19238
I'm not sure if it counts, as I'm not entirely sure on the time frame your talking here, but modern windows I think is the most likely, and it's kernel was written in c. Android is based on linux with c++ on top, but again it's kernel is in c, I'm not sure about ios and how much was based on osx, but it's written in c as well for the kernel.

I guess in terms of brand new Redox is probably the closest, written in the language I honestly expect to replace c/c++ in the coming decades.
Excludos
Profile Blog Joined April 2010
Norway8279 Posts
Last Edited: 2018-05-26 11:34:47
May 26 2018 11:26 GMT
#19239
On May 26 2018 08:53 nunez wrote:
@excludos
qt should be quarantined to the code that deals with the gui, and even there it should be used as sparingly as possible. for that it's an ok option, but for anything else there are better alternatives. if someone suggested that we use qt for signals / slots at work, he / she would also be quarantined to code that deals with gui.

some never get comfortable with the complexity of c++, and seek refuge in the abstract comfort of Qt or C# or python or whatever. parading this retreat as ersatz critique seems common.


What do you base your answer on here? Qt has loads of plugins and tools for back end purposes and is made to work equally well for that as front end. I wouldn't suggest you use it just because of signals and slots, but because it literally has an answer for all of your problems (Hyperbole of course. There's loads of things it doesn't do as well. Like heavy calculations or image operations). A lot of those problems can be solved with a external library each..or you can just remove all of them and use Qt instead. I'm also not saying it's the only tool for the job or something you must use in all situations, just that it's very good for a lot of them, and not something you should just dismiss based on..whatever you think you're basing it on. I don't know what kind of misconceptions you have about it, but I'd love to know
nunez
Profile Blog Joined February 2011
Norway4003 Posts
May 26 2018 11:40 GMT
#19240
On May 26 2018 17:55 Khalum wrote:
Show nested quote +
On May 26 2018 09:05 nunez wrote:
[..] i really dislike the built-in "shared-pointer copy semantics" of openCV.


You mean that you explicitly have to ask for deep copies of matrices? I think that's pretty brilliant since memory operations are minimized but at the same time it's one hell of a trap if someone doesn't really know what they're doing.


'memory operations' are minimized? i am not suggesting making extra copies, but there are oh so many tools ready at hand for "avoiding copies" (references, an arsenal of pointer-types, containers, statics even). in most scenario's you easily get away by using the most trivial of tools (f.ex. a reference).

one only needs thread-safe reference-counting for the most complex of scenarios, and then std::shared_ptr / std::weak_ptr is ready at hand, which works for _any_ type.

types with baked-in reference-counting is haram. 'cloning' and 'deep-copy' is alien terminology.
conspired against by a confederacy of dunces.
Prev 1 960 961 962 963 964 1032 Next
Please log in or register to reply.
Live Events Refresh
Kung Fu Cup
11:00
2026 Week 24
IntoTheiNu 1069
RotterdaM520
SteadfastSC162
Rex115
CosmosSc2 28
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
RotterdaM 520
SteadfastSC 162
uThermal 130
Rex 115
CosmosSc2 28
StarCraft: Brood War
Britney 34713
Shuttle 2855
Bisu 2510
firebathero 711
BeSt 665
Light 490
Rush 382
Mini 349
Stork 288
Snow 184
[ Show more ]
Last 153
hero 88
JYJ 65
Shine 57
Hyun 56
Shinee 43
PianO 40
ToSsGirL 31
Sharp 29
HiyA 23
Sexy 23
Hm[arnc] 22
sorry 22
zelot 20
Aegong 16
Rock 9
Terrorterran 7
NotJumperer 6
Icarus 4
Dota 2
Gorgc5938
qojqva1196
Dendi1028
Counter-Strike
kRYSTAL_95
Heroes of the Storm
crisheroes297
Other Games
olofmeister1345
B2W.Neo846
hiko595
XBOCT377
Lowko342
DeMusliM219
Mew2King106
Liquid`VortiX103
ArmadaUGS65
QueenE55
Organizations
Dota 2
PGL Dota 2 - Main Stream9789
StarCraft: Brood War
Afreeca ASL 393
[ Show 14 non-featured ]
StarCraft 2
• Berry_CruncH160
• mYiSmile119
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• Migwel
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• C_a_k_e 4587
League of Legends
• Nemesis1623
• TFBlade452
Other Games
• WagamamaTV180
Upcoming Events
The PondCast
20h 43m
Replay Cast
1d 10h
Korean StarCraft League
2 days
CranKy Ducklings
2 days
GSL
3 days
Yamato Cup
4 days
Replay Cast
4 days
Afreeca Starleague
4 days
Soma vs Jaedong
WardiTV Weekly
4 days
Sparkling Tuna Cup
5 days
[ Show More ]
Afreeca Starleague
5 days
Leta vs Soulkey
PiGosaur Cup
6 days
Kung Fu Cup
6 days
Liquipedia Results

Completed

Super Anchor Qualifying S3
Blizzard Classic Cup 2026
Big Dog Cup 2026 Div 1

Ongoing

ASL Season 22
CSL 2026 AUTUMN (S22)
Acropolis #5
Acropolis #5 - GSA
Calamity Invitational
Logitech G Play Connect 2026
SL StarSeries Fall 2026
FISSURE Playground #3
BLAST Open Fall 2026
Esports World Cup 2026
BLAST Bounty Summer 2026
BLAST Bounty Summer Qual
Stake Ranked Episode 3
XSE Pro League 2026

Upcoming

Acropolis #5 - GSB
Acropolis #5 - GSC
BSL Season 23
SC4ALL II: Brood War
BSL 23: Non-Korean Championship
HSC XXX
Stellar Fest 2: Lunar Cup
SC4ALL II: StarCraft II
Kung Fu Cup 2026 Grand Finals
RSL Offline Finals
Custodian Cup
Copium Cup
PGL Major Singapore 2026
Stake Ranked Episode 6
BLAST Rivals Fall 2026
IEM Beijing 2026
Stake Ranked Episode 5
PGL Masters Bucharest 2026
1win Private Club #2
Thunderpick World Champ. '26
ESL Pro League Season 24
Stake Ranked Episode 4
1win Private Club #1
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2026 TLnet. All Rights Reserved.