There have been multiple accounts created with the sole purpose of posting advertisement posts or replies containing unsolicited advertising.

Accounts which solely post advertisements, or persistently post them may be terminated.

programmer_humor

This magazine is from a federated server and may be incomplete. Browse more on the original instance.

PlexSheep , in It's called attaining divinity

C was always a high level language for me? As soon as I knew it existed at least.

umbraroze , in Old timers know

There’s still a few sites I deploy changes to using ssh+rsync. …which is made considerably easier by the fact that it’s just a static website generated with Jekyll.

umbraroze , in It's called attaining divinity

I mean, C is a high level language? Now, sure, C isn’t a super expressive language and every C statement compiles to very few assembly instructions comparatively speaking, but it has a whole lot of stuff that assembly doesn’t have. Like nice loops and other control structures and such, and not worry about which processor registers are used.

Aux ,

Guess what, assembly is also a high level language, lol.

IsoSpandy , in It's called attaining divinity

When I learnt programming (back in early 2000s) the textbook said C is a high level 3rd generation language with 4th gen languages being something higher (I don’t remember what examples were given specifically). This is back when the java applets and action script for flash were the hot things. How I miss the days without the world being cursed by JS.

MonkderDritte ,

I think C was 2nd, 3. is Java and Python, 4 SQL and 5th would be some hypothetical AI instruction language?

thefool ,

SQL has been around since the 1970s

Blackmist ,

That doesn’t mean it’s not higher level than other languages from more recent times.

MonkderDritte ,

Level means level of abstraction. Right?

Aux ,

1st level is direct binary code as was done with punch cards. Assembly language is a 2nd level language. C is a level above, thus it’s level 3.

MonkderDritte ,

Ah, thanks! Right, binary was one too.

Aux ,

I would also like to add some of the higher level features available in most assembly languages.

  1. Memory management. You can define variables, for example, a string one containing “Hello, world!” and the compiler will correctly allocate required memory and you don’t need to know its address while writing the code, you just reference the variable.
  2. Code labels. If you want to do a conditional or unconditional jump, you need to know the address of the code you want to reach. But, obviously, every change you make to your code base will change the memory layout of your binary. Asembly provides code labels. You can think of them like function names.
  3. Assembly allows you to reference 3rd party libraries without knowing exact function entry addresses. You just use function names like you would with C or any other language.

Modern assembly languages have even more higher level features, like macros support. And some are even hardware agnostic, like intermediate representation assembly language used in LLVM.

mkwt ,

When the gp’s book says that C is a third generation language: I would guess the first generation is Fortran and the second generation contains ALGOL and BCPL. C was heavily influenced by BCPL. (get it? C comes after B)

MonkderDritte ,

I think we mean different kinds of “generations”.

Lmaydev ,

Java applets and flash were an absolute security nightmare of the highest degree.

You were just running applications on your computer.

If you had to download and run an application on your computer to view a website now people would lose their minds (and rightly so)

TechNerdWizard42 , in Old timers know

You will pry ftp from my cold dead hands.

JackbyDev ,

Can you use sftp instead? Pwease? 🥺

TechNerdWizard42 ,

Who can afford the performance hit?

My production server running Win XP Home has to have the firewall off just to make all the super secret company internal networks work. SFTP would cripple us!

/s, except about the performance hit being stupidly unacceptable in 2024.

Leate_Wonceslace , in Not everything can be done in constant time, that's O(k)
@Leate_Wonceslace@lemmy.dbzer0.com avatar

How the fuck?!

unreachable , in I'll have you know, my fork of a github repo has 3 stars 😎
@unreachable@lemmy.world avatar
einlander , in I'll have you know, my fork of a github repo has 3 stars 😎
jubilationtcornpone , in Such a pain in the sas

At a former job, there was one – and only one – lady in customer service who would actually reboot and do all the basic troubleshooting steps before calling IT. If we heard from her, we knew something was legitimately broken. Oddly enough, I’m married to her now. Best decision I ever made.

SatouKazuma ,

Have you had to reboot her yet?

Qubbe , in Old timers know

FTP Explorer all the way! Preferred that to filezilla… I mean it didn’t support sftp but I liked it.

aard , in Such a pain in the sas
@aard@kyu.de avatar

Did pretty much the same with a new server recently - spent ages debugging why it didn’t find the SAS disks. Turns out, disks like to have power connected, and no amount of debugging on software level will help you.

morgunkorn , in JavaScript
@morgunkorn@discuss.tchncs.de avatar

On the other hand, I don’t think you should add those ever

RecluseRamble ,

Onfuscators probably use it though, so no spec ever will be able to get rid of this crap.

Windex007 ,

Can I vote for obsfuscators not holding a language hostage?

msage ,

Best I can do is tie your pension to it.

intensely_human ,

Only if I can vote for sandwiches not falling apart when I eat them

firelizzard ,
@firelizzard@programming.dev avatar

Sure. But in a sane language doing something totally nonsensical like that is an error, and in a statically typed language it’s a compiler error. It doesn’t just silently do weird shit.

morgunkorn ,
@morgunkorn@discuss.tchncs.de avatar

Agreed! Unfortunately these maddening behaviors were kind of set in stone several decades ago, and it has been (correctly) decided “Don’t break the web”, these weird quirks are kept in modern interpreters/compilers.

It’s actually quite interesting to read through the logic to follow when implementing an interpreter:

262.ecma-international.org/13.0/-object.proto…

leftzero ,

a sane language

JavaScript

Pick one.

firelizzard ,
@firelizzard@programming.dev avatar

I thought it was clear I was saying JavaScript is not a sane language for this very reason

IndiBrony , in I'll have you know, my fork of a github repo has 3 stars 😎
@IndiBrony@lemmy.world avatar

I have 69 followers on YouTube. Where does that put me?

pineapplelover ,

You’re pretty much famous bro. Can I get your autograph?

IndiBrony ,
@IndiBrony@lemmy.world avatar
passepartout OP ,
@passepartout@feddit.org avatar

On top of another person, or below if that’s your style. In any way, your head must face their genitals and other way round. Glad I could help!

9point6 , in JavaScript

GIGO

bahbah23 ,

I’ve read different defenses for JavaScript for cases like this, which usually runs somewhere from you shouldn’t be doing that anyway all the way up to if you just understood the language better you’d know why. While I agree with both of those points strongly as general principles, JavaScript also violates the principle of least surprise enough to make it concerning.

For what it’s worth, I do like JavaScript. I really don’t think that there is any perfect programming language.

5C5C5C ,

I really don’t think that there is any perfect programming language.

You’d be wrong 🦀🦀🦀🦀🦀

bahbah23 ,

Fair, I haven’t used Rust so I don’t really have an opinion on it.

9point6 ,

That’s a weird emoji to use for elixir

sparkle ,

Elixir? Is that the weird older cousin of Gleam?

skulbuny ,
@skulbuny@sh.itjust.works avatar

Compile times say otherwise

palordrolap ,

JavaScript, like some other languages of the time, was designed with the Robustness Principle in mind. Arguably the wrong end of the Robustness Principle, but still.

That is, it was designed to accept anything that wasn't a syntax error (if not a few other things besides) and not generate run-time errors unless absolutely necessary. The thinking was that the last thing the user of something written in JavaScript wants is for their browser to crash or lock up because something divided by zero or couldn't find an object property.

Also it was originally written in about five minutes by one guy who hadn't had enough sleep. (I may have misremembered this part, but I get the feeling I'm not too far off.)

zarkanian ,
@zarkanian@sh.itjust.works avatar

It was 10 days, but, yeah, not a lot of time, especially for one guy. (That one guy was Brendan Eich, by the way.)

victorz , in JavaScript

In node, I get the same result in both cases. “[object Object]”

It’s calling the toString() method on both of them, which in the array case is the same as calling .join(“,”) on the array. For an empty array, that results in an empty string added to “[object Object]” at either end in the respective case in the picture.

Not sure how we’d get 0 though. Anybody know an implementation that does that? Browsers do that maybe? Which way is spec compliant? Number([]) is 0, and I think maybe it’s in the spec that the algorithm for type coercion includes an initial attempt to convert to Number before falling back to toString()? I dunno, this is all off the top of my head.

PoolloverNathan ,

The inspector REPL evaluates as a statement-with-value (like eval), so the {} at the beginning is considered an empty block, not an object. This leaves +[], which is 0. I don’t know what would make Node differ, however.

Edit: Tested it myself. It seems Node prefers evaluating this as an expression when it can, but explicitly using eval gives the inspector behavior: https://nathanlaptopv.axolotl-snake.ts.net/rhnpp358211dyyhzzyfam5a6yr3k25ik-Screenshot_20240623-132245.png

victorz ,

So there’s yet another level of quirkery to this bullshit then, it seems. 😆 Nice digging! 🤝

I also noticed that if you surround the curlies with parentheses, you get the same again:


<span style="color:#323232;">> eval('{} + []')
</span><span style="color:#323232;">0
</span><span style="color:#323232;">> eval('({}) + []')
</span><span style="color:#323232;">'[object Object]'
</span>
PoolloverNathan ,

Yep, parentheses force {} to be interpreted as an expression rather than a block — same reason why IIFEs have !function instead of just function.

victorz ,

I thought IIFE’s usually looked like (function (…params) {})(…args). That’s not the latest way? To be honest I never used them much, at least not after arrow functions arrived.

dejected_warp_core ,

/me goes back to get second folding chair.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • [email protected]
  • random
  • lifeLocal
  • goranko
  • All magazines