Hacker News new | past | comments | ask | show | jobs | submit login
The code on the laptop in the stock photo at developer.bbc.com is user-editable (twitter.com/andrew_taylor)
548 points by fanf2 on June 12, 2021 | hide | past | favorite | 70 comments



Very clever! Needs more syntax highlighting, though...

For anyone still confused, you can click into the code on the laptop screen there and edit like normal. They have applied matrix transform and blur via Cascading Style Sheets to make it all look cohesive.


Okay Cascading Style Sheets :)


Wonder if the site used HyperText Markup Language too


Here's all the possible code that are shown https://pastebin.com/YyQwU7XZ


I ended up with text from The Hitchhiker's Guide to the Galaxy game:

   THE HITCHHIKER'S GUIDE TO THE GALAXY
   Infocom interactive fiction - a science fiction story
   Copyright (c) 1984 by Infocom, Inc. All rights 
   reserved.
   Release 59 / Serial number 851108

   You wake up. The room is spinning very gently round
   your head. Or at least it would be if you could see 
   it which you can't.


>look at bulldozer It's one of those really big bulldozers that can actually crush other bulldozers, let alone houses.


Confession: I used to work for one of the larger "flash game studio's" back in 2008-ish. I coded one of their main titles and added various cheats and easter-eggs in the game without anybody knowing.

I remember one code making one of the characters go off on a rant on how "game development is a grind, don't do it, I hate my life." Something like that.


10 PRINT "BBC Developer Portal" 20 GOTO 10

Very nice Easter egg


One of the snippets prints Fibonacci in the Chef programming language via a caramel recipe.

https://www.dangermouse.net/esoteric/chef_fib.html


And serious software developers having serious fun. They included the opening scene of Infocom's version of The Hitchhiker's Guide to the Galaxy.


Probably since it was broadcast on BBC back in 1978. Six years later the game was released in 1984.

https://en.m.wikipedia.org/wiki/The_Hitchhiker's_Guide_to_th...


They're all jokes:

C:\>

C:\> DOS

C:\DOS> RUN

RUN, DOS, RUN




It also changes on page refresh!


I got a section of Jenkins' rebuild-plugin's rebuild action for the sony ericsson.

There's a spelling mistake in one of the comments, is it bad form to pull request a one word change on a 9 year old comment?


yes


Why?


Because it's a comment that has no bearing on how the code works. If you make another change to that same file, feel free to update the comment as well. PRs that do nothing but fix a typo in a single word in a comment are useless. Maybe if your PR has several cosmetic/docu type changes throughout once the codebase is stable and working, I could see a pass going through to clean up things like this. However, as asked, no, it is not useful.


Many people dislike commits that make changes to code that has no relation to the thing being done.


They stole the idea from the laptop on https://browsersack.com (desktop only)




It can be one of several strings.


This is the kind of clever stuff that really got me into computers back in the early 2000s. Back then some people would have clever stuff like this in their forum sigs. You don't see it so much any more. Everything is so serious and corporate.


They also disabled the tab navigation into the textarea element. Very nice.


The person at the other desk, opposite, has one of those holes cables disappear into at a moment's notice. I used to carry a kitchen bag clip for that!


That's awesome!


That is brilliant


Works until you zoom on the page, then the text is not correctly positioned anymore.


Zooming in works fine for me: https://i.imgur.com/5QVBN7i.png


[flagged]


We detached this subthread from https://news.ycombinator.com/item?id=27488442.


That's a surprisingly arrogant and troll-tier comment. If you don't like it, can't you just turn it off, or write your own editor (which Rob Pike has done at least twice)?

Does Rob Pike also eschew error messages which point out the error's line number as a crutch for weak-minded coders? Does he avoid modern plotting software, opting instead to parse vast monochrome tables of numbers the way god intended? Does he oppose multiple virtual desktops, window systems, and GUIs in general because he grew up without these newfangled shortcuts that cause mental decrepitude in kids these days? He might be a genius who has made an exceptionally positive impact on computing, but he comes off as a bit of a dick in that thread.

Using color to encode meaning is "juvenile" for a reason: it's an efficient way to leverage the builtin pattern recognition features of the human visual system.


> surprisingly arrogant

So, a Googler, and a Go language designer. Checks out.


Would you please stop breaking the site guidelines with flamebait and/or unsubstantive comments? You've done it repeatedly lately and we ban that sort of account. We're trying for a different sort of internet here...as I think you know?

If you wouldn't mind reviewing https://news.ycombinator.com/newsguidelines.html and taking the intended spirit of the site more to heart, we'd be grateful.


Well, he eschews generics, so there's that



>point out the error's line number

Sounds like most of the JS libraries out there. I don't want to know what line of code in a library module that I didn't touch puked, I want to know what line of code that I wrote as the bit of stupidity. I just don't understand how that's considered helpful.


I've found that bashing my head against a black box isn't a good way to solve problems I encounter. I've dug into open source code or libraries innumerable times to either find a workaround for an error, patch the error, locate a bug ticket or file a bug ticket.


If only error messages printed out stack traces. Oh wait, they do.


When it comes to JS UI frameworks they're not great a lot of the time. Working with Ember and the stack trace only goes as far back as their event loop scheduling something, or Angular JS used to throw their own custom errors with the stack trace of the original error in the string message which is not clickable in the browser as the browser only sees the stack trace of the newly thrown error.


Can this quote die already? Rob has repeatedly demonstrated he doesn't know what's best for everyone.


It sounds like the 340k of memory quote. Yes, it did not age well, but you know what, some times people can't predict the future and at the time the quote was said, it made some sense then. The internet is full of "smarter than everyone else" that have never misspoke about anything, ever.


Bill gates did not misspeak. Because he has never said it in the first place. Not to rain on your parade, people make mistakes all the time and everyone has a duty to not escalate mistakes.

" Gates himself has strenuously denied making the comment. In a newspaper column that he wrote in the mid-1990s, Gates responded to a student's question about the quote: "I've said some stupid things and some wrong things, but not that. No one involved in computers would ever say that a certain amount of memory is enough for all time." Later in the column, he added, "I keep bumping into that silly quotation attributed to me that says 640K of memory is enough. There's never a citation; the quotation just floats like a rumor, repeated again and again." "

https://www.computerworld.com/article/2534312/the--640k--quo...


I specifically left the 340k quote unattributed for this reason. However, it is an (in)famous quote on the internet. That's all I was referencing. So, it's not my parade you're raining on, so hope you don't have a big jump from your soap box. You kind of proved my point of the internet if full of "people smarter than everyone else"


And some quotes didn’t make sense at the time they were said, either.


He said it in 2012.


340k of memory quote is a myth


That's silly. Use whatever makes you productive.

I actually hate syntax highlighting (find it weirdly distracting), but i would never tell anyone else how best to program. If it works for you, use it. If it doesn't don't.


[flagged]


[flagged]


Man what did these guys say!


You can go to your profile and enable the "showdead" option to see the comments.


Not worth it. It's just trolls


Some people like to be able to determine that for themselves and possibly vouch when they think a comment was wrongfully flagged. I'm just informing of the feature.


I've vouched for ~1% of the comments I've seen. Totally not worth it. (But, then again, I have the feature turned on.)


Worth it — freedom of expression ensures unpopular but valuable ideas are heard (your 1%! and mine!).


Yeah, I’ve had it on for years and realized I’m not missing anything.


I get you. I was saying that reading those specific comments was not worth turning the feature on.


I know. I agree that the "these people should die" comment should be flagged, but I vouched for the "Rob Pike is my idol and I think syntax highlighting is overrated" comment. It may deserve a downvote, but I think flagging is excessive.

Even the lamontcg's "you outdid the other commenter" comment was flagged instead of downvoted. I vouched for that, too. I think people are too trigger-happy on the "flag" link. Flagging is generally done for spam and wholly inappropriate content like porn or wishing death, and I can't see either of the comments I vouched as being that.


I mean I technically called the guy I was responding to an asshole which is a personal attack, which should get flagged per the rules on this site. But the "hurr durr old dumb programmer get corona and die" was bad enough I felt that was a measured response.


I must be so used to hearing such words that it didn't even register as a personal attack. I guess you're right.


Indeed I was not aware of that feature. Thanks!


Sadly the .js file[1] backing that page is 860 kilobytes of minified unreadable gibberish, containing the various strings that can appear in the code editor hard-coded in the same line of text as minified React. I don't know how much of the file is frameworks and how much is responsible for making editable code, but shipping nearly a megabyte of JS to the browser feels sad.

I've noticed that the editable text in the laptop screen isn't as overexposed as the rest of the laptop's screen.

On that note, why is it so hard to photograph a screen with the right exposure? Automatic exposure always gets the brightness wrong, and even if you manually fix the exposure level, it's hard to reliably map black to near #000000 and white to near #ffffff and gray to near #808080.

[1]: https://s3-eu-west-1.amazonaws.com/developer-portal-assets/l...


> I don't know how much of the file is frameworks and how much is responsible for making editable code

I don't think very much. This is a contenteditable <textarea> element with a CSS transform to project it onto the screen in the photo.

From digging through the minified js, there's just a small amount of code that sets it up and puts some canned text in there (of which there are a few choices, but still not a huge amount).


You’re going to have a heart attack when you try to cat an executable on your local machine!



it's almost like they used a js compressor


The colour space of a photo, is nearly always not the same as the colour space of a photograph.


What's the difference between a "photo" and a "photograph"?


> The word ‘photo’ comes from the Greek word for light.

> A photo may also be referred to as a ‘photograph’, this is a combination of the Greek words for light and drawing; A photograph is a drawing made of light.

Source https://shuttermuse.com/glossary/photo/

According to Wikipedia the two words mean the same thing:

https://en.m.wikipedia.org/wiki/Photograph

Photo seems to be the more popular version lately which is hardly surprising:

https://books.google.com/ngrams/graph?content=photo%2Cphotog...


Trying to assume as much good faith in the original comment, GP may have been talking about the difference between the original photo and the resulting published jpeg file.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: