r/shittyprogramming • • Dec 02 '14

what is this? seen on imgur

255 Upvotes

68 comments sorted by

179

u/[deleted] Dec 02 '14

Help! After reading this I forgot how to code and I am going to be fired. What can I do?

89

u/[deleted] Dec 02 '14

Outsource your projects to shitty Indian programmers, pay them 1/4 of your salary, keep the rest and hope your boss will never find out.

23

u/awittygamertag Dec 02 '14

There was a story on reddit about a year ago with a guy who did that. Wonder what ever happened to him.

22

u/Neebat Dec 02 '14

Now he's the CEO of a powerful outsourcing company.

Nah. He did have a whole team of people working remotely to do his job, and I think he actually had more than one job, so I think he deserved a promotion.

27

u/WallyMetropolis Dec 02 '14

Except that he was blatantly violating the company's security policies and his NDA by giving various levels of unauthorized access to parties unknown to and unapproved by the company.

Otherwise, yes. You're right that being able to manage that level of productivity makes a person qualified for a promotion or a raise.

8

u/gsav55 Dec 02 '14 edited Jun 13 '17

11

u/Matty_R Dec 02 '14

As long as you beat them to it you can fire your boss instead! Then take their spot as the boss and give yourself a pay rise.

19

u/[deleted] Dec 02 '14

I'm so trying this, I will report back!

Edit: lost my job, does anyone hire an ex programmer here? I know how to google and I can browse stackoverflow.

8

u/Matty_R Dec 02 '14

I think you didn't follow the instructions in the correct order - it normally works 60% of the time all the time.

It's all good because you don't need a job man, you're better than that! We believe in you.

84

u/Code_For_Food Dec 02 '14 edited May 08 '15

10

u/trevorsg Dec 02 '14

Yeah, and it's also not counting those strange cultures that start the week on Monday instead of Sunday.

14

u/lelarentaka Dec 02 '14

You mean Julia programmers?

4

u/Fingebimus Dec 02 '14 edited Dec 03 '14

What stupid cultures start the week on Sunday?

10

u/imsometueventhisUN Dec 02 '14 edited Dec 03 '14

Most of them, because that's the International Standard. You're not in /r/murica here.

EDIT: I'm a fool who should read comments before I type, especially when they're as vitriol-laden as this. I misread the above as "don't start the week on Sunday". Humiliation and contrition abound.

3

u/DownvoteMeHarder Dec 02 '14 edited Dec 03 '14

I live in the US and the first day of the week is pretty unanimously Monday, I've never met anyone who thinks otherwise actually.

1

u/imsometueventhisUN Dec 03 '14

You're completely right - I misread the comment (see my edit!) - sorry!

2

u/autowikibot Dec 02 '14

Section 11. Week numbering of article Seven-day week:


Weeks in a Gregorian calendar year can be numbered for each year. This style of numbering is commonly used (for example, by schools and businesses) in some European and Asian countries, but rare elsewhere.

ISO 8601 includes the ISO week date system, a numbering system for weeks – each week begins on a Monday and is associated with the year that contains that week's Thursday (so that if a year starts in a long weekend Friday–Sunday, week number one of the year will start after that). For example, week 1 of 2004 (2004W01) ran from Monday 29 December 2003 to Sunday, 4 January 2004, because its Thursday was 1 January 2004, whereas week 1 of 2005 (2005W01) ran from Monday 3 January 2005 to Sunday 9 January 2005, because its Thursday was 6 January 2005 and so the first Thursday of 2005. The highest week number in a year is either 52 or 53 (it was 53 in the year 2004). Schematically, this ISO convention translates as follows:

In some countries, though, the numbering system is different from the ISO standard. At least six numberings are in use:


Interesting: ^Week | Javanese ^calendar | Akan ^calendar

Parent commenter can toggle ^NSFW or ^delete. Will also delete on comment score of -1 or less. | FAQs | ^Mods | Magic ^Words

1

u/yawkat Dec 03 '14

That looks more like half-half between Sunday and Monday, and iso says Monday too.

1

u/imsometueventhisUN Dec 03 '14

You're completely right - I misread the comment (see my edit!) - sorry!

1

u/Awilen Dec 17 '14

Also (and most importantly) not counting those that start the week on Friday.

0

u/[deleted] Dec 02 '14

[deleted]

34

u/aidirector Dec 02 '14

You need to instantiate a Clergy object via ClergyFactory to mediate your prayers.

ClergyFactory clergyFactory = ClergyFactory.getInstance(religion);
clergyFactory.setLocale("en");
clergyFactory.setLocaleSub("us");
Clergy clergy = clergyFactory.getClergy();
thanksGiver.petition(clergy, god);
thanksGiver.giveThanksTo(clergy);

7

u/mahlzeit Dec 03 '14

There's a potential problem in your code, you need to catch the NeedAltarBoyException (especially if you're using a ReligiousDenomination('catholic') object).

2

u/ericl666 Dec 03 '14

Strange, I always got my clergy through injection.

16

u/[deleted] Dec 02 '14

If this was C#, then method giveThanksTo would be accepting interface IGodsImage which has derived classes God and Man (and Woman, which has to be instantiated with a Rib dependency).

2

u/the_omega99 Dec 03 '14

This is obviously a case for the actor model.

god ! "Thanks for the Friday, dude"

(Valid Akka code, by the way.)

2

u/[deleted] Dec 04 '14

Thanks shouldn't be in charge of giving. Do you even OOP?

me.give(God, Thanks.new)

1

u/[deleted] Dec 03 '14

duh, are you using eclipse?

1

u/edave64 Dec 03 '14

Your ruby code gives god to the Thanks, what ever that means. You would need to specify a sender, like in your Java example. You also converted all christians to catholics. And your interface cannot be used for polytheistic religions

0

u/[deleted] Dec 04 '14

[deleted]

6

u/edave64 Dec 04 '14

Syntax Error: Unexpected Inquisition in Line 1

11

u/[deleted] Dec 02 '14

And the LORD said "return zero", and it was good.

(first thing I could think up, carry on)

24

u/DynaBeast Dec 02 '14
if DateTime.now.day == "friday" then
    God.thank()
end

Assuming lua, of course.

0

u/[deleted] Dec 02 '14

[deleted]

11

u/DoctorCube Dec 02 '14

this.thank(God)

8

u/YM_Industries Dec 03 '14

If we're staying in Lua, I believe that should be self:Thank(God)

0

u/[deleted] Dec 02 '14

[deleted]

1

u/DynaBeast Dec 02 '14

You could've looked it up, but no; it doesn't. '==' is practically '.equals()' anyway, since that's how the interpreter is set up. If you want an equivalent to '==' from another language, then the 'is' keyword in Python is what you're looking for.

0

u/[deleted] Dec 03 '14

[deleted]

2

u/Tysonzero Feb 25 '15

(I realise I am 2 months late, was browsing top) I totally agree. I have very few complaints when it comes to Python. It is an awesome language. The one thing I sometimes miss (depends on the type of app) is static typing. But it seems like CPython has that stuff anyway. That and the GIL can be annoying for certain programs. But besides that everything is awesome.

8

u/BAM5 Dec 02 '14

Please tell me this isn't a shirt.

22

u/faldborg Dec 02 '14

It is the idiom "thank god it is friday" in a smalltalk dialect I have never seen before. Quite idiomatic in fact. I am impressed.

64

u/HorizonShadow Dec 02 '14

I believe it's Ruby.

36

u/Ark_Tane Dec 02 '14

Yep, and looks perfectly valid to me. DateTime#friday? is even part of the standard library. Not quite sure why God#thank! needs a !, perhaps it raises an exception if the environmnet is an atheist.

33

u/agent766 Dec 02 '14

From what I understand, Thank would probably modify God instead of returning a new God. Imagine if a new God was made every time someone thanked him!

10

u/Ark_Tane Dec 02 '14

It's a class method though (should have written God::thank! instead), as a result I can only assume we're looking at a singleton class.

14

u/aidirector Dec 02 '14

Singleton pattern is only valid for monotheistic religions. This won't scale!

4

u/[deleted] Dec 02 '14

Checkmate atheists.

3

u/AgletsHowDoTheyWork Dec 03 '14

This would avoid a lot of conflict, at least until we ran out of metaphysical heap memory.

19

u/Mustermind Dec 02 '14

! is a common convention in ruby that indicates that a method will cause a permanent change. For example:

a = "hello"
b = a.gsub("e", "3");
puts a, b # returns "hello" and "h3llo"

a = "hello"
b = a.gsub!("e", "3");
puts a, b # returns "h3llo" and "h3llo"

So, I'm guessing you can't unthank God after you thanked him...

14

u/curtmack Dec 02 '14 edited Dec 02 '14

For those wondering: Ruby has a lot of features for both functional and imperative programming, and it's designed to be easy to tell which one you're doing at any given time. Thus, methods that inherently modify state are clearly marked as such, by ending with a !.

This is also why predicate methods (i.e. methods that return a boolean) end in ?, to make it easy to tell that they can be used in functional constructs like filters.

2

u/Brostafarian Dec 02 '14

clearly, thank! modifies God somehow

7

u/i_like_outer_space Dec 02 '14

I believe in you.

6

u/imadeofwaxdanny Dec 02 '14

I do believe so because of the ? and !. Although, I believe the ruby way of writing it would be

God.thank! if DateTime.now.friday?

1

u/anglophoenix216 Dec 03 '14

Sure, that's another option.

4

u/miller_dotnet Dec 02 '14

What is a thank function doing on the God object, poor design!

3

u/nakilon Dec 02 '14

It is Ruby + ActiveSupport.

5

u/Hobofan94 Dec 02 '14

DateTime#friday? is part of ruby core and doesn't require ActiveSupport.

3

u/the_noodle Dec 08 '14

This is ruby.

It's not shitty just because you don't know the language.

2

u/super_ninja_robot Dec 07 '14

God not found in namespace Reality

2

u/DJDarkViper Dec 09 '14

Ruby saying "TGIF"

Probably on a shirt somewhere too

1

u/b0at_rich Dec 02 '14

Gross ruby...?

1

u/[deleted] Dec 14 '14
import Data.Time.LocalTime
import Data.Time.Format
import System.Locale
import Data.Char

data Weekday = Sun|Mon|Tue|Wed|Thu|Fri|Sat deriving (Show, Enum)

getDayInt = formatTime defaultTimeLocale "%w"
intToWeekday = (!!) [Sun .. Sat]
tgif Fri = sendTo "Elohim" "Thanks"
tgif _ = return ()

-- We haven't figured out how to make this type-safe
-- so we're just mocking it....
sendTo user mess = putStrLn (user ++ ": " ++ mess)

main = getZonedTime >>= tgif . intToWeekday . digitToInt . head . getDayInt

Sometimes it's really hard to stand up for your favorite language.

-4

u/TheOnlyMrYeah Dec 02 '14

Looks more like /r/ProgrammerHumor material.

-7

u/[deleted] Dec 02 '14

ruby.is.stupid?

0

u/[deleted] Dec 02 '14

[deleted]

0

u/[deleted] Dec 02 '14

[deleted]

6

u/codesforhugs Dec 03 '14

Sure it can, it says so right there in the code! On the internet!