« first day (734 days earlier)      last day (4217 days later) » 

3:00 PM
Plainly answering the question vs telling the asker he's on the wrong way and that as such his question is nonsense?
 
and like any other XY problem, there's nothing wrong with simply attacking the actual problem, instead of his failure of an attempted solution
 
@EtiennedeMartel answer the question and tell him he's on the wrong path.
 
@EtiennedeMartel por qué no los dos?
 
@LuchianGrigore That gives a chance that he'll use your solution anyway. And then we'll have one more bad C++ programmer.
 
If I had to pick one of the two I'd pick the second option anyway.
If I can improve something, then might as well.
 
3:02 PM
@DeadMG BASIC?
 
Not enough std::string. — DeadMG 2 mins ago
Wonderful.
 
@daknøk huh?
 
Okay listen up. You probably either never worked on a large code-base, or you've been extremely lucky, but all this "use std::string" everywhere is bullshit. Sometimes, you can't. It's so hard-coded in the depths of the system that there's just no way (or plain too risky) to modify that raw pointer or that char*.
So then there's a guy asking you "why does this pointer whatever fail?" and you answer "fuck off retard, you're not supposed to use raw pointers in C++" but he simply doesn't have a choice. So what then?
 
@Cheersandhth.-Alf ugh I meant memcpy. I think I saw somebody using that.
 
uh, dunno if you've noticed, but it's actually really fucking easy to swap in std::string on a case by case basis.
 
3:05 PM
@LuchianGrigore True, but this is statistically low when you look at that question. The probability of the guy being a total noob is about 99.9997%
 
I don't see how it's possible, given std::string's simple and easy interop, to not have a choice in using it.
 
Needs more 9s.
 
@DeadMG then you fall in the two categories I listed. Good for you!
 
pfft
why don't you get off your "I'm so much more experienced" horse and actually demonstrate a situation in which it is not possible to locally replace std::string?
 
@LuchianGrigore I used to answer like you at my beginnings on SO. I just answered plainly, without trying to guess what was the "meta problem" of OP.
 
3:06 PM
@DeadCicada That's true, but then there'a a chance he'll go to a C++ interview and they'll ask him what a char* is and he'll say "oh, I dunno, I only know C++"
 
@LuchianGrigore That's a good answer.
 
@LuchianGrigore Which is a perfectly good response.
 
lol
 
A char* is a pointer to a char object.
 
reminds of a guy over at some microsoft forum, years ago. he refused to acknowledge logic and facts, and insisted on me explaining what my experience with the problem at hand, was. i think maybe he was trolling. i never experienced that problem. but it was easy to see solution
 
3:07 PM
@DeadMG right - only that most companies (esp with C++) aren't start-ups. 75% of the code is old. And untouchable
 
@LuchianGrigore “pointer to char” even if you never use raw pointers, the chance you know about them when being serious and going to an interview is 99%.
 
@LuchianGrigore And he's obviously not dealing with untouchable code, because he's touching it to do the other modifications.
 
@LuchianGrigore Yet another reason to not work for these companies
 
and since you can swap in std::string in any function without having to alter any other function in the system
 
Oh, misfire.
 
3:08 PM
I don't see how it's problematic
 
@R.MartinhoFernandes I accidentally the return key
 
> You probably either never worked on a large code-base, or you've been extremely luck
 
blah blah blah
prove it
 
how would I prove that?
 
Don't you work at EA?
 
3:09 PM
show a function where you can't just swap in std::string.
 
:)) You think changing a base module is as easy as opening the file and modifying it.
 
I think refactoring tools are pretty powerful.
 
And the fact that OP is a very probably a noob, as pointed out by Cicada, only makes it even wiser to tell him to use std::string since you shouldn’t start with pointers when learning C++.
 
You're missing the code-reviews & layers of management a code deep enough has to go through.
 
except he already has to go through all of that since he's already modifying whatever function that is
 
3:10 PM
I googled his name and he doesn't have a LinkedIn so I doubt he's a professional. Well not a C developer. I found one for web developer.
 
Layers of management = I don’t want to work for that shitty company.
 
I'm not saying he is
 
the ultimate example: microsoft having a single guy using over 1 year on the "shutdown" choice in the Start menu
that was for Windows XP
 
There is a kind of "no true irishman" going on here
 
he had to go through all kinds of silly management overhead
 
3:11 PM
isn't it "no true scotsman"?
and secondly
 
And code reviews only go better when writing understandable code, i.e. without pointers everywhere.
 
@Cheersandhth.-Alf What.
 
if your management structure is preventing you from making necessary changes, then it's a problem- and a separate one to the technical issue at hand
 
true story
 
@DeadMG Yep.
 
3:11 PM
You people argue that string should be used in as many places as possible, and when presented with cases where this is not possible, you just explain that you don't want to work at places like these
 
@kbok No cases have been presented. I didn't make any such statement.
 
@kbok No. You are missing the point.
 
A change isn't necessary unless it's a problem. You live in an ideal world where you're not taking into account the costs that come with the change. If a module is 10 years old and hundreds of char*'s inside but works perfectly, why invest many man-hours in refactoring it.
 
Or, it's a management issue. Whatever. The fact is that in this case, solving a technical issue with raw pointers is way more efficient than fighting all your way with management and you coworkers.
 
@Rapptz, there are no classes in the question code. — hmjd 39 secs ago
I've never seen such a woosh before on SO :(
 
3:12 PM
@LuchianGrigore Which is not OP's case
 
@LuchianGrigore I don't understand that. If it's working perfectly, why are you touching it at all in the first place?
 
@DeadCicada we're beyond the question now.
 
Stop arguing about stuff not related to the question.
 
@LuchianGrigore It doesn't take many man-hours. It'll only take about two minutes. And secondly, he's obviously already refactoring it since he's making other changes.
 
@LuchianGrigore Pointless!
 
3:13 PM
@R.MartinhoFernandes because char* is bad
 
which it is
 
I'm done :)
 
and I'm not saying that everybody should go and immediately re-write every line using char*, ever.
 
@DeadMG tell me how many char*'s you removed from the codebase when you move to Oracle.
 
I wrote const char *, not char const *, these are 2 different things. — icepack 8 mins ago
What a bunch of fools.
 
3:14 PM
all I am saying is that if you're already refactoring a function, it's an obvious incremental improvement to make.
 
All I'm saying it's not
 
well, let me see
 
@LuchianGrigore No, you did not understand. If he is having problems with char* somehwere, anywhere, it doesn't matter how old, it's obviously not working "perfectly".
 
you can refactor that one function without having to touch any other function that calls it or that it calls
and you're pretty much guaranteed to reduce error, both now and in the future
and it's extremely quick even for large functions
so I'm not seeing the downside here
yep
which is fine, since they interoperate really quite well
 
(bad argument)
 
3:15 PM
k
 
If you have to refactor char* everywhere in your program even once, you're using the wrong language
 
People are trying to be serious here.
 
std::thread spiderman([] {
    lounge_cxx.invade();
});
 
WTF is a spiderman thread?
 
lol
 
3:16 PM
There is the trivially simple case where management doesn't want you to stuff string into their module.
 
@DeadMG Not a 4chaner I see :)
 
that's not a technical problem
 
@DeadMG A thread where people post Spiderman pictures.
 
that's a management problem
 
@DeadMG you're not getting what I'm trying to say.
 
3:17 PM
and has nothing to do with it, really
 
So your solution is "fuck off, this is a management problem, either get your boss fired or quit" ?
 
^ this
 
no, I'm saying that the solution to a management problem is to deal with it
not to just throw up your hands and piss on the code and the carpet
 
That's where you're wrong
 
No, you should ragequit and join another company.
 
3:18 PM
@daknøk and come back a month later with 1 rep?
 
A programmer's job is not just about editing code, it's about dealing with all the bullshit coming from all directions
 
@LuchianGrigore Zing!
 
@DeadMG Sure, deal with it, then change jobs next chance you get
 
Specs changes, stupid/incompetent coworkers, sucky TPL, or dumbass management
 
@LuchianGrigore $1, in real-life.
 
3:19 PM
And sometimes, it's about solving technical issues
And that's what you all fail to see
 
hmm
 
This is why "dumbass use std::string" is a valid answer for a noob, but not when you're on your job
 
I don’t see why a small company would ever need lasagna management.
 
@kbok That's what we all want to fight.
 
I'm pretty sure that it's a programmer's job to deal with specs changes, and less able coworkers (not sure what TPL is)
 
3:21 PM
@kbok I would go further and say not even for a noob.
But I guess that's a different story.
 
but dealing with dumbass management means fixing the problem, not ignoring it.
 
Programmers as I see it are the technical experts and should say what can be done and what can't. You don't see clients ask architects to build a bridge that floats using only balloons because the architect will say to stuff it
 
@DeadMG third party libraries
 
we've been shamelessly demoted in this respect
 
yeah, I'll give you that too
 
3:21 PM
I wouldn’t hire anyone that doesn’t know you can’t assign C-arrays for a C++ job.
 
but not management, their job is to help you do yours, not get in the way, if they want to make the technical decisions they can do your job themselves
2
 
Being a programmer sounds boring.
 
@daknøk As you shouldn't, because he probably isn't a programmer
 
So why are we having this shitty discussion then?
 
@DeadMG It's not that management prevents you. It's that you risk breaking shit. Even with a small change. Consider the fact that not all programmers are at least decent. Consider bugs over bugs fixed with work-arounds (not fixing the actual cause). Consider the undefined behavior that is now part of the functionality. You're not going to fix all that. You don't want to fix all that.
 
3:23 PM
@R.MartinhoFernandes But it's all about making compromises.
 
@daknøk Because Lounge.
 
@LuchianGrigore I thought the premise included the fact that something was broken already.
 
@DeadCicada You have a point. Again.
 
@LuchianGrigore I don't want to sit idly by.
 
@R.MartinhoFernandes even so, you're better off finding a work-around than changing something that is called in 1023423423 different places in the code.
 
3:24 PM
Worse, I don't want to pay for it.
That "better off" is highly vacuous.
 
lemme just open up my dictionary
 
There's a reason we use terms like "hack" and "kludge" for that and not "solution".
 
Sometimes, the real solution can cause 1000 other problems
 
Because someone is going to pay for it.
 
That's programmer talk. Because "solutions" don't make money.
The features do, and that's the only thing the client sees
 
3:26 PM
Right, making your job harder does.
 
I should listen to Radiohead more.. I realize it's been ages since I listened to them
 
-15
A: How can I list my open ports on Debian?

mdpcWhat about using nmap -p1-65535 localhost

2
 
The only thing the client cares about is getting the job done in as little time as possible. And the features enable the client to do that.
 
@daknøk <--- this
original message (IIRC)
 
@LuchianGrigore ?
 
3:28 PM
Just saying... that original link to the answer turned into this big discussion
 
@DeadCicada Super Unsung Hero?
 
@DeadMG when I said management, I didn't really mean management (my bad). I'm talking senior developers, who are actually pretty good, but know all the shit that's in the code and know what side-effects your change can have.
 
@DeadCicada Lol. Must be some kinf of accepted answer record
 
@LuchianGrigore Except replacing char* with std::string won't fix any of that. If the char* handling worked, then it has a simple, obvious, and bug-free replacement in std::string, except now the function is much more robust and easier to maintain in the future.
 
s/fix/cause/?
 
3:33 PM
replacing char* with std::string is a small, localized change that's pretty hard to get wrong
 
@kbok Anyway, I wonder why companies are out there looking for software "engineers" if they don't want them to create solutions for problems.
> An engineer is a professional practitioner of engineering, concerned with applying scientific knowledge, mathematics and ingenuity to develop solutions for technical, social and economic problems.
 
@R.MartinhoFernandes Yeah. Beats me, too. It's really hard to find a job where you're not treated like a clumsy dumbfuck.
 
A feature is a solution to an actual problem wrapped in marketing.
 
The great problem in our profession (especially in France) is that programmers are given absolutely no responsibility and every decision is to be made by either architects who earned their place by working for a longer time than others or by management with no technical skills.
And we end up with hordes of programmers doing Java EE because they can't actually break anything.
 
I've found a solution I hope we can all agree on
 
The technical and decision roles we are made dream of in universities are only accessible in some modern, small-sized companies. Even famous tech old-startups like Google are not the land of freedom everyone is told about.
 
Oh hey, the Site du Zéro is releasing two new books. Color me intrigued.
 
In the end a good 90% of all programmers are going to fix crappy code according to a crappy word document they received by mail.
 
that sounds like a solid plan to me
 
@Chimera ^ I hope you are not in Minnesota.
 
@LuchianGrigore In fact, forget about the company.
 
He's from Nevada.
Also I think that decision is really dumb. Same with having a sales tax on online purhcases.
 
@Rapptz Sales tax on online purchases is a bad idea, but still quite reasonably compared to this idiocy.
Oh, and hi all.
 
I have 256 rep. :D
 
4:00 PM
Cue downvotes just to shut you up.
 
~ruined~
 
@CatPlusPlus oh no what now.
 
Bwahaha.
> LLNES is a high-performance NES emulator
int main() { return 0; }
 
lol one of my abandoned projects
 
Made me laugh :D
 
4:03 PM
Only the ines branch is somewhat interesting.
 
@DeadCicada Is that built on top of LLVM?
 
@EtiennedeMartel yet to be.
 
Would have been cool.
 
I’m working on the ROM loader, which is this terrible function.
 
Why NULL ;_;
 
4:05 PM
Because it is C, not C++.
 
But NULL is so much uglier than 0.
 
I always use NULL in C.
I think it looks better than 0 and it is less ambiguous.
You immediately know it’s a pointer and not an int.
(If you use NULL for a non-pointer, you’re a moron.)
 
lol. for (i = NULL; i < 10; ++i) ...
 
I do have this weird loop:
int i;
for (i = 0; i < 4 && magic[i] == INES_MAGIC[i]; ++i);
if (i != 3) {
    vm_free_data(data);
    fclose(f);
    return INES_INVALID_MAGIC;
}
 
INVALID_MAGIC That's an interesting concept
 
4:07 PM
Invalid magic number.
I should probably use memcmp instead.
 
it does
 
@daknøk when I have a for loop with no body, I find I like it more if I move a condition to a body with a break statement.
 
That will stop you at a byte boundary technically.
 
@DeadCicada Magic is automatically valid
 
lol @ people who write a README for projects that don't work at all.
 
4:09 PM
@MooingDuck But it’s C and in C you use the shortest and most unreadable method.
7
 
procrastination FTW
 
@daknøk nonsense.
 
@kbok XD
@MooingDuck inb4 joke
 
When Merlin uses a web page, he doesn't have to go through no stinkin' validation
In fact, he often gets server errors
 
for(iCompteur = 0; iCompteur < //...
:'(
 
4:10 PM
Ah fuck it, I’ll write my game in C.
 
@kbok Sérieusement ? C'est du Murex ?
 
@daknøk Why not C++?
 
@DeadCicada ecrit par le chef
 
@kbok Notation hongroise. Génial.
 
@EtiennedeMartel I’m terrible at C++. All the complex rules and name look-up and templates. I’ll learn C++ later.
 
4:12 PM
@daknøk Why not now.
It's like the perfect moment to do it.
 
Otherwise you'll just procastinate.
 
Might as well write for(integer_kbok_2012_19_10_1812_counter = 0; //...
 
@DeadCicada A friend of mine is writing it in Haskell.
 
@DeadCicada Hm?
 
4:12 PM
@EtiennedeMartel probably.
 
@sehe Oh hey, couldn't answer you until now -- very flakey Internet over here. I figure it's interesting for generic code that transforms and passes tuples around. I have a lot of that. I've been just shy of needing such functionality, so I'm not in a hurry to implement it. I figure it's a good exercise (with some combinatorics too, perhaps), and I really want to milk everything out of tuples.
 
@DeadCicada It's trivial as fuck, the whole internet and their dogs wrote one when it was released
Not meant to be dismissive, mind you
 
@kbok Thanks for the encouragement :)
 
Notch has this uncanny ability to make legions of nerds wet over not-so-impressive stuff.
I wonder how he does it.
 
4:14 PM
heh, there's a question where the OP wants to iterate over the files in the "file table" on the hard drive, and doesn't want to recurse through folders and stuff because that's slow
 
I did it because a friend wanted to do it in Ruby, with OOPness and I thought that was just ridiculous.
 
@MooingDuck lol
 
OOP is not ridiculous. Enterprise OOP is.
 
@DeadCicada I did it with Ruby and OOPness and fuck you.
 
@EtiennedeMartel Man, he had classes like "Instruction". lol srsly
 
4:15 PM
Everytime someone says "Enterprise", I think "Enterprise FizzBuzz".
 
I don’t call non-Enterprise OOP “OOP”.
 
Yes, I wrote a DCPU-16 emulator with fuck you
 
@kbok That's plain bad
 
@DeadCicada Reminds me of 99 bottles of beer.
 
Not necessarily
 
4:16 PM
@EtiennedeMartel My favorite is the Malbolge version
 
Enterprise 99 bottles of beer.
 
@R.MartinhoFernandes I'm disappointed there isn't a Utils module or class.
 
We're very good at closing questions too :-( — Brian Agnew 5 hours ago
 
Wait, there is no Wide version ?
 
@LucDanton I like how in the middle of all that abstraction, the values 3, 5, and 100 are still hard-coded.
 
4:19 PM
Oh, it's Utility. Fancy!
 
@R.MartinhoFernandes yeah, they should be read from an XML file with a schema declaration.
 
@R.MartinhoFernandes Featuring more comments than actual code.
 
 
Also, the mere thought of FizzBuzz.BusinessLogic cracks me up everytime.
 
MVC FizzBuzz
 
4:21 PM
That good old 3 tier model.
 
@R.MartinhoFernandes I tend to think of an Enterprise Hello World.
 
@R.MartinhoFernandes Hilarious!
 
Do people actually use fizzbuzz as an indicator if you can program?
 
It does not generate false positives.
 
4:22 PM
There's a great fraction of people applying at programming jobs who can't fizzbuzz.
 
Really?
Damn that's impressive.
 
Read the article (I fixed the link)
> Like me, the author is having trouble with the fact that 199 out of 200 applicants for every programming job can't write code at all. I repeat: they can't write any code whatsoever.
 
Lol.
If I was presented with the problem I'd be pretty confused.
Do you want me to do it in some other way besides modulus? It just seems like such an odd question to ask.
 
There's a bunch of ways to do it
So anyone with minimal programming skills can solve it
 
@JerryCoffin > CMMi Level 13 Process Weenie
lol!
 
4:27 PM
@EtiennedeMartel MVC FizzBuzz :D
 
@DeadCicada I especially like the: "CMMI Level 13 Process Weenie: I got a great idea. What if we were to deliver Hello in the first release and move World to version 2.0?" Truly classic!
 
#include <stdio.h>

int main()
{
    for( int i = 1;  i <= 100;  ++i )
    {
        static char const* const s[] = { "Fizz", "Buzz", "FizzBuzz" };
        int const k = 2*(i % 5 != 0) + (i % 3 != 0);
        k == 0? printf( "%d\n", i ) : printf( "%s\n", s[k-1] );
    }
}
 
Well, @Cheersandhth.-Alf, I don't think anyone here expressed doubt regarding the fact that you can program :)
 
I wanted to learn more about how to detect a permutation but I'm not sure how to go about the search. I tried 'permutation between two arrangements' (also with 'orderings' instead of 'arrangements') -- anyone has a better idea for search terms?
 
4:42 PM
@Cheersandhth.-Alf Yeah, that's what @R.MartinhoFernandes linked a few minutes ago.
 
i thought it was cicada
hm
 
@LucDanton What do you mean "detect a permutation"?
 
@LucDanton which permutation is it that you want to detect?
if you want to know whether A is a permutation of B, use a multiset
or you can sort them
 
I suppose since I want to compute a permutation to go from a permutation to another I'm doing group arithmetic?
 
sound like you're doing factorial numeral system arithmetic
the general solution to "compute a desired permutation" is "sorting"
 
4:45 PM
@Cheersandhth.-Alf More reading! Thanks.
 
@LucDanton Oh you want to map between the two?
 
you're welcome, whatever it was ;-)
 
@R.MartinhoFernandes Yes.
@R.MartinhoFernandes Given ab = c I want to solve for b. I think.
 
@Cheersandhth.-Alf If you're going to use math on Booleans, why not go all out?
 
@R.MartinhoFernandes Will freshen up on the relevant group and the operations.
 
4:50 PM
is that like, rubik's cube?
 
Ah, I'm not sure it's entirely within the group. I don't have the starting and ending permutations as such -- but the images. I.e. elements of the set the permutations operate on.
 
i mean what do people mean when they say like "relevant group". have they memorized various groups from group theory? what is the connection (to anything)?
 
@Cheersandhth.-Alf I think so, but I know too little about that.
@Cheersandhth.-Alf I haven't memorized it, but I've studied it. I want to refresh my learnings.
I'm not solving anything, at least yet.
 
hm. it sounds complex
 
Learning for learning's sake.
 
4:53 PM
I realized I can't bring all my books with me. It was obvious, but I only realized it now that I'm packing my bags. I'll have to leave my precious shelves behind. :(
 
Behind as in e.g. stowed at your parents', or behind as in for good?
 
At my parents'.
 
Why can't you bring them.
 
I left so much stuff at my previous place, but I can't imagine getting rid of my (very few) books.
 
@CatPlusPlus Won't fit in the bags. Duh.
 
4:55 PM
Courier 'em.
People have trucks and shit.
 
@R.MartinhoFernandes Right about now, ebooks are seeming like a really good idea...
 
You just saved my life. Thanks! ;)
@JerryCoffin They don't provide the same benefits, namely endorphins produced from looking at spines of neatly arranged books on a shelf.
 

« first day (734 days earlier)      last day (4217 days later) »