Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Search - "catch"
-
Was going through some old gadgets n found this fossil.
Give me the fucken code Blackberry and I'll catch it for you.4 -
Please do rename the "master" branch to "Führer". The umlaut will probably catch a bunch of applications that aren't UTF-8 ready.14
-
Fuckin hell!!
Code works everywhere except at one client. Ok, I check logs & see something missing.. I go check the code that handles excel files.. try catch and do nothing.. great.. :/ ok let's log this shit to see what is not ok...
Insert logs, build, update, run.. now it freakin works o.O11 -
Police officer McDucky reporting for duty. Hope we catch a lot of pesky bugs and complete projects.3
-
Last week I almost lost my belief in everything..
A friend of minde, he's currently learning programming (Delphi 😂) in some kind of university, just told me:
"Hey, why do you spend so much time caring about error handling? I just surround all my programs with one try catch block and I never have to think about errors!"
Ehm. No statement needed, right?2 -
Whilst I was gaming this morning, I found A person with the username 'NullPointerException' so I imediatly typed into the chat
"catch(NullPointerException e){}"1 -
Void foo() {
try {
//Try something
} catch(exception e) {
foo();
}
}
When I saw this in production I cried a little...9 -
Sorry, but the app had to stay running. It was just a minor exception anyway.
try {
executeMainLoop();
}
catch (Exception ex) {
executeMainLoop();
}4 -
We should totally be able to use try/ catch irl, especially in social situations
try{
riskyText();
} catch (InappropriateTextError e) {
abort();
}6 -
Comment your best developer pickup line...
here's mine...
I think you're exceptional, I can try & catch you.24 -
If Stack Overflow really crashed it would never be fixed since the devs would be stuck refreshing Stack Overflow forever.2
-
!rant
It's Friday and my boss let us off work early...
So imma just chill and try to catch the sun5 -
Why do Pokemon masters love JavaScript?
Because you gotta, try/catch them all
Haha. No laughs? Okay
*curls into a ball7 -
As a Java developer, reasons to kill other programmers:
- static mutable variables
- WRITING to static mutable variables
- API call with Framework X didn't work. Add Framework Y along with X and try that. Wrap X in try/catch statement. Catch block fires framework Y.
- six, seven, ten levels of nested code. Zero thought put in organization
- 6K LOC Java files
- spring (singleton? Maybe) object assigning values in static mutable (see pt.1)
- a couple of unit tests in code base that no longer work. Zero unit tests in new code
- unit testing disabled in CI pipeline
- empty catch blocks
- pass mutable data between threads. Modify in various places concurrently.3 -
static void TryOut<T>(T newStuff)
{
try
{
self.Learn(newStuff);
}
catch (NotUnderstandingException)
{
// At some point, it will work, just call it again
TryOut(newStuff);
}
}4 -
Working on code that we took from other devices company. We found this brilliant thing in one of their function (check catch blok)1
-
import java.util.Exception;
try {
public class A {
public static void main(String args[]) {
new Exception();
}
}
}
catch(Exception e) {
System.out.println("Got you BITCH");
}9 -
imagine the new try/catch block
try
..
catch
...
finally
....
please
...
how dare you?! (Application.Exit())4 -
Catch a sysadmin's laptop unguarded. Put fakeupdate.net on windows 10. I never saw so much pain on a man's face. Priceless!1
-
They see me coding
They testing
The Try and Catch blocks show me coding dirty
Show me coding dirty ...3 -
try {
…..
} catch {
// this would never happen
}
and then it happened
fucking always print something when you catch exceptions15 -
try {
// code that will someday
// throw an exception. Today is
// not that day.
}
catch(Exception ex) {
// The big day has arrived! BUT...
// I'm a heartless bastard who
// does not log errors.
// Good luck finding me!
}2 -
Optimizing the queries and backend
OR
Hiding the waiting time with funny animations and weird preloading techniques
Catch: let marketing decide10 -
found this in our codebase today
try {
//do something
} catch () {
try {
//do something else
} catch () {
try {
//do something else else... this goes on 4-5 levels deep
} catch () {
//log... couldn't do
}
}
}9 -
Best way to handle any exception...
try{
something
} catch(e) {
window.location.href =
"http://stackoverflow.com/search/...]+"
+ e.message;
}joke/meme coding c++ tip of the day tricks stack overflow random rant try catch joke but will be useful 😂😂😂 programmer hacks8 -
Today,I found this gem:
static function getConfig(){
$cacheKey = 'foobar';
try {
$config = $this->repository->getConfig();
$this->cache->set($cacheKey, $config);
}
catch(Exception $e){
try{
$config = $this->repository->getConfig();
$this->cache->set($cacheKey, $config);
}
catch(Exception $e){}
}
}
I don't want to live on this planet anymore...!7 -
TIL: C# has a "Catch When" syntax to help you filter exceptions. It already allows you to filter by Exception type, but this is news to me since it allows for finer filtering like:
try
{
//Shit code that will throw an exceptions more than Hillary's tantrums about the elections
}
catch (ExceptionType ex) when (ex.ErrorCode = "0x696666")
{
//Log this fuck up
}
catch (Exception ex)
{
//More logs
}
finally
{
//Run code that doesn't depend on the successful execution of prev code
}
I love C# and use it every single day, but this "When" keyword in Try...Catch...Finally blocks is new to me and will be interesting to start using it now :)3 -
By someone who reviewed my code. "Put a null check in the catch block for the exception....cuz some times exception itself might be null..."
And by that he/she means,
catch (Exception e){
if (e != null) {....}
}12 -
Hey... to somebody reading this, most likely.
The problem, is that you put if($var = 'something')
You need ==, not =.
Php doesn't tell you that though. It'll just change the var to 'something'
That's why you're getting that really obscure, doesn't make any sense error.
You're welcome.9 -
Actual production code:
try{
[code]
try{
[code]
}catch(Exception ex){
[code]
}
}catch(Exception ex){
[code]
}
Double blasphemy!2 -
God damnit!
i recently inspected the c# sourcecode of a webservice, our webservice develop references to.
As i discovered a particular function in it, my face went instantly pale.
This golden-hammer function consists of ~2000 lines of code.
In the first line there is "try {".
On the last lines is "catch (Exception e) { throw new SomethingWentWrongException ("special function"); }"
At least, he "tried" xD
I don't want to develop on that planet anymore...7 -
read some rants about a devRant meetup?
how do I know they are not from my manager trying to catch me rant-handed?3 -
String nullabity check duel...
null, isEmpty(), "", " ", '', ' ', " null", boolean, NaN, undefined, isNullOrEmpty and finally try-catch -
try {
// something...
}
catch (Exception ex)
{
string uriToLaunch = "http://stackoverflow.com/search?q=" + ex.Message;
var uri = new Uri(uriToLaunch );
var success = await Windows.System.Launcher.LaunchUriAsync(uri );
}1 -
try {
boolean isOk = meetTheGirl("Anna");
if (isOk) {
kiss();
goHomeAndProgram();
}
else {
cry();
goHomeAndProgram();
nextDay();
pickUpAGirl();
}
} catch (Exception e) {
//I don't know. My life is so empty
}7 -
When people ask me:
- Why doesn't it work?
I catch myself often responding like this:
- How exactly it doesn't work?2 -
Previous intern had a bad habit of living empty catch blocks...
It's like he had some mommy issues.
It's like handing an empty first aid box to guy.
"You know what I am gonna do, leave empty catch every where just to fuck with the next guy...Ha...Ha..."1 -
Roses are red
Exceptions are blue
Empty catch blocks are going to hurt you!
try
{ somethingVeryDangerous() }
catch { // No Op
}
finally { SaveFile() }1 -
GodDAMN, C# 7.0 is so ridiculously feature packed. I can pattern-match inside a predicate on an exception filter. Want to catch ONLY NHibernate's exceptions caused by a SQL timeout? Boom:
catch (GenericADOException adoEx) when (adoEx.InnerException is SqlException sqlEx && sqlEx.Number == -2) { return Failure("timeout"); }7 -
How to deter me from working remotely.
Make the Remote Desktop app now catch ALT+TAB...
Well at least it isn't winter...1 -
Worried about your application crashing? I have a fix. through the entire thing in a try/catch and catch Exception. 😁😁2
-
Bruh, catch everyone on LinkedIn posting about how much they love their company/team.
Translated, these read "Please don't sack me!"5 -
mr robot, halt and catch fire, silicon valley, tvf pitchers.....
any suggestions for movies like pirates of silicon valley?4 -
A project at work which is based on blindly copying other projects, empty catch clauses, a static class for global variables, and incompetence.1
-
So I was just watching a show with subs and see this line:
"So just try and catch me!"
The first thought that came to mind was:
try {}
catch {}6 -
- halt and catch fire
- silicon valley
- mr robot
are there others, at least half as good as hcf?20 -
there's a special place for people who write empty catch blocks INTENTIONALLY ..
try{
... do something that may produce NPE;
} catch {Exception fuckYou){
// go die in a fire
}3 -
I spend so much time debugging because the previous developer has empty catch blocks everywhere in the code base.
-
!rant
Small refactor. Which resulted in the confident removal of a comment that said:
// will this fail?
Ah. Like a breath of fresh air. -
Am currently at a jamboree where one kid said he was really good at maths. Then another younger kid asked him what 12 + 12. The first kid then said 24 to which the second kid laughed and said "twelvetwelve". Then the small kid promptly ran away yelling "catch me catch me".
They really do say the darnest things, but concatenation was unexpected :v4 -
...and they said AWS never goes down. Well developers this is a good time to sleep or catch up on tv-series. Enjoy!5
-
Apple iPhone batteries catch on fire yesterday and today at two different Apple Stores
*Scrolling news on OP5T and laughing *7 -
Heard Java 7 provides catching multiple exceptions in single catch block ! hmm .. why need when I got this 😎😁
try {
// do something...
} catch (Exception e){
//log it ..
}6 -
When you're in a rush to write a new feature but your compiler keeps nagging about not handling exceptions2
-
while( me.getStatus() != Status.RICH){
try{
Project p = createProject();
wait();
me.setStatus(p.getStatus());
}catch (GaveUpException e){
me.setStatus(Status.404);
}
** Warning: code unreachable **
System.out.println("I'M RICH!");2 -
Status of Internet Connection in our office located in Baku. Probably there is some guy downloading torrent in office. I will catch you today...11
-
First week in a new company... Everything looks soooooooooo complicated, I've got no idea how I am going to catch up 😅4
-
Have you ever drifted so much that, while examining your code, you catch yourself reading the Loren ipsum text?
#lorem_ipsum #firstworldproblems3 -
Life will be much easier if we can use "try and catch" while doing something. Yes, just like programming language.2
-
! Rant
Quick tip for those of you struggling with a error or bug you can't fix.
But that doesn't effect functionality.
Just wrap the code inside a try catch block and don't do anything inside the catch 😂😂. Saved me a lot of hours in my projects.
Nah I'm joking. Don't ever do this8 -
//Something great
try
{
//Some code.
}
catch(Exception ex)
{
string url = "http://stackoverflow.com/search?q=";
System.Diagnostics.Process.Start($"{url}{ex.Message}");
}1 -
"If you don't return something in the catch block it will crash"
Isn't it interesting how a sentence can be true yet so infuriatingly wrong.3 -
The Halt and Catch Fire writers and tech experts must have lived those days. Totally nailed it to the finest detail. I am impressed. Show me a 10mg (how will I ever fill it up) Bernoulli platter 😀
Great series but warning it is not a comedy like Silicon. Very different but amazing how some things are same as today in concept.7 -
Why the fuck do i need to propose try-catch to an contractor, so he can fix his application, because its crashing if the input is non-conform to the specs?
Oh and before you ask. The application is a application that processes and sanitizes invoices.8 -
try {
thesis.defend();
} catch(TimeoutException reached) {
thesis.attack();
throw new Thesis aimedAt(theProfessorsFaces);
} -
Found this comment before a try/catch block in some code I was reviewing... seems like I might have to rewrite the whole thing1
-
I want catch previous developer and cut his finger off. If you don't know hot the job should be done don't do that job.12
-
try {
m_tick++;
}
catch(...) {
m_tick = 0;
}
someone was very confused...
yes, m_tick is an unsigned builtin type3 -
I'm coding like it's Mad Max and stackoverflow is the junkyard, I just hope it doesn't catch on fire. 🤡3
-
When you catch a fellow classmate checking out some devRant posts... Don't worry. Your Anonymity is safe with me2
-
I dislike people that always want to “catch-up via quick call”. Dude can’t you type a simple message?6
-
Happy new year everyone.
For everyone yet to catch up to midnight, let this be a pre-new year post!4 -
the person who wrote the code I'm maintaining had just learned try {}catch {} seriously, the guy preferred using try catch over ifs...11
-
Writing code to put me to sleep.
try{
me.sleep();
} catch (InterruptedException e) {
throw Pillow.atInterruption(e);
} -
OS can’t install the network driver because the installer can’t see the network card, the installer can’t see the network cars because the driver isn’t installed.1
-
I have a domain with mailgun and a catch all statment, I don't remember signing up for this but I was apparently mad2
-
My boss has been working in web development for roughly 10 years now.
Today he learned about the existence of try/catch in JavaScript and asked me in which browsers it's
supported in 😢 -
Too many broken promises then I don't care anymore.
Javascript has ruined humanity. Catch me on my way out. -
I'm having such a bad day, that an exception object passed on to my catch block itself caused a NullPointerException.1
-
Boss: so what's the outcome of this meeting?
Me: well 23 more JavaScript frameworks got released in this time. A lot to catch up.1 -
Assertequals("Fail","Fail") in the catch block.
Things developers do to bloat their test coverage at my organisation,
I am #stuckWithIdiots
Management sees green1 -
Meanwhile pinterest was throwing this error and is expecting the user to catch/handle the error! Lol2
-
You know what I had to deal with
A bunch of these shit
try{
//Shitty cluster fuck excuse for java
//code
}catch(Exception e){
}1 -
Halt and Catch Fire is having another great season. Lived those days and it is so true. CompuServe, Compaq, Commodore, 5 1/4", Tandy 1000, Byte Mag, Atari, The Well... The tech you see is really 1985ish. Attention to detail is appreciated by long time technologists.
H&CF is about building a tech business and much applies to today's startups. That two brilliant tech women are leading the charge adds to it. All the characters are great Cameron, Gordon, Donna, the devs at Mutiny and Joe channeling Jobs (in my opinion) is spot on.
Any H&CF fans have an opinion?4 -
When devs clash:
-See, I've got this *condition* where myDick() is bigger than yourDick(), so Try{} me and see what you Catch{}2 -
Working with one team takes the better part of a day...
try {
WorkWithUXTeam();
}
catch {
try {
WorkWithPlatformTeams();
}
catch {
try {
WorkWithArchitecture ();
}
catch {
Delay():
}
}
}
Man, that was annoying on a phone.3 -
What the Fuck is with recruiters saying you need more experience to get the job?! I'm applying so I can GET said experience! As a perfect metaphor: a college course should not have itself as a prerequisite or else nobody can take it!
It's a stupid catch-22 that I'm stuck in, from which there is no escape until I land that first job... 😒 -
Halt and Catch Fire. Watch this serie. Just do. Specially if you are 30 or older, and/or entrepreneur. https://ororo.tv/en/shows/... . 2 episodes per day in this link.2
-
var gotGud = false;
while(!gotGud)
{
try
{
makeCode();
gotGud = true;
}
catch(AbilityException ex) { }
} -
Had to extend the platform of a customer. For one part of my task (generating an encrypted string) there already was a class with encryption and decryption methods. This class is used in a gazillion places all over the code, so I thought it might be a good idea to re-use already existing stuff... Until I saw that the encryption method using basic Java methods (all fine with that) wrapped in a try-catch block, 'cause the Java methods may throw, returning err.getMessage() in the catch block...
Yeah...sure...makes sense... Instead of throwing an error or returning null just remove the possibility to handle the error.
So I decided to basically copy the methods and return null so I can work with that.
Created a merge request and was told by another dev of that company to remove my own impelemtation of the encryption method and use the already existing. Arguing that I won't have a possibility to prevent my code, that returns an URI containing the encrypted string, from generating something like "http://..../Encryption failed because of null" without success.
So I had to use the already existing crappy code...5 -
I just realized it'll take years for Java to catch the way C# implemented lambda expressions.
And really devrant? one rant per 2 hours?2 -
Some people were talking about IPhones and I calmly stated that Apple should catch up, and somebody behind me that I hate said "Android should catch up".
I could not help but laugh out loud.
I then looked it up, but didn't show him the specs between these phones:
digitaltrends.com/mobile/iphone-7-vs-galaxy-s7/9 -
A couple of months ago I watched all 3 seasons of 'Halt and Catch Fire'. I thought it was excellent. If im honest I enjoyed it more than mr robot (and I loved that). Still not seen Silicon Valley though (it's gonna cost too much).7
-
What's the point of the "finally" block? Isn't it functionally equivalent to everything after the try { } clause?5
-
while (true) {
try {
writeCode()
} catch (UndefinedIsNotAFunction) {
try {
drinkCoffee()
} catch (OutOfCoffeeException) {
die(-1)
}
}
} -
Me: "ok let's have a look at this code I have to review ..."
try
{
* Some random unreadable overcomplicated shit code *
}
catch (Exception e)
{
// Useful for debug
}
😓
In which God forsaken crazy alternative universe, a "catch all" block that swallows the exception and does nothing else is even slightly close to the concept of "useful for debug"3 -
The only good thing about PHP is that the argument to catch blocks is called $ex which entertains my childish mind.5
-
Function works() {
Try {
HorriblyDyingCode();
Return true;
} catch (Exception e) {
Return false;
}
} -
We. want. stack traces!
When do we want them?
When we catch exceptions that we don’t know how to handle!2 -
When you see a try/catch block where the catch simply throws the caught exception:
try { /*stuff*/ } catch (Exception e) { throw e }
*headdesk*4 -
Ever since humans transitioned from hunting-gathering to farming, cats saved an unimaginable number of people. Dogs are fine at hunting and guarding the household, but they’re not sneaky enough to catch mice.
Mice destroying your food stash meant death by starvation for your whole family, no exceptions. Only something as agile, sneaky and alert as a house cat could catch mice effectively.4 -
For all the Go-Devs that complain about not having try-catches.
That function here. emulates one....More or less.
https://gist.github.com/thosebeans/...3 -
PHP is awesome, but it annoys me that there is no typing and that you still can get errors based on types...
Other than that, not being able to catch all errors in one catch and especially not being able to natively catch fatal errors is my biggest problem...
(not natively meaning that you can use hackish solutions but there's no "fatal error" class to use in your try catch, and you're using the register shutdown function not as intended...)8 -
The task: Catch and log this specific error in this one function.
Me: While I'm here, let me just -
git: 12 files changed3 -
hey, someone mentioned nasa today or whatever. got me curious. if you happen to catch this, the falcon launch happens in 16 minutes. nasa.gov2
-
try (HappyHolidays happyHolidays = new HappyHolidays()) {
happyHolidays.wish(all);
} catch (HolidayWishesNotWelcomedException){
specialCasePatternInterface.specialCaseCall();
}
Yep.18 -
When you catch an ArrayOutOfBounds exception and the catch statement throws an ArrayOutOfBounds exception...
Fail -
new Promise(function (resolve, reject) {
self.getPaid(function (err, money) {
if(err) {
reject(err);
console.log("fml");
} else {
resolve(money);
console.log("fuck yeah!") ;
});
})
.then(resolve)
.catch(reject); -
Silicon Valley started again yesterday !!!! Yaay...who else here watches this show and well Halt and Catch Fire ?5
-
try{
If(!res || typeof res == undefined || res == undefined){}
}catch(err){
// you just had to throw an error
} -
You know all those times when you neglected to put anything in those catch blocks?
If this hasn't happened yet, just wait. Soon enough some lunatic's nondeterministic code will randomly break you will have to spend hours figuring out why because you never did anything with that error.
Of course, actually writing code for every mandatory catch block is even more of a waste of time, so empty catch blocks it is!1 -
When you watch "1024+ Seconds of JS Wizardry" on YouTube and you realize you have fuckin lot to catch up in JavaScript :|
-
CEO of my company often walks in our office with a joke: "I can't hear you do bit & byte".
I still don't catch it. -
does anyone else constantly catch themself's trying to use alt+enter or ctrl+space everywhere besides their ide?2
-
I'm halfway through season 3 of Halt and Catch Fire and I believe Cameron is my most hated movie character ever. That fcking manipulative useless piece of shit. Just fuck urself. Fcking garbage disposal wouldn't be able to dispose of ur bitch ass. I'm not sure if I can finish the season but it feels like she can't get any worse, wouldn't be surprised tho.
-
"You're one hell of an exception I would like to try & catch"
What's your programmer pick up lines?3 -
seems like halt and catch fire will never be able to gather audience because it is too techy like mr robot. In my opinion they should release it as online series1
-
When I was young I tried to catch all the pokemons but "finally" now I "try" to "catch" all errors...
-
when you got an exception on store and you've tried it like a million times and it didn't happen, and you just give up and "try catch" that motherfucker!
-
Javascript library developers - FFS please stop using try...catch blocks to detect features. Makes the "break on all exceptions" debugging feature FUCKING USELESS.
-
Hey motorcyclists
Just now have I come across something quite unbelievable...
Is this a real deal? what's the catch? Why would it cost that little...?
Link1: https://alibaba.com/product-detail/...
Link2: https://jszhongxing.en.made-in-china.com/...16 -
Never Ending Project
"What's make software development great?"
"What's it?"
"We must catch bugs all the time."
"Oh..."1 -
If you gona reference a web.config key in your code, wrap it in a try/catch and throw a useful error, for fuck sake!
-
Why did halt and catch fire got discuntinued? I really loved that show. And I think it's one of the best cs themed show.
-
me.getgirlfriend()
.then((res)=>{console.log(res.msg)})
.catch((err)=>{console.log(err.msg)})
> Girlfriend not found -
I hate it when I catch myself writing JavaScript in PHP style.
And catch myself writing PHP in JavaScript style.2 -
!devrelated
Anyone want to catch me up to speed about why some prominent users left? I heard there was drama...4 -
Fuck javascript, been on this firestore cloud function since yesterday , i have been get some stupid errors like expected catch or return promise/catch or return , used some stackoverflow answers still not working. Uugggh really wished cloud firestore used a better language like python,..what more do u expect from a language created in 7 days..shitty js
-
How do you seize crypto if it's anonymous? Secure?
Just need to catch someone logging in?
https://apnews.com/article/...17 -
line 8426345 col 4575 Expected an identifier and instead saw 'catch' (a reserved word).
Now all my promises be:
deleteUser()['catch'](() => {});1 -
Why the fuck catch(...) Doesn't catch shit!? Fuuuuu!! I hate it! Why these things keep happening to me?!5
-
For every one that thinks that if you use try/catch on everything make your code all errors desapiring you are living a lie!! They still exist now if the users see or not it depends on what you put inside the catch
-
Some people were lazy so they added throws Exception to all the methods up till main. No catch clause....1
-
How do u catch up with trends in programming? Articles, magazines, Meetup ... please name them too1
-
I get a simple exception because of a connection reset, can't catch it becouse it "happens in external code" urgh, fuck you .net core..
-
It feels like getting an internship can be a catch 22, you need experience to get experience. What advice would you give to someone looking for an internship?2
-
The video shorts done by the devRant team surpasses the crap that shows like "Silicon Valley" or "Halt and Catch Fire" put out.
-
Find on frenh bank application :
string name;
try {
Client client = _repo.getById(id);
name = client.name;
} catch {
name = "noname";
}
😂😂😂😂😂 -
panic() from golang. I panicked a lot as go didn't have the "evil" try catch. But then panic came for my aid.
-
While i am an iPhone user.
Siri you have to catch up to google. I feel iOS itself needs to catch up. Apple where is your innovation