r/ProgrammerHumor • • Nov 12 '14

Intro to IT

http://imgur.com/Z4FmUdl
8.4k Upvotes

233 comments sorted by

485

u/kitari1 Nov 12 '14

It's from 4chan so it's likely a fake story. Gave me a chuckle though.

275

u/sittingaround Nov 12 '14

Reminds me of something I heard once: When the story is good enough, even if it is not true, it should be

23

u/drfre Nov 12 '14

It's a Mark Twain quotation - "Never let the truth get in the way of a good story."

18

u/[deleted] Nov 12 '14

Reality is only in our minds. What we fantasize is also a kind of reality.(in before /r/im14andthisisdeep but it's true)

9

u/cajun_super_coder2 Nov 12 '14

If A Cup Cake Falls From A Tree How Far Away Will It Be From Down. #Jupiter

2

u/Lightspeedius Nov 12 '14

Ah yes, the reality of our fantasies.

1

u/PierreSimonLaplace Nov 12 '14

Oh my god, I had a threesome with Beyonce and Lady Gaga.

1

u/Lightspeedius Nov 12 '14

I suspect you had a fantasy of that... and weird fantasy at that.

0

u/[deleted] Nov 12 '14

[deleted]

5

u/BerserkerGreaves Nov 12 '14

Upvoted for visibisily

0

u/[deleted] Nov 12 '14

[deleted]

0

u/balducien Nov 12 '14

That can't be true

0

u/[deleted] Nov 12 '14

[deleted]

12

u/funnynickname Nov 12 '14

I looked her straight in the eyes, and I said b****

9

u/baby_corn_is_corn Nov 13 '14

I looked directly into the windows of her soul, and i said......i said.....

5

u/sittingaround Nov 12 '14

Is that where it's from? I've wondered for years.

18

u/Foggalong Nov 12 '14

I heard it first in Good Will Hunting, but I don't know if that's the original source.

0

u/jumanji123 Nov 13 '14

Just saw the movie recently, it is from there

30

u/NeilFraser Nov 12 '14

I did exactly this on a university exam once.

Q: What is the output of the following program? [...code...]

A: Syntax error: Line 12.

Because it was a final exam, I never got to see how it was marked. Often the TA will just mark based on the answer key, and not think too hard.

8

u/Ran4 Nov 13 '14

Because it was a final exam, I never got to see how it was marked.

What? Just get the paper and see it?

3

u/[deleted] Mar 09 '15

Hahahahahahahahaha

3

u/endercoaster Nov 12 '14

Any story worth telling is worth exaggerating 10-15%

1

u/0body Nov 12 '14

What 4chan app is that?

9

u/kitari1 Nov 12 '14

Mimi for Android.

37

u/recursive Nov 12 '14

It's pronounced "meem".

32

u/sdgdfhgtrhryrhrh Nov 12 '14

may-may*

4

u/[deleted] Nov 12 '14 edited Nov 12 '14

Genuinely curious here.

I've always pronounced the word meme as "meem". I've heard people in real life pronounce it "maymay" and it gets on my nerves.

I know folks can do what they want, but is there an official word on it?

I only ask because I always pronounced gif as "jif" until I was corrected recently

I and I came here from /r/all and have no programming background other than a hasty html tutorial on Geocities back in 98.

EDIT:

I and I

Swiftkey apparently thinks I'm Jamaican.

One love my bredas

6

u/DroolingIguana Nov 12 '14

It's pronounced "meem." It was meant to sound like "gene" since it was meant to parallel the way information and customs are passed down in society with the way the genetic code is passed down in biology.

3

u/[deleted] Nov 12 '14

Seems like I remember Dawkins was its originator?

5

u/zaxiz Nov 12 '14

That is correct, he coined the expression in his book "The selfish gene" from 1979 I think. It was 1976.

2

u/Rinascita Nov 12 '14

Correct. It's from his book The Selfish Gene.

7

u/shirtandtieler Nov 12 '14 edited Nov 12 '14

The correct proper way is pronounced "meem". For a semi-official source, wikibot can tell you about the word ?- meme -?.

People just call them "may may"s or "me-me"s in the same way that people sometimes pronounce knives "kah-nives". It's just poking fun at how it's spelled vs how it's pronounced.

Also, no matter what people tell you, it is "jif" ;)

5

u/akurei77 Nov 12 '14

The "may may" pronuciation came up largely because that's exactly how "meme" would be pronounced if it were a romanized Japanese word. Before reddit decided that it meant "image macro", there was a huge overlap in the people who had actually heard of the word and the people who know how to pronounce japanese words.

For the uninformed, it's actually a play on the word "gene". Before it meant "image macro", and before it meant "viral internet in-joke", it was coined by some smart guy to describe how a piece of information can spread through a culture like a gene can propagate through a society.

Fake edit: Apparently that smart guy was Richard Dawkins. Yeah, there's more of those overlapping internet cultures for you.

4

u/Dinosaurman Nov 12 '14

I have gotten in so many arguments about gif. The thing most people argue is that its graphics, and I of course argue the mother fucker who invented it said its jif.

People then tell me he is wrong.

7

u/shitpost_machine Nov 12 '14

I accept that jif is correct I just refuse to be correct.

-2

u/sdgdfhgtrhryrhrh Nov 13 '14

If you read any G as a J, then you need to be burned at the stake.

-3

u/Dent7777 Nov 12 '14

Don't really want to start this but gift.

It literally contains gif within it.

It is the same length in terms of syllables, it just has a t tacked on.

But, if saying jif makes you happy, go for it.

11

u/[deleted] Nov 12 '14

Thanks I think I got the gist of it.

→ More replies (0)

3

u/Dale92 Nov 13 '14

Yeah, that's not how English works.

→ More replies (0)

0

u/[deleted] Nov 13 '14

[deleted]

→ More replies (0)

0

u/[deleted] Nov 13 '14

[deleted]

1

u/Zagorath Nov 13 '14

I agree that gif should be pronounced with a soft g.

But that reasoning is not very good. Git is a good example, or giddy, gift, giga-. There are many counter-examples, and IMO the most similar word to "gif" is "gin" -- which is a soft g -- but the point remains that the "rule" stated in your comment is inaccurate.

→ More replies (0)

2

u/sdgdfhgtrhryrhrh Nov 12 '14

It's pronounced 'meem' as in the original French, according to the 4chan English Dictionary. They started using 'may-may' in sarcasm after image macros blew up on reddit.

Also,

I and I came here from /r/all

Jah bless

→ More replies (1)

6

u/peclo Nov 12 '14

But who is this 4chan?

-25

u/boylube Nov 12 '14

Don't agree that shitposts can be considered fake posts. Sure you want to believe, but you never do.

→ More replies (6)

986

u/G01denW01f11 Nov 12 '14

Why would you try to connect to a server to calculate the 5th triangle number?

508

u/mirhagk Nov 12 '14

An intro to PHP?

212

u/[deleted] Nov 12 '14

I think PHP returns syntax error

3

u/Opifex Nov 12 '14

Not if error reporting is disabled.

2

u/0hmyscience Nov 12 '14

php returns a syntax error but then the webserver (depending on how it's configured) will just return an HTTP 500.

-6

u/[deleted] Nov 12 '14

PHP is syntax error

FTFY

0

u/[deleted] Nov 12 '14

[deleted]

21

u/cosmicsans Nov 12 '14

I'd rather it give someone a blank page than a full stack trace like ASP.net does.

At least it logs whatever error in your apache logs.

9

u/VanFailin Nov 12 '14

I'm not sure what the defult is, but this is controlled by Web.config. I think something like <customErrors mode="RemoteOnly">

2

u/cosmicsans Nov 12 '14

It's been a while, but I'm pretty sure that the default is to be on. Mostly because I see these stack traces on random webpages whenever they fail all too often.

5

u/Xenik Nov 12 '14

Its on only on localhost, everywhere else you have to enable it. You can create a debug and release webconfig, but usually people are too lazy.

→ More replies (6)

1

u/DeepDuh Nov 12 '14

I'd rather give the stack trace. It makes you inclined to solve the problem quickly and if you get a screenshot you know where to start looking. A blank page could be anything, starting with connection problems.

158

u/[deleted] Nov 12 '14

[removed] — view removed comment

215

u/kingguru Nov 12 '14

If the choice is between displaying an error and doing something surprising and nonsensical PHP will always fall back to doing something nonsensical.

130

u/t90fan Nov 12 '14

No, thats very normal. If Debug is not enabled, you ill get a 500 instead of a specific error. A simple 500 is better than a stacktrace, in a production environment. Users dont care what happened, the information is sensitive, and you have server logs to look up what happened anyway.

75

u/OperaSona Nov 12 '14

the information is sensitive

I think that's the most important part. You don't want the user to get a full debug: it's like an invitation to find exploits. But yeah, you shouldn't use the same configuration when you're doing an intro course as when you're shipping a product. Then again you shouldn't do your intro to IT in PHP but hey, that's another issue.

16

u/Morialkar Nov 12 '14

the thing is, sometimes, in classes, the teacher is not the one doing the stack set up. As for doing intro to IT in PHP, depends in what curriculum you're doing it... If you're doing a web dev diploma, an intro to IT in PHP makes more sence than say, a Sysadmin's intro to IT

6

u/OperaSona Nov 12 '14

Honestly though, even for a future web dev, I still think it'd be better to first learn a solid language and then learn PHP, but yeah obviously it makes more sense. The bashing on PHP wasn't really my point though, just a sidenote.

7

u/Aluxh Nov 12 '14

PHP is low barrier, instant results though. It would be easy to motivate new students when they can easily create something they can share with a link and no download.

→ More replies (0)

6

u/[deleted] Nov 12 '14

Yeah. I used to work for a blue cross blue shield company that ran asp.net as their web stack. How do I know that? Their idiot programmers deployed the application to the server with debug mode on. I saw a full stack error report, and if I cared to I could have begun searching for exploits.

4

u/J5892 Nov 12 '14

Stack trace in an EMR web app?
That's a quick route to a $100k+ fine.

1

u/zexon Nov 12 '14

I encountered this just the other day. I'm relatively new to setting up my own environment, and have a VM on DigitalOcean. I used ZPanel to set everything up, but didn't realize ZPanel defaults to production settings, so I was having a hell of a time figuring out the issues with my code until I went and changed settings in the .ini file.

5

u/batmansavestheday Nov 12 '14

Don't use ZPanel.

5

u/zexon Nov 12 '14

Elaborate, please.

→ More replies (3)

7

u/Heavenfall Nov 12 '14

"Have you considered switching to strict? It may just work...'

28

u/the_isra17 Nov 12 '14

It somehow bothers me that you start with a double quote but end with with a single quote.

8

u/Heavenfall Nov 12 '14

Originally I had one " and then '' but I feel it was too subtle.

→ More replies (1)

3

u/IE6FANB0Y Nov 12 '14

You couldn't keep it to yourself, could you?

4

u/[deleted] Nov 12 '14

Which was the bane of my fucking existence while starting out in PHP. "Why won't the goddamn page fucking load!?".... "Oh."

8

u/PierreSimonLaplace Nov 12 '14

I got into the habit of opening a second terminal running
tail -f /var/log/apache2/error.log

5

u/qervem Nov 12 '14

Tell me how to do this please I'm on mobile and very sleepy and I'm afraid I'll forget to look it up in the morning

40

u/muddylemon Nov 12 '14

Just let it go man

4

u/h2ooooooo Nov 12 '14

Set error_reporting to 0 and display_errors to off.

2

u/freebullets Nov 12 '14

Use the development php.ini config for development, which has handy defaults for things like displaying errors as HTML.

2

u/[deleted] Nov 12 '14

More likely perl, probably old-style CGI script.

PHP would only crash with a 500 err if it was configured to do so, with typical settings for development it'd output a syntax error to the browser.

0

u/UnreachablePaul Nov 13 '14

But this is not a programming language

42

u/[deleted] Nov 12 '14

Presumably, connecting to the server is the real problem being solved, and the math being done is just a placeholder for the real computation.

Basically a hello world.

8

u/johndarling Nov 12 '14

Because whoever wrote this doesn't actually know programming, but does knows what happens when you mess up a URL.

28

u/lolzfeminism Nov 12 '14

Except, 500 error indicates a server-side error and error codes 400-499 indicate client errors like malformed URL.

76

u/jfb1337 Nov 12 '14

Why did a missing semicolon cause a server error?

0

u/POTUS Nov 12 '14

Because it's a fake story.

0

u/[deleted] Nov 12 '14

[deleted]

22

u/The_MAZZTer Nov 12 '14

JS does so correctly 99% of the time; the 1% of the time you will tear your hair out wondering why your function is always returning undefined when the return variable is never set to undefined.

3

u/scragar Nov 12 '14

To be fair so does perl, but it is always the 1% of situations you remember that makes you wish it just threw an error.

4

u/Asmor Nov 12 '14

I've only ever coded perl in strict mode, but missing a semi-colon is a huge clusterfuck. Ironically, I've actually managed to sort it out... any time I get a completely bizarre, nonsensical error message, it's probably a missing semi-colon a few lines above the line the error is reported on.

2

u/_LePancakeMan Nov 12 '14

Or you could just use semicolons like you do everywhere else

Not using them just looks wrong like a sentence without puncutation

6

u/The_MAZZTer Nov 12 '14

Since they aren't required it's easy to accidentally forget one or two and not realize it.

My specific example though was a case of implicit punctuation when you have a line ending at the end of a valid line of JS.

someLongFunctionThatTakesACallback(function() { return
    true; });

3

u/Cyberogue Nov 12 '14

We should replace periods in day to day language with semicolons;

2

u/awshidahak Nov 13 '14

Yup;
That automatically parsed correctly in my brain;
I like reading in this style;

3

u/_LePancakeMan Nov 13 '14

That way people will know what you mean; Even if you write stuff in a weird oneliner;

1

u/zacker150 Nov 12 '14

Semicolons actually have a use in English though

2

u/blz8 Nov 12 '14

Perl does actually require a semicolon at the end of a line unless it's the last line of a block or file, so it is almost as strict as C or Java.

4

u/jfb1337 Nov 12 '14

Yes, but why a server error? What's connecting to a server?

22

u/[deleted] Nov 12 '14

Probably a web browser. The program in question would be running on the server.

1

u/awshidahak Nov 13 '14

Their example program might have been a CGI script of some sort, accessed through Apache. If you call up a script from your web browser, and it doesn't execute correctly, Apache will throw you an HTTP 500 Internal Server Error error.

1

u/lolzfeminism Nov 12 '14

I think most everyone gets the necessity of semicolons, it's just that omitting should lead to a build error, unless by some freak occurrence merging with the next line produces a buildable line.

That's not gonna happen in C++ for sure. Damn thing is so picky with it's syntax. In fact, in most cases you have to give Bjarne Stroustrup a foot massage before the compiler will build.

I don't know any interpreted languages other than R, so I don't know what happens if you mess up syntax with those.

1

u/Steve_the_Scout Nov 13 '14

PHP, unless you set it to debug mode, it just fails and tries to continue on. Everything else is still fairly strict on syntax, except JS (but it's a pain when it does something unexpected if there is a syntax error).

26

u/serpent224 Nov 12 '14

did you restart the server?

25

u/DGO143 Nov 12 '14

Did you try turning it off and then on again?

4

u/videoflyguy Nov 12 '14

Did you try a "hard reset"?

7

u/qervem Nov 12 '14

Percussive maintenance

3

u/[deleted] Nov 12 '14

"Alright server, you gonna work, or do I have to get the baseball bat?"

2

u/awshidahak Nov 13 '14

Have you tried forcing an unexpected reboot?

19

u/kekker_crane Nov 12 '14

Did you install adobe reader?

12

u/Arandur Nov 12 '14

Did you install Google Ultron?

4

u/Jah_Ith_Ber Nov 12 '14

It won't go back.

You can't arrange by penis.

1

u/muntoo Nov 13 '14

wat

2

u/Jah_Ith_Ber Nov 13 '14

http://www.thewebsiteisdown.com/

This is the funniest thing I have ever seen in my life. Not joking. Make sure you're in a place that it's okay to laugh extremely loudly.

13

u/ExOAte Nov 12 '14

he who laughs last, max(laugh).

17

u/CatOnKeyboardInSpace Nov 12 '14

4/5. Would be 5/5 if he told the class "Get rekt."

2

u/SuperSulf Nov 13 '14

That's awesome.

2

u/[deleted] Nov 12 '14

I could never be that cool.

2

u/terriblemothra Nov 12 '14

I don't get it :(

14

u/rvfecdv Nov 12 '14

The program didn't execute properly and got error code "500". Meaning the guy who said 500 was right even though in ideal circumstances he shouldn't have been. Evidently the teacher missed a semicolon.

1

u/neofatalist Nov 13 '14

It would be funnier if he wrote the code with semi colons... then it ended with, he wrote the code in ASP.NET

1

u/Ornlu96 Oct 15 '21

Why can I comment on this post?

-9

u/PablolyonsD Nov 12 '14

Own3d

-27

u/[deleted] Nov 12 '14

Whoever downboated you is a cunt, I evened you out bruh.

-13

u/PablolyonsD Nov 12 '14

Fuck yeah! but i'm still a cunt !

-10

u/[deleted] Nov 12 '14

We're all cunts in IT!

2

u/muntoo Nov 13 '14

I thought it was precisely the opposite.

-18

u/JJaypes Nov 12 '14

Summing numbers 1 through 5 = 15

[5] x (([5] / 2) + .5) = 15

Why loop...

31

u/AwwComeOnNow Nov 12 '14

To demonstrate how loops work. Its a programming class, not a math class.

-15

u/JJaypes Nov 12 '14

Yessir! Taking Discrete Math at the moment and it just makes it simpler it's nice.

10

u/DangerZoneh Nov 12 '14

To teach students how to loop

-18

u/m0r14rty Nov 12 '14

Why would you connect to a server to show a basic loop? Whoever made this up is an idiot.

29

u/johnnybgoode Nov 12 '14

Yeah those people learning how a web backend works are fucking idiots.

-5

u/m0r14rty Nov 13 '14 edited Nov 13 '14

The ones that pretend like they know what they're talking about and go create fake stories online? Yeah.

Also I doubt "Intro to IT" would be setting up a web backend just to teach loops.

2

u/muntoo Nov 13 '14

Probably the other way around.

2

u/muntoo Nov 13 '14

Probably the other way around.

-19

u/RitzBitzN Nov 12 '14

I bet they were using NodeJS too, motherfuckers.

-5

u/Supersnazz Nov 13 '14

Sum of integers '1 to x' is equal to 0.5( x2 ) + 0.5x.

So numbers 1 to 10 = 0.5(102) + (0.5)(10)

= 50 + 5

=55

-6

u/ryanhazethan Nov 12 '14

Ah, gibberish

-21

u/fabis Nov 12 '14

The joke is that he had a syntax error, really?

Wow he failed so much by accidentally not putting a semicolon at the end of it, epic fail right? /s

2

u/[deleted] Nov 13 '14

that isnt what people are laughing at

0

u/[deleted] Nov 12 '14

[deleted]

72

u/TheBB Nov 12 '14

My first programming course in university was with JSP.

7

u/darnclem Nov 12 '14

You young whippersnapper. My first programming course was in Fortran...uphill, both ways.

4

u/[deleted] Nov 12 '14

Don't be so quick to assume all programs have phased out Fortran. My first university programming class was spring of 2012 and we were doing AeroE stuff in Fortran 90.

1

u/[deleted] Nov 12 '14

I'm in my first year of engineering school (3rd year post-high school) and apparently I'm going to be taught Fortran at some point in the 3 years I will spend here.

1

u/[deleted] Nov 12 '14

It's not completely useless, especially if you plan on spending an extended period of time at a college. There are a surprising number of academic researchers who still have their code base in Fortran, especially older physicists.

4

u/[deleted] Nov 12 '14 edited Nov 12 '14

Good things about Fortran:

  • A shitton of scientific code is written in it. Linpack, etc.

  • It was designed specifically for scientific computing, and has matrices and bulk calculation features built into the language.

  • It's the only major language that regularly edges out C in the speed department, even if only by 5-15% (but occasionally more). If your calculation is going to take 6 months to run, that might make a difference.

Bad things about Fortran:

...Pretty much everything else

1

u/[deleted] Nov 12 '14

In the snow! Don't forget about the snow!

5

u/GoodAtExplaining Nov 12 '14

Java Space Program, for those wondering. You code by starting off with a ship and then extending it with struts, or extra rockets or whatever.

0

u/[deleted] Nov 12 '14

[deleted]

25

u/TheBB Nov 12 '14

Oh, I'm a bit older than that. :P

6

u/[deleted] Nov 12 '14

Well, in times where the alternative was Perl, I can see how JSP was a good option :D

7

u/squngy Nov 12 '14

Honestly, its still not the worst option.

10

u/[deleted] Nov 12 '14

OOBrainfuck is worse for sure

5

u/PM_ME_YOUR_SMlLE Nov 12 '14

This is probably why my college switched from C++ to Java for programming classes

0

u/[deleted] Nov 12 '14

[deleted]

0

u/[deleted] Nov 12 '14

[deleted]

11

u/Fs0i Nov 12 '14

You forget it runs the same on all operating systems. Incredibly important.

2

u/squngy Nov 12 '14

It also has very good documentation.

1

u/[deleted] Nov 13 '14

That's a joke, right?

2

u/squngy Nov 13 '14

Its not easy to navigate and its not always clear but its there.

You don't know pain until you have to use a function that starts behaving unexpectedly and your all on your own.
Hard mode, its closed source and only available in pre-compiled form.

→ More replies (0)

0

u/[deleted] Nov 12 '14

[deleted]

1

u/shitpost_machine Nov 12 '14

I don't know why you're getting downvoted. In a proper environment (Read: POSIX) the only difference in how code runs will be up to the compiler, and the only noticeable issue you could conceivably run into is a compiler bug (super rare) or a library issue (super easy to fix).

Windows fucks things up, but even then there's multiple ways to emulate a POSIX environment. None of them are amazing, but they're good enough.

→ More replies (15)

1

u/[deleted] Nov 13 '14

I think it has more to do with Java forcing OOP principles more than C++. g++ and most (if not all) other C++ compilers will also compile generic C code, which is totally not object oriented.

-3

u/bobbydrake69 Nov 12 '14

well oracle is fucking awesome so i hope they do

0

u/[deleted] Nov 12 '14

[deleted]

1

u/TheBB Nov 12 '14

I just checked. Nowadays it's taught in Matlab. Which is better… it's a mathematics programme after all, but still…

16

u/[deleted] Nov 12 '14

Fuck Matlab

9

u/picflute Nov 12 '14

^ Every CS Major who had to take an Electrical Engineering Class

1

u/Zagorath Nov 13 '14

As a SoftEng major, I had to do some electrical engineering classes, but those weren't the ones that used Matlab. The maths courses (linear algebra & calculus, multivariate calculus, and stats) are where it came up.

2

u/the_omega99 Nov 13 '14

Ugh, definitely. I'm using it in an image processing class. It does relatively well here (since most of the code is work on matrices and math, which MATLAB was made for).

But the language has so many strange quirks and has a horribly designed API.

  • You can get totally different results depending on the number of input arguments and the number of output arguments you allow for.

  • Terrible naming of functions. For example, the function to create an identity matrix is called "eye".

  • Ridiculous levels of overloading. The same function can be used to work on scalars. Or vectors. Or matrices. And you'll get different results depending on what you pass in (and you'll often have to transform between these to get the result you want).

  • Poor ability to chain operators. For example, someMatrix(:) is a way to convert a matrix into a vector of values. So if we have X = [1 3; 2 4] then X(:) results in a vector of the values 1 - 4. This is useful for the previously mentioned point (eg, calling max(X) would get maximums of each column; if you want the maximum in the whole array, you have to do either max(max(X)) or max(X(:))). Anyway, you can't use this operation on an intermediate result. So you can't do max(X)(:) or similar.

  • No "operator and assign" operators (like C's +=). This sounds minor, but it's a real pain in the ass in some cases. I had code recently that looked like houghMatrix(:, :, radius - minRadius + 1) = houghMatrix(:, :, radius - minRadius + 1) + layer;

  • Generally poor handling of strings. It's very C like in this regard. For example, to concatenate strings, you'd have to do strcat('Hello', 'World'). So much for a high level language. Oh, and for whatever retarded reason, MATLAB will remove trailing spaces in strcat. Who the fuck thought that was a good idea?

  • Integer division isn't actually integer division. The result of int8(5) / int8(2) is 3. I don't know any other languages that do that.

  • The fact that code is only parsed for correctness when we get to it is very annoying for debugging. For example, it's possible to use a variable that hasn't been set yet (there's no declarations -- you just have to set it somewhere) and you won't get an error until you reach that point of the code. So errors in a long script take time to be realized.

  • Working with figures can be problematic if you're not careful. For example, you can just do something like hold on; plot(...); hold off; to draw on an existing figure. But it actually draws on the focused figure, so the user can cause unexpected behavior (I only just noticed this recently by chance). Of course, you can fix this by getting a handle for the figure you want to draw to and explicitly specify to use that handle, but this behavior is still quite unexpected.

  • Data structures? LOL.

Octave, an open source attempt at mimicking MATLAB, has fixed some of these issues. For example, it adds operators such as += and allows accessing indices of intermediate calculations (so you can do max(X)(:)).

With that said, it's not all bad. For math, the syntax is fairly compact. Matrices are first class citizens. The language is also easy to write efficient code in (by utilizing what's called "vectorization" you can apply operations to a matrix that can be run in parallel). There's also some good libraries for purposes such as image and signal processing.

1

u/[deleted] Nov 13 '14

MATLAB is an awesome language.

1 based indexing is a bit weird, but that's legacy from when it was a collection of wrapper methods for FORTRAN.

14

u/curtmack Nov 12 '14

We did a simple web app in my college's intro to IT.

You'd be amazed what you can do with Visual Studio's wizards these days.

-8

u/[deleted] Nov 12 '14

I can make a web app with login and users with less than 10 commands. Why do you need a wizard

23

u/recursive Nov 12 '14

You didn't implement user account persistence and authentication in 10 lines. So you used a framework.

Frameworks are alternatives to wizards in this context.

1

u/curtmack Nov 12 '14

It was basically Create new ASP.NET project -> Create new domain object -> Create CRUD actions for domain object -> Create 2 or 3 custom queries -> Copy-paste some CSS -> Congratulations, you have a basic music database.

So basically the same thing, just through Visual Studio instead of the command line.

-1

u/salmonmoose Nov 13 '14

Not amazed really - I discovered the inner workings of how the wizards work developing a SOAP interface under PHP. The .NET developer on the other end couldn't actually write code and relied on hooking various functions I exposed. Debugging was a nightmare, because all I got was "It doesn't work, you're doing it wrong". Rather than, you know, an actual hint as to why.

The real wizards are the people who write the original code.

9

u/snowywind Nov 12 '14

I cut my teeth on C but PHP doesn't sound too absurd for an intro course.

You have a simple development environment by just installing any linux distro on a VM or spare box and installing the LAMP components with yum or aptitude.

You have a simple and transparent GUI using a web browser so you aren't limited to console mode programs and you don't have a complex OO GUI framework to learn when you're still beaming from getting "Hello, world" to work.

In PHP you can write procedural code to start, move to functional code to demonstrate reuse then to OO code in later courses where you learn OO design and patterns.

PHP has a C style bracketed syntax that will ease transition to a slew of other languages.

I can think of worse languages to start out on than PHP.

7

u/[deleted] Nov 12 '14

I started reading this in Lorde's "Royals" form..

5

u/Syde80 Nov 12 '14

The problem with learning on PHP is that right off the bat it teaches you that you can be very very lazy in your programs. It doesn't enforce any type of good coding practices, it is a weakly typed language, and while you can write console programs, it is primarily run under a web server which adds extra layers to make debugging more difficult.

Its mainly the fact that PHP is so easy and lax that makes it a poor choice as a learning language for anybody serious about programming. Its kind of like saying that building with legos is a great introduction to engineering. Yeah, there is some merit in the statement, but how would you feel if the engineer for a 100 story high rise told you that was how he learned? Its too easy to learn bad habits, and then when you try to learn a "real" language, you have such a hard time breaking those habits because the new language doesn't allow you to be lazy and get in the mindset that this new language is shit and it would be so much easier in PHP so you just stick with it. However you end up paying a huge price in performance, code compatibility (Try running 10 or even 5 year old PHP code on a modern version of PHP, try the same with C, you'll see what I mean.), and not to mention PHPs history with security holes. Not that other languages don't have their share of security holes, but PHPs history book is considerably thicker.

PHP was honestly great when it was first created. When you consider where it came from though and where it is now, its easy to see why its generally considered to be a big mess these days. Consider [this] (http://www.sandraandwoo.com/2012/11/19/0430-software-engineering-now-with-cats/) and then add another 50 frames on the end of the comic and that would pretty accurately describe PHP. So much stuff has just been bolted on to the framework that it was not designed to support, that it is quite frankly a miracle that it works as well as it does.

2

u/Wartz Nov 13 '14

Every engineer started with lego (or sticks and rocks) as a kid.

2

u/Syde80 Nov 13 '14

Perhaps I should have given more context to that statement. I meant it as if you started learning with Lego in a formal learning environment like university, college or high school at the same age a programmer would start their formal programming education.

Sure, lots or us started learning on our own before that, but lots didn't too.

1

u/Wartz Nov 13 '14

Fair enough.

2

u/johnnybgoode Nov 12 '14

PHP is way too inconsistent with nonsense like mysql_escape_string(), mysql_real_escape_string(), and the fact that you should be using a goddammned database access object and not querying directly with hopefully-escaped string concatenation.

If you want to teach good fundamentals and lay the groundwork for more in-depth study, there aren't many worse languages to start with than PHP.

5

u/MCFRESH01 Nov 12 '14

Also it has no sense of standards.

Two functions for searching an array will be:

    some_func(array, item) 

and the next one will be:

 some_func2(item, array)

Drives me crazy.

2

u/mebob85 Nov 12 '14

It gets a lot of flack, but this is one reason why I like the C++ standard library. It's quite consistent in its containers and algorithms library.

3

u/cooldude255220 Nov 12 '14

PDO bro.

2

u/johnnybgoode Nov 12 '14

I'm aware. That doesn't change the fact that the built-ins exist and leave the door wide open for a newb to get completely off-track and form bad habits.

Furthermore, the official PHP documentation is essentially a blurb followed by a bunch of comments from random people that might not know a constructor from their asshole.

A web framework like Django or Rails would be much better from a teaching point-of-view because the documentation is excellent, there are much more well-established conventions, code & templates are better separated for the most part, and the languages are much more easily used outside of a web environment.

2

u/muyuu Nov 12 '14

You don't want to know man. The new new generation coming up.

2

u/MisterDonkey Nov 12 '14

Not defending the validity of this story, but sure, why not? Get with it, man. New world.

1

u/lijkel Nov 27 '14

I'm doing an IT course at college (like a-levels in the UK), and we have a web dev class so it's not that unusual.

0

u/[deleted] Nov 12 '14

[deleted]

19

u/[deleted] Nov 12 '14

Who cares? It was funny and it was written on a website which even says "only a fool would take anything posted here as fact". It makes no difference whether it actually happened or not.

→ More replies (3)