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.

xmunk , in thisIsGoingToBeASeriousDebate

System.out.println

dauerstaender , in thisIsGoingToBeASeriousDebate

Unsafe block detected. Extermination initiated. There is no hiding from memory safety!

suodrazah , in Okay, which one of you Java devs did this

There should be a language called Cod. And coding could be Coding. Cute little fish mascot too.

bappity ,
@bappity@lemmy.world avatar

I would always pronounce it Codding if this were real

xmunk ,

Too late, valve wrote the source engine over a decade ago and I’m still mad.

TrickDacy ,

…?

irmoz ,

“source code”

Clusterfck ,

Code snippets are “filets.”

Amaltheamannen ,

There is Coq

r00ty Admin , in thisIsGoingToBeASeriousDebate
r00ty avatar

Or, you could just go the whole hog. Create your own simple CPU emulator, design a basic 8bitesque CPU, give it an output port that is the console, and load up some basic ASM to cycle through Hello World to the console port.

IdiosyncraticIdiot , in Okay, which one of you Java devs did this

Python is a virus

vsh ,
@vsh@lemm.ee avatar

Least racist end-user

BeigeAgenda ,
@BeigeAgenda@lemmy.ca avatar

I’ll bite, which programming language should people use instead of Python?

DacoTaco ,
@DacoTaco@lemmy.world avatar

Python is considered a programming language? I still classify it as scripting lol

That said, i’d personally use good old c/c++ or even c#/.net over python lol

BeigeAgenda ,
@BeigeAgenda@lemmy.ca avatar

Yes Python is definitely a programming language, I write in C/C++/C#/Python/Bash each language has its areas where they are best.

I prefer Python for DevOps related code and writing smaller programs/tools. You just get so much handed to you with Python’s toolbox, it just makes things easier, you can use it as a scripting language or write a modular object oriented program.

I use C/C++ when performance matters and I want things to be Done right TM, and make sure to use all the help the compilers and static code checkers can give.

Zebroszczak ,

Python is just scripting language over C. Change my mind

BeigeAgenda ,
@BeigeAgenda@lemmy.ca avatar

cpython yes, but not ironpython or jython :-)

AVincentInSpace ,

Literally fucking what? Python is object oriented and garbage collected, and people write production web backends in it.

Xabis ,

C# “compiles” to intermediary bytecode, then ran in a vm. Same as Java. I’d say that’s no better than a “scripting” language with a JIT.

DacoTaco , (edited )
@DacoTaco@lemmy.world avatar

I wouldnt say a vm (as there is no emulated hardware layer around the running code ) , but sure you made a valid point actually!

30p87 ,

Python is a scripting language, but it’s generally called a programming language, because there are no key differences in their features or workings. Just as C# and Java, Python is first compiled to .pyc files and then executed with a special program, eg. Mono for C#, OpenJRE for the second and just python for the latter, except for Python it’s more hidden. C# supports Classes, Python does, but C does not (officially) … so wouldn’t C be less of a programming language then?
In the end, scripting languages are just defined as one by being easier and faster to run by all/most implementations as the “gcc main.c” and “./a.out” method of “real” programming languages, by just using “python main.py” or “node main.js” for your program. Therefore, they can be changed on the fly and added to another script.
What IS generally called a scripting language is eg. Bash, as it’s not compiled, supports few features and is not that cross compatible (except maybe with eg. WSL).

I’m a huge C/C++ fan, but some tasks just aren’t suitable for them. Parsing HTML/XML in C++? It’s possible, but a pain in the ass. I know it, I did it. Having parsed plans, tables and xml responses in C++, I can tell you Python is more suited for this job. The extra few milliseconds you save aren’t worth the hassle of verbose exception handling, non standard libraries which need different systems to stay up to date (some don’t support your make system of choice) and harder integrated extension support (you can’t just throw in a .py script for support of other providers, but need to explicitly integrate eg. lua support), especially if the bottleneck is not your code, with ~10 ms runtime, but some random ass server with ~100 ms ping.

xmunk ,

Bash is a programming language… honestly it’s like rectangles and squares - all scripting languages are programming languages but not all programming languages are flexible enough to be commonly considered scripting languages.

xmunk ,

Well, obviously, we should all exclusively program in Haskell.

BeigeAgenda ,
@BeigeAgenda@lemmy.ca avatar

I would say Erlang but hey if you are in a Haskell mood then by all means.

marcos ,

Except for the parts where you need something like Rust, that would be an improvement.

nogrub ,

reject high level programming and reurn to assembly

umbraroze , in thisIsGoingToBeASeriousDebate
@umbraroze@kbin.social avatar

Oh you fancy PC people and your fancy syscall instruction.

I still don't know why I could remember jsr $ab1e. I didn't even write that much assembly.

AVincentInSpace ,

That looks like a 6502 instruction. What system is it from?

idunnololz , in thisIsGoingToBeASeriousDebate
@idunnololz@lemmy.world avatar

Hello, world!

tilcica , in Okay, which one of you Java devs did this

as a python programmer…^yes

AVincentInSpace ,

There’s a big difference between IntelliJ and PyCharm.

IntelliJ is a Java IDE written in Java by people who are used to how Java works.

PyCharm is a Python IDE written in Java by people who are used to how Java works.

One of them is good.

nonearther , in thisIsGoingToBeASeriousDebate

console.log(“Hello World!”)

starman , in thisIsGoingToBeASeriousDebate
@starman@programming.dev avatar

Console.WriteLine(“Hello World!”);

SpaceNoodle , in thisIsGoingToBeASeriousDebate

<span style="color:#323232;">echo Hello World
</span>
lugal , in thisIsGoingToBeASeriousDebate

<span style="color:#323232;">def main(): 
</span><span style="color:#323232;">    print("Hello world") 
</span>
30p87 , in thisIsGoingToBeASeriousDebate

Personally,


<span style="color:#323232;">echo Hello World!
</span>
pranaless ,

<span style="font-weight:bold;color:#a71d5d;">use </span><span style="color:#323232;">std::process::Command;
</span><span style="color:#323232;">
</span><span style="font-weight:bold;color:#a71d5d;">fn </span><span style="font-weight:bold;color:#795da3;">main</span><span style="color:#323232;">() {
</span><span style="color:#323232;">    Command::new(</span><span style="color:#183691;">"sh"</span><span style="color:#323232;">)
</span><span style="color:#323232;">        .</span><span style="color:#62a35c;">arg</span><span style="color:#323232;">(</span><span style="color:#183691;">"-c"</span><span style="color:#323232;">)
</span><span style="color:#323232;">        .</span><span style="color:#62a35c;">arg</span><span style="color:#323232;">(</span><span style="color:#183691;">"echo Hello World!"</span><span style="color:#323232;">)
</span><span style="color:#323232;">        .</span><span style="color:#62a35c;">spawn</span><span style="color:#323232;">()
</span><span style="color:#323232;">        .</span><span style="color:#62a35c;">unwrap</span><span style="color:#323232;">();
</span><span style="color:#323232;">}
</span>

Like this?

30p87 ,

No, more like


<span style="color:#323232;">use std::process::Command; fn main() { Command::new("sh").arg("-c").arg("echo Hello World!").spawn().unwrap(); }
</span>

.
Just a little bit shorter, as it seems /s

funkajunk ,
@funkajunk@lemm.ee avatar

I just fucking threw up

30p87 ,

I did too. Multiple times in fact, I had to look at the other Rust code!

TadoTheRustacean OP ,

Isn’t echo a shell builtin?

pranaless ,

Yes and no. While coreutils does provide an echo binary, shells also have a built-in for optimisation purposes.

At first I had the code calling the binary directly, but then changed it to spawning a shell (and so using the builtin). It’s very cursed either way.

noli , in Fixing ancient bugs

How did a bug with something like that never pop up in unit tests?

JATtho OP ,

There were no unit tests and previous dev had opened the pandora’s box with half-written implementation. Gasp

MonkderZweite ,

Corner cases.

sj_zero , in When someone corrects your code

Excuse me, I think you meant "correct's you're code"

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