• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 18:04
CEST 00:04
KST 07: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
[ASL22] Ro16 Preview: Rough Waters10[ASL22] Ro24 Preview: Siren's Call8[ASL22] Ro24 Preview: Summer's End9Serral wins HomeStory Cup 2915Serral wins Maestros of the Game 244
Community News
StarCraft open world shooter announced at BlizzCon36Weekly Cups (Aug 30-Sep 7): herO thrives amid growing schism10Official StarCraft website teases new content ahead of BlizzCon?158Stellar Fest TWO the Moon (Dec 16-20)9Weekly Cups (August 24-30): Patches' balance mod takes over3
StarCraft 2
General
StarCraft open world shooter announced at BlizzCon Balance hotfix patch 5.0.16b (July 16) Team Liquid Map Contest #22: Results and Winners Weekly Cups (Aug 30-Sep 7): herO thrives amid growing schism SC4ALL: II Winner will earn a spot at HSC 30!
Tourneys
RSL goes to London! 2026 Offline Finals Nov 21-22 KSL Week #92 IntoTheTV X SOOP SC2 League : Weekly & Monthly 2026 GSTL Announcement Sparkling Tuna Cup - Weekly Open Tournament
Strategy
[G] Having the right mentality to improve
Custom Maps
Nexus Wars 2021 GUIDE [M] (2) Industrial Park
External Content
Mutation # 542 The Ascended Mutation # 541 Binary Choice The PondCast: SC2 News & Results Mutation # 540 Dodge This
Brood War
General
Official StarCraft website teases new content ahead of BlizzCon? Broodwar Prediction Market BGH Auto Balance -> http://bghmmr.eu/ Practice Partners (Official) [D] Brainstorming a balance patch for Brood war
Tourneys
[ASL22] Ro16 Group A [ASL22] Ro16 Group B Escore Tournament - Season 3 Small VOD Thread 2.0
Strategy
Replay Review Process - What do you do? Simple Questions, Simple Answers Odyssey Mineral Stack Saturation Game Theory for Starcraft
Other Games
General Games
Diablo IV Nintendo Switch Thread EVE Corporation [Maplestory Hardcore] Let's Play~!! General RTS Discussion Thread
Dota 2
Official 'what is Dota anymore' discussion
League of Legends
[TL LoL EUW IHs] Teemo shall perish TSM pausing esports and CLG Dead
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 UK Politics Mega-thread Things Aren’t Peaceful in Palestine Trading/Investing Thread Russo-Ukrainian War Thread
Fan Clubs
MarineLorD Fan Club The Creator Fan Club The ShoWTimE Fan Club
Media & Entertainment
Diablo Animated Series on Netflix Movie Discussion!
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
The Automated Ban List Northern Ireland Global Starcraft
Blogs
Virtual Romance, Real-Life C…
TrAiDoS
Regacy Esports:Our Goa…
regacyesports
Dreaming of BW patches (mod…
c3rberUs
LOCKPICKING NOOB
LUCKY_NOOB
Customize Sidebar...

Website Feedback

Closed Threads



Active: 5548 users

The Big Programming Thread - Page 549

Forum Index > General Forum
Post a Reply
Prev 1 547 548 549 550 551 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.
Catch]22
Profile Blog Joined July 2009
Sweden2683 Posts
November 21 2014 16:12 GMT
#10961
Does anyone here have any experience with programming in X++ for MS Dynamics? Or just MS Dynamics in general? I have been interviewed for a job as a Dynamics developer and thought I'd find out what peoples opinions of it is.
Manit0u
Profile Blog Joined August 2004
Poland17843 Posts
November 24 2014 16:52 GMT
#10962
Heh, got another cool project to work on. Was just casually browsing the code to see what I'm dealing with:

Controllers: there's this giant class called Base, everything is there. There are also 2 other classes, which are similarly large and all they do is override methods in the Base and provide hacks for it...

Great code: $something = $someObject->someMethod == 'something' ? $someOtherObject->someOtherMethod : $yetAnotherObject->yetAnotherMethod; repeated 27 times within the same scope... Some super long password encryption/decryption method with $salt = '12345678'; (when will people finally discover password_hash and password_verify?)

Standards: PSR? Never heard of it. SOLID? Can you do me one?

And some of the methods in the base/hack classes? They're overriding parts of methods and invoke the same method from parent in random places (as in: function func() { parent::func(); }).

Now I'm trying to fix a bug which should be super simple but I have 3 methods that try to do the same stuff, each one does it differently though and they're bouncing it back and forth between each other.

Also, fuck WordPress.

Thank you for hearing my woes. It helps immensely.
Time is precious. Waste it wisely.
nunez
Profile Blog Joined February 2011
Norway4003 Posts
November 24 2014 17:12 GMT
#10963
the big programming thread is a reliable shoulder to cry on.
conspired against by a confederacy of dunces.
Blisse
Profile Blog Joined July 2010
Canada3710 Posts
November 24 2014 17:18 GMT
#10964
sounds like pain, kinda the reason why i stay in c# wpf/store land, everything's so well defined and there are guidelines, not like ios land where everything is a controller...
There is no one like you in the universe.
nunez
Profile Blog Joined February 2011
Norway4003 Posts
Last Edited: 2014-11-24 17:49:50
November 24 2014 17:28 GMT
#10965
And some of the methods in the base/hack classes? They're overriding parts of methods and invoke the same method from parent in random places (as in: function func() { parent::func(); }).

is this really a hack though?
thought that was the decorator pattern or something
regardless seems like it could be a useful technique in many scenarios.

oh, but if it's just overriding and then not adding any new functionality, then yeah, i don't get that.
small example with a nice c++11 feature: inherited constructor.

#include<iostream>
#include<string>
#include<utility>
using namespace std;

struct poster{
template<class... arg>
poster(arg&&... a):name(std::forward<arg>(a)...){}
string name;
virtual void
disagree(const poster& p)
{
cout<<name<<": i disagree "<<p.name<<endl;
}
};

struct moderator:poster{
using poster::poster; //inherit constructor of poster base class, c++11
void
disagree(const poster& p) override
{
poster::disagree(p);
cout<<p.name<<" has been banned\n";
}
};

int main()
{
poster p0{"blisse"};
poster p1{"nunez"};
moderator m0{"tofucake"};
p0.disagree(p1);
m0.disagree(p0);
}
[jeh@gimli work]$ ./workbench 
blisse: i disagree nunez
tofucake: i disagree blisse
blisse has been banned
conspired against by a confederacy of dunces.
Blisse
Profile Blog Joined July 2010
Canada3710 Posts
Last Edited: 2014-11-24 18:10:59
November 24 2014 18:10 GMT
#10966
LOL

:3

nunez can you write an astyle config file so i can copy your styling? i like it (except for the lack of space before {'s


alsooo how do you guys feel about namespaces in c++? not worth it to do for personal projects?
There is no one like you in the universe.
nunez
Profile Blog Joined February 2011
Norway4003 Posts
Last Edited: 2014-11-24 19:22:52
November 24 2014 19:12 GMT
#10967
ahah.

astyle, ooh, this looks useful. i'll take a look.

i think namespaces are pretty sweet, f.ex. when you want a place to put implementation
details, however you can achieve same thing with prefixing or postfixing.

but if you want to create a metastructure with a more meaningful semantic than
"implementation detail", like say a type and a set of functions to manipulate the type,
and you're into autocompletion, then postfixing is obviously a bad choice.

i tend to favor namespaces.

equivalent ex:
using partial template specialization of a class template to count the template
arguments of the template argument a function template was instantiated with
(after reading this you will be more inclined to forgive the following syntax).

+ Show Spoiler [example] +
#include<iostream>
#include<string>
#include<utility>
using namespace std;

template<class...>
struct
sequence{};

template<class>
struct
count_detail;

template<class... T>
struct
count_detail<sequence<T...>>
{ static constexpr int output{sizeof...(T)}; };


template<class sequence>
constexpr int
count()
{ return count_detail<sequence>::output; }

int main(){
cout<<count<sequence<int,float,char>>()<<endl;
}
#include<iostream>
#include<string>
#include<utility>
using namespace std;

template<class...>
struct
sequence
{};

namespace detail{

template<class>
struct
count;

template<class... T>
struct
count<sequence<T...>>
{ static constexpr int output{sizeof...(T)}; };

}

template<class sequence>
constexpr int
count()
{ return detail::count<sequence>::output; }

int main(){
cout<<count<sequence<int,float,char>>()<<endl;
}


when writing library stuff (header only, template stuff) i intend to use later i always put whatever is in its interface in a namespace (f.ex jeh for general stuff, or a dedicated one if there number of things in the library is big enough, and their names are collission prone enough), to avoid namespace pollution.

i have yet to write a binary complex enough for a namespace to be meaningful though.
conspired against by a confederacy of dunces.
phar
Profile Joined August 2011
United States1080 Posts
Last Edited: 2014-11-25 01:19:01
November 25 2014 01:18 GMT
#10968
Find a c++ style guide (really any good one, doesn't quite matter which) and follow its suggestions for namespacing. Some common themes:

use unnamed namespaces (e.g. namespace { my code in here ... .... }) when you won't need to refer to stuff elsewhere.

don't use 'using', always put the proper namespace in front of calls (std:: instead of using std)
Who after all is today speaking about the destruction of the Armenians?
Manit0u
Profile Blog Joined August 2004
Poland17843 Posts
Last Edited: 2014-11-25 01:43:23
November 25 2014 01:39 GMT
#10969
On November 25 2014 02:28 nunez wrote:
Show nested quote +
And some of the methods in the base/hack classes? They're overriding parts of methods and invoke the same method from parent in random places (as in: function func() { parent::func(); }).

is this really a hack though?


This becomes a hack when you have something like that:


Class1 extends BaseClass
{
function fu()
{
// set some global app settings
}
}

Class2 extends Class1
{
function fu()
{
// set the same global settings as in Class1, but do it differently

parent::fu();
}
}

Class3 extends Class2
{
function fu()
{
// set the global settings...

parent::fu();
}
}


And then those global settings (which were set in PHP) get overriden by JS (since they store it in the cookies). It's like several people were working on the same issue, each with a different idea on how to approach it and now I have to clean up the mess...

I could understand it if each new class set some new settings and called the parrent to handle others, but each one of them is doing exactly the same thing, but in a different way (the actual result is different as various checks are performed at different times). Like they couldn't just make a method getGlobalSettings() in one place and use it...
Time is precious. Waste it wisely.
Manit0u
Profile Blog Joined August 2004
Poland17843 Posts
November 25 2014 12:34 GMT
#10970
Great, now I've found a switch that spans over 300 lines :/
Time is precious. Waste it wisely.
Deleted User 101379
Profile Blog Joined August 2010
4849 Posts
November 25 2014 12:41 GMT
#10971
On November 25 2014 21:34 Manit0u wrote:
Great, now I've found a switch that spans over 300 lines :/


Soon you are ready to join the club of the legacy code programmers
Manit0u
Profile Blog Joined August 2004
Poland17843 Posts
November 25 2014 12:57 GMT
#10972
On November 25 2014 21:41 Morfildur wrote:
Show nested quote +
On November 25 2014 21:34 Manit0u wrote:
Great, now I've found a switch that spans over 300 lines :/


Soon you are ready to join the club of the legacy code programmers


270 warnings found.
248 weak warnings found.
479 typos found.

And it's just one class...
Time is precious. Waste it wisely.
bangsholt
Profile Joined June 2011
Denmark138 Posts
November 25 2014 16:16 GMT
#10973
On November 25 2014 21:41 Morfildur wrote:
Show nested quote +
On November 25 2014 21:34 Manit0u wrote:
Great, now I've found a switch that spans over 300 lines :/


Soon you are ready to join the club of the legacy code programmers


There will be many tears. And lost hair. And lost sanity. But in the end... Right, there's no end. My bad.
spinesheath
Profile Blog Joined June 2009
Germany8679 Posts
November 25 2014 17:28 GMT
#10974
The hack is the global.
Be happy it's not the same switch in 30 places.
If you have a good reason to disagree with the above, please tell me. Thank you.
Manit0u
Profile Blog Joined August 2004
Poland17843 Posts
November 25 2014 18:24 GMT
#10975
On November 26 2014 02:28 spinesheath wrote:
The hack is the global.
Be happy it's not the same switch in 30 places.


Haha, thankfully there are no 30 places, just classes that are 5k lines long...
Time is precious. Waste it wisely.
Ben...
Profile Joined January 2011
Canada3485 Posts
Last Edited: 2014-11-25 20:09:42
November 25 2014 20:07 GMT
#10976
On November 25 2014 02:12 nunez wrote:
the big programming thread is a reliable shoulder to cry on.

Can I vent at it too? The crying has already passed.

I just did about ~45 hours of operating system programming over a 4 day period because my partner for my OS class decided that working on our assignment was no longer in her best interest. She had told me that she would start working on it mid last week after finishing another assignment. After that it was radio silence. Not a single response to my emails or texts, no commits. She did one small commit on Saturday that mostly involved undoing all my work, which I then promptly overwrote (and she sent me a passive aggressive email about). Then yesterday, around 6 hours before it was due, she starts working on it. I'd rather she hadn't. She did maybe 5% of the assignment, and everything she contributed was broken because she didn't understand how to do things (all the stuff we were doing had to be passed through a different function which then deals with userland stuff) or do anything remotely right (keep in mind this person is a full time software developer who is being paid to go to school).

Things she didn't do:
- testing. As in see if her code even compiles. She did a huge commit around 30 minutes prior to the assignment being due that had around 2 screens worth of errors (most because of the point below this one but others because she used -> when she shouldn't have or because of points 4 and 5 below this one). I ended up commenting all of it out. Our prof stated he would rather our code compile and run but be incomplete over being complete and not compiling/running. I was about to just revert back and remove her changes but I got everything working again so I didn't. I told her quite clearly that no major changes were allowed to the OS any time 4 hours before the thing was due so we would be guaranteed to have a compiling and running OS. She obviously didn't listen. She tried swapping out the default scheduler for her own, which didn't compile or wasn't even known to work. I undid that too.
- include headers. She literally didn't include a single header in any of her stuff. I had to do that all myself.
- finish include guards. Every header she made was missing #endif in the include guard
- include said headers in the files that need them. Again, not a single include.
- declare variables. This one baffled me. I would guess she didn't declare maybe half of the variables she used.
- declare function signatures. I can see forgetting to do the void part for declaring a function with no inputs( say something like int foo(void); ) in a header, but forgetting to add in the input parameters in a function that needs them. I mean what?
- understand how extern works. The few times she did declare variables she almost always used extern. In 2 different files she called extern on things that either didn't exist or were structures(?). Every time she would use "struct foo" she would add extern in front, even though she was declaring a local variable of that struct.
- follow the course style guide. Ever. At all. Not even once. We already lost marks on two assignments because of it and she still won't adapt.

Things she did do:
- use what appear to be macros without declaring them (really, I'm not exactly sure what they were supposed to be. grepping the source code came up with nothing other than her stuff. They weren't in any other files or documentation)
- attempt to use built in macros but use them all wrong
- signed and unsigned comparison in vital system code (as in our process scheduler and a few other things). Most of them by default failed.
- overwrite function signatures for stuff I was working on "because it doesn't match the man pages" despite the fact that we aren't going by the man pages, and are instead going by the spec outlined in a file within the OS that I sent her an email about
- COMMITS WITHOUT EVER DOING UPDATES FIRST TO CHECK FOR CHANGES (this is partly because we had to use svn but still, it's common sense. In git, from what I remember, it runs an update when doing commits) I did a whole bunch of fault/error fixes to a commit she did in that 6 hour period prior to submission, I would guess she did that commit around 5 hours before the thing was due. When she did her second commit a half hour before submission, none of those fixes were there anymore. No svn updates were run in 5 hours with the knowledge that another person was working on the file to.

Apologies for the long ranty post, but seriously if you do any of the stuff outlined above, please think about the other people working with you and maybe change your ways. I just needed to get this off my chest. I hope you guys understand.
"Cliiiiiiiiiiiiiiiiide" -Tastosis
Alzadar
Profile Blog Joined April 2010
Canada5009 Posts
November 25 2014 20:57 GMT
#10977
Sounds like your problem was partnering up with some sort of evil programming boggart.
I am the Town Medic.
Pirfiktshon
Profile Joined June 2013
United States1072 Posts
November 25 2014 21:23 GMT
#10978
Your first tip off should have been it was a she hahaha. If she's pretty you were pretty much screwed the moment you partnered up LOL

Is there any space here for a penetration tester(white hat hacker)?
Isualin
Profile Joined March 2011
Germany1903 Posts
November 25 2014 21:29 GMT
#10979
Did you choose your partner randomly in this project? I think you should try talking to her straigth up before your next project about all these things.
| INnoVation | The literal god TY | ByuNjwa | LRSL when? |
Alzadar
Profile Blog Joined April 2010
Canada5009 Posts
November 25 2014 21:34 GMT
#10980
On November 26 2014 06:23 Pirfiktshon wrote:
Your first tip off should have been it was a she hahaha. If she's pretty you were pretty much screwed the moment you partnered up LOL


wtf what an awful thing to say. Please inform yourself on the terms "confirmation bias" and "stereotype threat" and try not to perpetuate the stereotype about male programmers while you're at it.
I am the Town Medic.
Prev 1 547 548 549 550 551 1032 Next
Please log in or register to reply.
Live Events Refresh
OSC
20:30
Masters Cup #151
davetesta39
Liquipedia
AI Arena Tournament
17:00
Swiss - Round 1
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
Tasteless 441
SpeCial 104
ViBE93
CosmosSc2 67
Nina 57
StarCraft: Brood War
Britney 13997
Artosis 539
NaDa 21
Dota 2
monkeys_forever248
canceldota45
LuMiX1
League of Legends
Doublelift5636
JimRising 468
Counter-Strike
fl0m4213
Coldzera 1438
minikerr7
Super Smash Bros
C9.Mang0225
Chillindude24
Heroes of the Storm
Liquid`Hasu1393
Trikslyr105
Other Games
summit1g10506
Grubby7635
B2W.Neo1224
RotterdaM585
XaKoH 160
Dewaltoss24
Organizations
Heroes of the Storm
Heroes of the Storm4291
StarCraft 2
StarCraft972
StarCraft: Brood War
Afreeca ASL 521
Other Games
BasetradeTV261
[ Show 13 non-featured ]
StarCraft 2
• Hupsaiya 128
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• Migwel
StarCraft: Brood War
• FirePhoenix9
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• masondota21392
Other Games
• imaqtpie888
• Shiphtur163
Upcoming Events
Sparkling Tuna Cup
11h 56m
WardiTV Invitational
12h 56m
ByuN vs Percival
Cure vs Classic
Shopify Rebellion Sundays
16h 56m
Spirit vs Mixu
Clem vs TBD
RSL Revival
17h 56m
Serral vs Rogue
BlizzCon
20h 26m
IdrA vs MC
Replay Cast
1d 1h
Afreeca Starleague
1d 11h
Light vs JyJ
Soulkey vs hero
WardiTV Weekly
1d 12h
Monday Night Weeklies
1d 17h
Afreeca Starleague
2 days
Snow vs Shinee
Shine vs EffOrt
[ Show More ]
GSL
2 days
PiGosaur Cup
3 days
The PondCast
3 days
Kung Fu Cup
3 days
Replay Cast
4 days
KCM Race Survival
4 days
IntoTheTV X SOOP
4 days
Replay Cast
5 days
IntoTheTV X SOOP
5 days
Replay Cast
6 days
GSL
6 days
Liquipedia Results

Completed

Acropolis #5 - TRS
PiG Sty Festival 8.0
Big Dog Cup 2026 Div 1

Ongoing

KCM Race Survival 2026 Season 3
K-JUNGMAN
ASL Season 22
Super Anchor Qualifying S3
CSL 2026 AUTUMN (S22)
Acropolis #5
RSL Revival: Season 6
Calamity Invitational
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

Blizzard Classic Cup 2026
Acropolis #5 - GSA
Acropolis #5 - GSB
Acropolis #5 - GSC
SC4ALL II: Brood War
HSC XXX
Stellar Fest 2: Lunar Cup
SC4ALL II: StarCraft II
Kung Fu Cup 2026 Grand Finals
RSL Offline Finals
Blizzard Classic Cup 2026
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
Logitech G Play Connect 2026
SL StarSeries Fall 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.