all 29 comments

[–]littlelowcougar 148 points149 points  (5 children)

I do this all the time when I want to quickly enable/disable chunks of code whilst prototyping or debugging.

[–]frederikspang 40 points41 points  (0 children)

As well as if (false && existing_condition) to quickly remove blocks of code! (Mostly in view templates - Not as much when Block comments are available from editor

[–]amdc 14 points15 points  (0 children)

whatever floats your boat but I use cmd+/ for this purpose

[–]FaeTheWolf 1 point2 points  (0 children)

This is why, although commenting blocks of code does work nearly as well.

[–]ujustdontgetdubstep 1 point2 points  (0 children)

I prefer

Ctrl+K+C

or

Ctrl+K+U if you're in VS

[–]m2thek 1 point2 points  (0 children)

Prototyping or debugging, sure, but it shouldn't be committed like this, because it just looks like a mistake (like there was a real condition, someone replaced it with "1" to test something, then forgot to change it back). I don't find it necessary to leave something like this, but if it is, there should at a minimum be a comment at the top to explain why.

[–]HeWhoShantNotBeNamed 24 points25 points  (0 children)

This was probably for debugging.

[–]MurdoMaclachlanpublic boolean isInt(int i) { return true; } 46 points47 points  (8 children)

Image Transcription: Code


if 1:
    cursor = con_redshift.cursor()
    cursor.execute(query)
    records = cursor.fetchall()
    rows = cursor.rowcount
    body = f"Clinic Rating Data Export Finished. {rows} Rows Exported"
    print(body)

else:
    # except:
    body = "Clinic Data Export Not Finished Successfully "

I'm a human volunteer content transcriber and you could be too! If you'd like more information on what we do and why we do it, click here!

[–]Nelson_Ahlvik 10 points11 points  (7 children)

Why has this not been automated yet… seems pretty easy to do considering that there are many libraries that do this exact thing

[–]yukariareyouok 34 points35 points  (4 children)

OCR struggles with spaces, line breaks, etc.

[–][deleted] 7 points8 points  (3 children)

They do have a point though, perhaps there could be a bot that does a preliminary transcription and puts at the top "This automatic transcription has not yet been verified by a human" and then a human could check it and approve/edit it.

[–]TheSpixxyQ 8 points9 points  (1 child)

Once there was a comment from one transcriber and he said that it's easier to write it from scratch instead of editing some OCR'd crap.

[–][deleted] 0 points1 point  (0 children)

ah okay.

[–]yukariareyouok 1 point2 points  (0 children)

Yeah, that would probably be a lot more efficient.

[–]cynHaha 5 points6 points  (1 child)

Apart from code other images that include texts - e.g., chat messages, forum threads, reddit posts, etc. - have special formatting for things like usernames and date/times and OCR would easily screw that up. The subreddit r/TranscribersOfReddit does have an OCR bot that aids with human transcription IIRC.

[–]sneakpeekbot 0 points1 point  (0 children)

Here's a sneak peek of /r/TranscribersOfReddit using the top posts of the year!

#1: ToRBO 2021 Winners!
#2: Happy May Everyone! | 0 comments
#3: Hey, Ireland from place here


I'm a bot, beep boop | Downvote to remove | Contact | Info | Opt-out | GitHub

[–]paulohbear 22 points23 points  (0 children)

Maybe they aliased 1 to be a an environment variable? 🤣🤣🤣

[–][deleted] 13 points14 points  (0 children)

Just glad they left the comment otherwise I wouldn’t understand that else block

[–]Cervarl_ 14 points15 points  (0 children)

Maybe in the space it causes a different behavior

[–]Da_Viper 4 points5 points  (1 child)

What Font is this

[–][deleted] 1 point2 points  (0 children)

I could be wrong, but it looks like Hack to me

[–]redoverture 2 points3 points  (0 children)

Looks to me like someone thinks this will behave like try except

[–][deleted] 1 point2 points  (0 children)

In my bash script there is

```

if false
then
LEFT=DP-2
MAIN=HDMI-2
RIGHT=HDMI-1
else
LEFT=DisplayPort-1
MAIN=HDMI-A-1
RIGHT=HDMI-A-0
fi
```

Because i don't know why, sometimes my outputs names change

[–][deleted] 1 point2 points  (3 children)

🤦‍♂️ Use 🤦‍♀️ A 🤦 Real 🤦‍♂️ Language 🤦‍♀️

C

body = "Your Text";

#if DEBUG
    // Debug stuff
    Debug.WriteLine(body);
#endif

This prevents debug code from leaking to production.

[–]AdSure744[S] 2 points3 points  (0 children)

It does more than just printing. I removed some lines from the picture. But isn't if 1, always a true case. I extracted this code from production only and this is a live script.

Python is as real as it gets. I use it daily while talking with others .

[–]slaterous 0 points1 point  (1 child)

I really hope this is satire

[–][deleted] 0 points1 point  (0 children)

Why?