Comment on: .NET everywhere apparently also means Windows 3.11 and DOS
0 21 Jan 2020 15:40 u/totes_magotes in v/programmingComment on: .NET everywhere apparently also means Windows 3.11 and DOS
He's using DllImport/PInvoke to call MessageBox
Importing an OS specific library to make a call like that is exactly the opposite of what Net Core was made for.
For all you REAL developers, bacon mockup. Need a placeholder image? Why not bacon?
1 0 comments 06 May 2019 22:21 u/totes_magotes (..) in v/programmingComment on: Getters/Setters are an Awful Programming Practice
Why haven't I thought of that before? Probably because I don't want to thrash the web server.
Comment on: Getters/Setters are an Awful Programming Practice
Sperg much? Jesus.
Comment on: Getters/Setters are an Awful Programming Practice
It's a fad like color TV and radio ads.
Comment on: Getters/Setters are an Awful Programming Practice
Because properties are mapped correctly when the class is mapped while instance variables are not.
This guy is a fuckin’ idiot. “Let’s make everything public” completely ignores the first main reason for object oriented programming.
Comment on: Selenium script to delete comments and submissions on voat
But then you have to have support for python and the selenium browser driver and keeping the version lock-step with your browser version and a few other bits of bullshit that your average programmer isn’t going to want to fuck with unless their dev environment is already set up for that.
Yeah, I know about selenium since I write our company site tests with it. I know how it’s okay but far more complicated than it needs to be.
While we’re on the topic, why not just write a cyprus.io script? Write your selenium tests and scripts in JavaScript and even run it in browserstack.
Point of the matter is that you have an irrational love of your script. It’s mediocre at best, too much of a fuckin pain in the ass realistically. A script like I’m talking about though can be made into a bookmarklet. Want a chron job? Shortcut that bitch and run it. Don’t want a browser windows to have to fuck with? Run it in a headless browsers. Point is that selenium isn’t the most effective or efficient way to do it.
Comment on: Selenium script to delete comments and submissions on voat
https://api.jquery.com/jquery.get/
Just get into a $ object that doesn't load in the dom, .find("elementID") and manipulate as needed.
Same idea as saying
var myListItem = $("<li/>")
and now you have a list item element that you can do all kinds of things to.
You're still only looking at... less than 30, maybe 40 lines of code. A lot less if you're clever. And firefox dev console has a javascript scratchpad with autocomplete. Don't even need to fire up an IDE.
Comment on: Selenium script to delete comments and submissions on voat
Now why the hell would you do all that when you can do a javascript setInterval, jquery select and confirm, with a pause long enough not to fire off the activity filter?
Literally just a few lines of code.
Comment on: Who says girls can't code?
No one said anything about a scripting language actually validating, I guess...
Comment on: Please help: Need to work remote within 9 months
So you knocked up someone while you weren't married to them.
I have no pity for you. Suffer.
Comment on: Report: 80's kids started programming at an earlier age than today's millennials
What sound card?
Call -151
and enter your program in assembly.
3D0G
when you were done.
BLoad <address>
To run it.
Comment on: Report: 80's kids started programming at an earlier age than today's millennials
I started when I was 8. Now I'm working a cushy job making a fuckton of money. And it's fucking glorious.
Comment on: Why developers hate being interrupted
Damn good find and 100% accurate.
Comment on: Pair programming: Why it is a bad idea.
I ask for code reviews because of brain fry. I ask for code reviews to find out if there are suggestions for more efficient code techniques. I ask for code reviews to see if there's already a company global function library that does what I'm doing. I ask for code reviews to make sure I'm adequately matching some shitty coding styles.
The list goes on. Code reviews are about making the programmer better, not for showing the rest of the team how much you can polish a turd.
Comment on: Pair programming: Why it is a bad idea.
Pair programming is good though when you have a singular issue that collaboration between two experienced programers will solve because you can play off other ideas. This cannot happen in a singular environment.
However, when the experience level of the two programmers is notably different, the only benefit possible is that the lesser programmer can learn and the lesser programmer might bring some way of thinking that the more experienced programmer doesn't have.
As for your commen about a good Dev only asking for feedback is "to be nice," you are 💯% wrong. Save your "know it all" attitude for home life.
Any if you goats use Autofixture?
1 0 comments 21 Dec 2017 00:11 u/totes_magotes (self.programming) in v/programmingComment on: Is it good idea to throw an exception in .NET C# constructor?
Not necessarily. You need to understand how exception handling is supposed to be implemented and temper that with the kinds of exceptions you expect.
For example, if I have a number class
Number num = new Number("d");
You need a way to handle that. Depending on how your constructor is set up (including any inheritance), you may decide that D is a valid numeric character (along with E or M, for example).
Generally speaking, your lower level objects should not care about exception handling except in instances where you really need to return a status of the current state of affairs. For example, a WebAPI should probably return some kind of status or exception instead of "200 OK".
A good general rule of thumb: Exception handling should be only as far down as needed. Said another way: Exceptions should be thrown as far up the stack of objects as reasonably possible.
It doesn't make sense for your POCO to handle and throw an exception from the database class it sits on top of. Let the database class handle that and it will bubble up the chain. It's not the POCO's responsibility to handle database exceptions. Otherwise, you're going to run yourself ragged trying to handle every possible exception point.
The other reasonable place to handle exceptions is anywhere a user might see the IIS error screen. You know which one that is... the scary screen with the yellow background and big red scary letters. Users flip out and thing they broke the server. You want to handle those and let the user know something was up.
Comment on: Anonymous Recursion in C#
Sometimes it's all about "just because I can" but you don't do crap like this in production code.
Comment on: [Poll] Do you write hexadecimal numbers in upper- or lowercase?
That's because you needed something that's not "real man" quality.
Comment on: [Poll] Do you write hexadecimal numbers in upper- or lowercase?
Oh yeah? If VIM isn't for real men, why is there a stackoverflow question about how to exit VIM???
Comment on: [Poll] Do you write hexadecimal numbers in upper- or lowercase?
REAL MEN DON'T NEED IT EASIER, SOLDIER!
Comment on: [Poll] Do you write hexadecimal numbers in upper- or lowercase?
Significant digits. You don't say 0123, you just say 123. And now it's just my boxers and socks.
Comment on: [Poll] Do you write hexadecimal numbers in upper- or lowercase?
I have an instagram if you wanna see....
Comment on: [Poll] Do you write hexadecimal numbers in upper- or lowercase?
Exactly. It's hardcore because you have to do all these extra things. It makes it more difficult.
Comment on: [Poll] Do you write hexadecimal numbers in upper- or lowercase?
It's shirtless. Kind of like how I'm pantsless right now...
Comment on: [Poll] Do you write hexadecimal numbers in upper- or lowercase?
Real men code in notepad or vim and compile in the terminal/command line. They also google what they're looking for with "-site:stackoverflow.com"
Comment on: [Poll] Do you write hexadecimal numbers in upper- or lowercase?
Come again? Shirt?
Comment on: [Poll] Do you write hexadecimal numbers in upper- or lowercase?
BECAUSE YOU SHOULD ALWAYS WHIP OUT THE CAPS. That's what the Billy Mays key is for!
Comment on: [Poll] Do you write hexadecimal numbers in upper- or lowercase?
A55FACE.
B00B1E5
Any questions?
Comment on: Stop saying learning to code is easy (because it sets begginers up for disappointment).
Shifting your thought paradigm to what is necessary for programming is one of the hardest things you can try to do. A lot of people don't get that.
Promoting using a framework in a way that's contrary to the point of the framework is top kek stupid.