• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 05:55
CET 11:55
KST 19:55
  • 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
RSL Season 3 - Playoffs Preview0RSL Season 3 - RO16 Groups C & D Preview0RSL Season 3 - RO16 Groups A & B Preview2TL.net Map Contest #21: Winners12Intel X Team Liquid Seoul event: Showmatches and Meet the Pros10
Community News
RSL Season 3: RO16 results & RO8 bracket13Weekly Cups (Nov 10-16): Reynor, Solar lead Zerg surge1[TLMC] Fall/Winter 2025 Ladder Map Rotation14Weekly Cups (Nov 3-9): Clem Conquers in Canada4SC: Evo Complete - Ranked Ladder OPEN ALPHA14
StarCraft 2
General
SC: Evo Complete - Ranked Ladder OPEN ALPHA RSL Season 3: RO16 results & RO8 bracket RSL Season 3 - Playoffs Preview Mech is the composition that needs teleportation t GM / Master map hacker and general hacking and cheating thread
Tourneys
RSL Revival: Season 3 $5,000+ WardiTV 2025 Championship StarCraft Evolution League (SC Evo Biweekly) Constellation Cup - Main Event - Stellar Fest 2025 RSL Offline Finals Dates + Ticket Sales!
Strategy
Custom Maps
Map Editor closed ?
External Content
Mutation # 500 Fright night Mutation # 499 Chilling Adaptation Mutation # 498 Wheel of Misfortune|Cradle of Death Mutation # 497 Battle Haredened
Brood War
General
2v2 maps which are SC2 style with teams together? Data analysis on 70 million replays soO on: FanTaSy's Potential Return to StarCraft BGH Auto Balance -> http://bghmmr.eu/ A cwal.gg Extension - Easily keep track of anyone
Tourneys
[BSL21] RO16 Tie Breaker - Group B - Sun 21:00 CET [BSL21] RO16 Tie Breaker - Group A - Sat 21:00 CET [Megathread] Daily Proleagues Small VOD Thread 2.0
Strategy
Current Meta Game Theory for Starcraft How to stay on top of macro? PvZ map balance
Other Games
General Games
Should offensive tower rushing be viable in RTS games? Clair Obscur - Expedition 33 Path of Exile Stormgate/Frost Giant Megathread EVE Corporation
Dota 2
Official 'what is Dota anymore' discussion
League of Legends
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Deck construction bug Heroes of StarCraft mini-set
TL Mafia
Mafia Game Mode Feedback/Ideas
Community
General
Russo-Ukrainian War Thread US Politics Mega-thread The Games Industry And ATVI Things Aren’t Peaceful in Palestine About SC2SEA.COM
Fan Clubs
White-Ra Fan Club The herO Fan Club!
Media & Entertainment
[Manga] One Piece Movie Discussion! Anime Discussion Thread Korean Music Discussion
Sports
Formula 1 Discussion 2024 - 2026 Football Thread NBA General Discussion MLB/Baseball 2023 TeamLiquid Health and Fitness Initiative For 2023
World Cup 2022
Tech Support
TL Community
The Automated Ban List
Blogs
The Health Impact of Joining…
TrAiDoS
Dyadica Evangelium — Chapt…
Hildegard
Saturation point
Uldridge
DnB/metal remix FFO Mick Go…
ImbaTosS
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1782 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
Poland4733 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
Poland17450 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
Poland17450 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
Norway8193 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
RSL Revival
07:30
Playoffs
herO vs MaruLIVE!
Crank 1546
Tasteless1085
IndyStarCraft 263
Rex144
CranKy Ducklings143
3DClanTV 109
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
Crank 1546
Tasteless 1085
IndyStarCraft 263
Rex 144
Nina 86
MindelVK 23
StarCraft: Brood War
Rain 15511
Sea 8895
Jaedong 4204
Horang2 3208
GuemChi 1521
Stork 632
Pusan 621
Mini 621
Larva 519
firebathero 496
[ Show more ]
Zeus 276
BeSt 243
Leta 229
PianO 168
Last 111
hero 102
Barracks 83
Killer 73
ToSsGirL 62
Sharp 45
JulyZerg 43
Backho 42
soO 37
Light 23
Noble 20
Hm[arnc] 16
NotJumperer 14
Sacsri 13
SilentControl 12
yabsab 12
Bale 7
HiyA 5
Britney 0
Dota 2
Gorgc4510
monkeys_forever284
XcaliburYe106
Counter-Strike
zeus262
allub71
edward31
Heroes of the Storm
Khaldor125
Other Games
summit1g16419
crisheroes272
B2W.Neo194
Fuzer 136
Pyrionflax58
Organizations
Dota 2
PGL Dota 2 - Main Stream23505
StarCraft: Brood War
lovetv 14
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 15 non-featured ]
StarCraft 2
• Berry_CruncH110
• LUISG 19
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• C_a_k_e 2096
• WagamamaTV118
League of Legends
• Stunt759
Upcoming Events
Wardi Open
3h 5m
IPSL
9h 5m
StRyKeR vs OldBoy
Sziky vs Tarson
BSL 21
9h 5m
StRyKeR vs Artosis
OyAji vs KameZerg
OSC
12h 5m
OSC
22h 5m
Wardi Open
1d 1h
Monday Night Weeklies
1d 6h
OSC
1d 12h
Wardi Open
2 days
Replay Cast
2 days
[ Show More ]
Wardi Open
3 days
Tenacious Turtle Tussle
3 days
The PondCast
3 days
Replay Cast
4 days
LAN Event
5 days
Replay Cast
5 days
Replay Cast
5 days
Sparkling Tuna Cup
6 days
Liquipedia Results

Completed

Proleague 2025-11-21
Stellar Fest: Constellation Cup
Eternal Conflict S1

Ongoing

C-Race Season 1
IPSL Winter 2025-26
KCM Race Survival 2025 Season 4
SOOP Univ League 2025
YSL S2
BSL Season 21
CSCL: Masked Kings S3
SLON Tour Season 2
RSL Revival: Season 3
META Madness #9
BLAST Rivals Fall 2025
IEM Chengdu 2025
PGL Masters Bucharest 2025
Thunderpick World Champ.
CS Asia Championships 2025
ESL Pro League S22
StarSeries Fall 2025
FISSURE Playground #2

Upcoming

BSL 21 Non-Korean Championship
Acropolis #4
IPSL Spring 2026
HSC XXVIII
RSL Offline Finals
WardiTV 2025
IEM Kraków 2026
BLAST Bounty Winter 2026
BLAST Bounty Winter 2026: Closed Qualifier
eXTREMESLAND 2025
ESL Impact League Season 8
SL Budapest Major 2025
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 © 2025 TLnet. All Rights Reserved.