• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 04:04
CEST 10:04
KST 17:04
  • 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
[ASL21] Ro16 Preview Pt2: All Star5Team Liquid Map Contest #22 - The Finalists14[ASL21] Ro16 Preview Pt1: Fresh Flow9[ASL21] Ro24 Preview Pt2: News Flash10[ASL21] Ro24 Preview Pt1: New Chaos0
Community News
2026 GSL Season 1 Qualifiers11Maestros of the Game 2 announced32026 GSL Tour plans announced13Weekly Cups (April 6-12): herO doubles, "Villains" prevail1MaNa leaves Team Liquid22
StarCraft 2
General
Blizzard Classic Cup @ BlizzCon 2026 - $100k prize pool 2026 GSL Tour plans announced MaNa leaves Team Liquid Team Liquid Map Contest #22 - The Finalists Weekly Cups (April 6-12): herO doubles, "Villains" prevail
Tourneys
Sparkling Tuna Cup - Weekly Open Tournament GSL CK: More events planned pending crowdfunding 2026 GSL Season 1 Qualifiers Master Swan Open (Global Bronze-Master 2) SEL Doubles (SC Evo Bimonthly)
Strategy
Custom Maps
[D]RTS in all its shapes and glory <3 [A] Nemrods 1/4 players [M] (2) Frigid Storage
External Content
Mutation # 522 Flip My Base The PondCast: SC2 News & Results Mutation # 521 Memorable Boss Mutation # 520 Moving Fees
Brood War
General
BGH Auto Balance -> http://bghmmr.eu/ [ASL21] Ro16 Preview Pt2: All Star Data needed RepMastered™: replay sharing and analyzer site Gypsy to Korea
Tourneys
[ASL21] Ro16 Group C [Megathread] Daily Proleagues Escore Tournament StarCraft Season 2 [ASL21] Ro16 Group A
Strategy
Simple Questions, Simple Answers What's the deal with APM & what's its true value Any training maps people recommend? Fighting Spirit mining rates
Other Games
General Games
Nintendo Switch Thread General RTS Discussion Thread Battle Aces/David Kim RTS Megathread Stormgate/Frost Giant Megathread Starcraft Tabletop Miniature Game
Dota 2
The Story of Wings Gaming
League of Legends
G2 just beat GenG in First stand
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
Vanilla Mini Mafia Mafia Game Mode Feedback/Ideas TL Mafia Community Thread Five o'clock TL Mafia
Community
General
Things Aren’t Peaceful in Palestine US Politics Mega-thread Russo-Ukrainian War Thread YouTube Thread Canadian Politics Mega-thread
Fan Clubs
The IdrA Fan Club
Media & Entertainment
[Manga] One Piece Anime Discussion Thread [Req][Books] Good Fantasy/SciFi books Movie Discussion!
Sports
2024 - 2026 Football Thread McBoner: A hockey love story Formula 1 Discussion Cricket [SPORT]
World Cup 2022
Tech Support
[G] How to Block Livestream Ads
TL Community
The Automated Ban List
Blogs
Reappraising The Situation T…
TrAiDoS
lurker extra damage testi…
StaticNine
Broowar part 2
qwaykee
Funny Nicknames
LUCKY_NOOB
Iranian anarchists: organize…
XenOsky
ASL S21 English Commentary…
namkraft
Customize Sidebar...

Website Feedback

Closed Threads



Active: 3635 users

The Big Programming Thread - Page 829

Forum Index > General Forum
Post a Reply
Prev 1 827 828 829 830 831 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
January 19 2017 02:10 GMT
#16561
Virtual dispatch is slower in many cases. Consider that an indirect call cannot be predicted nor inlined. Some benchmarks have found a difference of 7 x in favor of static calls.
Nesserev
Profile Blog Joined January 2011
Belgium2760 Posts
January 19 2017 03:29 GMT
#16562
--- Nuked ---
Svazila
Profile Joined January 2017
1 Post
January 19 2017 05:21 GMT
#16563
--- Nuked ---
Blisse
Profile Blog Joined July 2010
Canada3710 Posts
Last Edited: 2017-01-19 07:34:07
January 19 2017 07:30 GMT
#16564
On January 19 2017 12:29 Nesserev wrote:
Started reading the 'Modern C' book that was linked by Biolunar + Show Spoiler [a few pages back] +
On January 03 2017 20:37 Biolunar wrote:
Show nested quote +
On January 03 2017 00:20 Silvanel wrote:
What resources would You guys recommend to someone trying to learn C ?

This might be too hard if you have no programming experience, but if you do, use this:
http://icube-icps.unistra.fr/index.php/File:ModernC.pdf
This book focuses on how to avoid many of C’s pitfalls and teaches many good habits that are not possible in older versions of the language.

.
What's your opinion on using the 'array notation' for passing arrays as arguments to functions in C/C++?

On page 13-14, the book recommends the array notation, naming readability and (what comes down to) documentation as reasons. On the other hand, it obfuscates what's really going on (it's just a pointer in the end, and you probably need to pass an extra size_t anyway), and seems to lead to obscure/hard-to-find bugs.

Anything I missed?


Not always right to quote Linus but here's his thoughts.

https://lkml.org/lkml/2015/9/3/428


static bool rate_control_cap_mask(struct ieee80211_sub_if_data *sdata,
struct ieee80211_supported_band *sband,
struct ieee80211_sta *sta, u32 *mask,
u8 mcs_mask[IEEE80211_HT_MCS_MASK_LEN])

...

for (i = 0; i < sizeof(mcs_mask); i++)

the "sizeof(mcs_mask)" is _shit_. Since array arguments don't actually
exist in C, it is the size of the pointer, not the array. The first
mistake makes the bug look like reasonable code.

...

I realy want people to take a really hard look at functions that use
arrays as arguments. It really is very misleading, even if it can look
"prettier", and some people will argue that it's "documentation" about
how the pointer is a particular size. But it's neither. It's basically
just lying about what is going on, and the only thing it documents is
"I don't know how to C". Misleading documentation isn't documentation,
it's a mistake.


I've never seen the array notation in production code so I'd never use it. My coding conventions and/or abstractions make it clear enough what's going on, i.e. arr and arrLength as param names, or passing structs with size members.
There is no one like you in the universe.
Biolunar
Profile Joined February 2012
Germany224 Posts
Last Edited: 2017-01-19 11:32:50
January 19 2017 11:30 GMT
#16565
On January 19 2017 12:29 Nesserev wrote:
Started reading the 'Modern C' book that was linked by Biolunar + Show Spoiler [a few pages back] +
On January 03 2017 20:37 Biolunar wrote:
Show nested quote +
On January 03 2017 00:20 Silvanel wrote:
What resources would You guys recommend to someone trying to learn C ?

This might be too hard if you have no programming experience, but if you do, use this:
http://icube-icps.unistra.fr/index.php/File:ModernC.pdf
This book focuses on how to avoid many of C’s pitfalls and teaches many good habits that are not possible in older versions of the language.

.
What's your opinion on using the 'array notation' for passing arrays as arguments to functions in C/C++?

On page 13-14, the book recommends the array notation, naming readability and (what comes down to) documentation as reasons. On the other hand, it obfuscates what's really going on (it's just a pointer in the end, and you probably need to pass an extra size_t anyway), and seems to lead to obscure/hard-to-find bugs.

Anything I missed?

Every C programmer should know what array to pointer decay is. Array notations in function declarations are just eye candy. Just follow your own intuition.

I am starting to use the following convention:
  • void foo(T param[static 1]); for functions that take exactly one parameter as a pointer
  • void foo(T* param); for functions that take exactly one parameter as a pointer or a null pointer
  • void foo(T param[static N], size_t count); for functions that take at least N parameters, where N is an integral constant expression

That book also uses VLAs for array parameters which I don’t use. Ever.
What is best? To crush the Zerg, see them driven before you, and hear the lamentations of the Protoss.
spinesheath
Profile Blog Joined June 2009
Germany8679 Posts
January 19 2017 18:31 GMT
#16566
On January 19 2017 11:10 Hanh wrote:
Virtual dispatch is slower in many cases. Consider that an indirect call cannot be predicted nor inlined. Some benchmarks have found a difference of 7 x in favor of static calls.

Of course a virtual dispatch is slower than a static call. But virtual dispatch is not necessarily slower than a conditional. Especially if there are many branches or the comparision is complex, like a string comparision.
If you have a good reason to disagree with the above, please tell me. Thank you.
Hanh
Profile Joined June 2016
146 Posts
January 20 2017 00:30 GMT
#16567
I was not talking about a dumb static call but static dispatch. Some compilers actually implement 'devirtualization' for this reason.
Blisse
Profile Blog Joined July 2010
Canada3710 Posts
Last Edited: 2017-01-20 04:03:42
January 20 2017 00:43 GMT
#16568
On January 19 2017 20:30 Biolunar wrote:
Show nested quote +
On January 19 2017 12:29 Nesserev wrote:
Started reading the 'Modern C' book that was linked by Biolunar + Show Spoiler [a few pages back] +
On January 03 2017 20:37 Biolunar wrote:
Show nested quote +
On January 03 2017 00:20 Silvanel wrote:
What resources would You guys recommend to someone trying to learn C ?

This might be too hard if you have no programming experience, but if you do, use this:
http://icube-icps.unistra.fr/index.php/File:ModernC.pdf
This book focuses on how to avoid many of C’s pitfalls and teaches many good habits that are not possible in older versions of the language.

.
What's your opinion on using the 'array notation' for passing arrays as arguments to functions in C/C++?

On page 13-14, the book recommends the array notation, naming readability and (what comes down to) documentation as reasons. On the other hand, it obfuscates what's really going on (it's just a pointer in the end, and you probably need to pass an extra size_t anyway), and seems to lead to obscure/hard-to-find bugs.

Anything I missed?

Every C programmer should know what array to pointer decay is. Array notations in function declarations are just eye candy. Just follow your own intuition.

I am starting to use the following convention:
  • void foo(T param[static 1]); for functions that take exactly one parameter as a pointer
  • void foo(T* param); for functions that take exactly one parameter as a pointer or a null pointer
  • void foo(T param[static N], size_t count); for functions that take at least N parameters, where N is an integral constant expression

That book also uses VLAs for array parameters which I don’t use. Ever.


The problem with the static keyword and the array notation is it still looks like sizeof(param) will return N instead of sizeof(T*), even if you're familiar with the array decay. In C I think it's super important to practice defensive programming, which is to avoid situations like this, as per the Linus example I linked previously.

Or I may be misreading your convention, in which case why use a param array instead of the param directly? I've never seen a param array like that. That looks like a typecasting error prone nightmare?
There is no one like you in the universe.
BlueRoyaL
Profile Blog Joined February 2006
United States2493 Posts
January 20 2017 05:57 GMT
#16569
Hey guys, I have a (semi) silly question, just want to get your opinions.

I've been thinking of starting to blog again about programming stuff. I had set one up a couple years ago that's titled "Finally Working", with the sub text "thank god it compiled".

At the time I thought it was funny, and i wouldnt mind continuing to use it. But from your professional standpoint, does it seem a little weird or offsetting? As in, if you were some recruiter and happened to be on the page, would it bother you that the creator used the line "thank god it compiled", possibly indicating some level of ineptitude in programming?

I might just be overthinking this, any thoughts?
WHAT'S HAPPENIN
Blisse
Profile Blog Joined July 2010
Canada3710 Posts
January 20 2017 07:22 GMT
#16570
On January 20 2017 14:57 BlueRoyaL wrote:
Hey guys, I have a (semi) silly question, just want to get your opinions.

I've been thinking of starting to blog again about programming stuff. I had set one up a couple years ago that's titled "Finally Working", with the sub text "thank god it compiled".

At the time I thought it was funny, and i wouldnt mind continuing to use it. But from your professional standpoint, does it seem a little weird or offsetting? As in, if you were some recruiter and happened to be on the page, would it bother you that the creator used the line "thank god it compiled", possibly indicating some level of ineptitude in programming?

I might just be overthinking this, any thoughts?


In my opinion no one would care if you had more than 3 non-insignificant blog posts.
There is no one like you in the universe.
RoomOfMush
Profile Joined March 2015
1296 Posts
January 20 2017 10:26 GMT
#16571
On January 20 2017 14:57 BlueRoyaL wrote:
Hey guys, I have a (semi) silly question, just want to get your opinions.

I've been thinking of starting to blog again about programming stuff. I had set one up a couple years ago that's titled "Finally Working", with the sub text "thank god it compiled".

At the time I thought it was funny, and i wouldnt mind continuing to use it. But from your professional standpoint, does it seem a little weird or offsetting? As in, if you were some recruiter and happened to be on the page, would it bother you that the creator used the line "thank god it compiled", possibly indicating some level of ineptitude in programming?

I might just be overthinking this, any thoughts?

I wouldnt care. But how useful this information is to you I dont know.
Acrofales
Profile Joined August 2010
Spain18265 Posts
January 20 2017 10:39 GMT
#16572
On January 20 2017 14:57 BlueRoyaL wrote:
Hey guys, I have a (semi) silly question, just want to get your opinions.

I've been thinking of starting to blog again about programming stuff. I had set one up a couple years ago that's titled "Finally Working", with the sub text "thank god it compiled".

At the time I thought it was funny, and i wouldnt mind continuing to use it. But from your professional standpoint, does it seem a little weird or offsetting? As in, if you were some recruiter and happened to be on the page, would it bother you that the creator used the line "thank god it compiled", possibly indicating some level of ineptitude in programming?

I might just be overthinking this, any thoughts?

If your blog is useful, the title doesn't matter. If your blog is useless/bad, the least you have to worry about is choosing a funny title.

In other words, if your blog sucks, don't show it to your future employer. If it is good, add it to your CV. In either case, don't worry about the title.
Djagulingu
Profile Blog Joined December 2010
Germany3605 Posts
Last Edited: 2017-01-20 12:47:09
January 20 2017 12:46 GMT
#16573
On January 20 2017 14:57 BlueRoyaL wrote:
Hey guys, I have a (semi) silly question, just want to get your opinions.

I've been thinking of starting to blog again about programming stuff. I had set one up a couple years ago that's titled "Finally Working", with the sub text "thank god it compiled".

At the time I thought it was funny, and i wouldnt mind continuing to use it. But from your professional standpoint, does it seem a little weird or offsetting? As in, if you were some recruiter and happened to be on the page, would it bother you that the creator used the line "thank god it compiled", possibly indicating some level of ineptitude in programming?

I might just be overthinking this, any thoughts?

Yes you're overthinking. As long as your content is halfway decent, the single worst thing the recruiter could think about that title is "Good thing this dude is not a comedian or some shit".
"windows bash is a steaming heap of shit" tofucake
Manit0u
Profile Blog Joined August 2004
Poland17727 Posts
January 20 2017 13:08 GMT
#16574
Will this blog be only about compiled languages?
Time is precious. Waste it wisely.
BlueRoyaL
Profile Blog Joined February 2006
United States2493 Posts
January 20 2017 16:00 GMT
#16575
On January 20 2017 22:08 Manit0u wrote:
Will this blog be only about compiled languages?


Not necessarily. I was mainly a sysadmin back when i created it, but since then i've pivoted and work as a dev on the full stack. There might occasionally be something about frontend stuff as well.
WHAT'S HAPPENIN
phar
Profile Joined August 2011
United States1080 Posts
January 20 2017 17:00 GMT
#16576
Is the title sort of sarcastically pointing out that cowboy coding and shipping shit as soon as it compiles causes people problems down the road (e.g. the poor saps on call)? If so I think it's a genius title if you can pull in some horror stories from sysadmin days when you got burned by that sort of thing.
Who after all is today speaking about the destruction of the Armenians?
Manit0u
Profile Blog Joined August 2004
Poland17727 Posts
January 24 2017 12:25 GMT
#16577
https://aturon.github.io/blog/2016/08/11/futures/

[image loading]

User was warned for this post
Time is precious. Waste it wisely.
Hanh
Profile Joined June 2016
146 Posts
January 25 2017 02:18 GMT
#16578
Yeah, it's amazing that someone can take something that was available for years and present it as new.
Deleted User 101379
Profile Blog Joined August 2010
4849 Posts
January 25 2017 11:45 GMT
#16579
On January 25 2017 11:18 Hanh wrote:
Yeah, it's amazing that someone can take something that was available for years and present it as new.


The whole programming sector ist moving in circles. Every few years a "new thing" appears, gets replaced by something better which gets replaced by something more advanced which then gets replaced by another "new Thing" - which is pretty much the same thing everything started with, just with a fancier name.

Programmers are experts in reinventing wheels and calling them "best new things that change everything".
Manit0u
Profile Blog Joined August 2004
Poland17727 Posts
January 25 2017 12:47 GMT
#16580
How can people work with white background in their IDE is beyond me...
Time is precious. Waste it wisely.
Prev 1 827 828 829 830 831 1032 Next
Please log in or register to reply.
Live Events Refresh
Next event in 56m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
SortOf 80
StarCraft: Brood War
Zeus 2695
Hyuk 1157
firebathero 926
ToSsGirL 173
Stork 150
Dewaltoss 55
Shine 32
Killer 25
BeSt 23
Bale 21
[ Show more ]
Sharp 20
yabsab 16
Sea 0
Dota 2
NeuroSwarm113
League of Legends
JimRising 646
Counter-Strike
Stewie2K1013
Super Smash Bros
Mew2King49
Other Games
C9.Mang0388
Happy246
crisheroes85
Livibee54
Organizations
Dota 2
PGL Dota 2 - Main Stream6234
PGL Dota 2 - Secondary Stream4982
StarCraft: Brood War
lovetv 15
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 12 non-featured ]
StarCraft 2
• Berry_CruncH244
• LUISG 30
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Upcoming Events
Replay Cast
56m
Afreeca Starleague
1h 56m
Bisu vs Ample
Jaedong vs Flash
Wardi Open
2h 56m
Monday Night Weeklies
7h 56m
RSL Revival
17h 56m
GSL
23h 56m
Afreeca Starleague
1d 1h
Barracks vs Leta
Royal vs Light
WardiTV Map Contest Tou…
1d 2h
RSL Revival
2 days
Replay Cast
2 days
[ Show More ]
The PondCast
3 days
KCM Race Survival
3 days
WardiTV Map Contest Tou…
3 days
CranKy Ducklings
3 days
Escore
4 days
RSL Revival
4 days
WardiTV Map Contest Tou…
5 days
Universe Titan Cup
5 days
Rogue vs Percival
Ladder Legends
5 days
uThermal 2v2 Circuit
5 days
BSL
5 days
Sparkling Tuna Cup
6 days
WardiTV Map Contest Tou…
6 days
Ladder Legends
6 days
BSL
6 days
Replay Cast
6 days
Liquipedia Results

Completed

Escore Tournament S2: W3
RSL Revival: Season 4
NationLESS Cup

Ongoing

BSL Season 22
ASL Season 21
CSL 2026 SPRING (S20)
IPSL Spring 2026
KCM Race Survival 2026 Season 2
StarCraft2 Community Team League 2026 Spring
WardiTV TLMC #16
Nations Cup 2026
IEM Rio 2026
PGL Bucharest 2026
Stake Ranked Episode 1
BLAST Open Spring 2026
ESL Pro League S23 Finals
ESL Pro League S23 Stage 1&2
PGL Cluj-Napoca 2026
IEM Kraków 2026

Upcoming

Escore Tournament S2: W4
Acropolis #4
BSL 22 Non-Korean Championship
CSLAN 4
Kung Fu Cup 2026 Grand Finals
HSC XXIX
uThermal 2v2 2026 Main Event
2026 GSL S2
RSL Revival: Season 5
2026 GSL S1
XSE Pro League 2026
IEM Cologne Major 2026
Stake Ranked Episode 2
CS Asia Championships 2026
IEM Atlanta 2026
Asian Champions League 2026
PGL Astana 2026
BLAST Rivals Spring 2026
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.