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.

Aurenkin , in Planning is for the weak

If you fail to plan to plan, you plan to plan to fail.

WhiskyTangoFoxtrot ,

But if you plan to fail, then you’re not failing to plan.

coloredgrayscale ,

No need to plan, we’re agile! /s

demonquark , in Planning is for the weak

If there’s one thing I hate, it’s ppl sayin something should have been done yesterday.

Guess what, if should have been done yesterday, we’ve missed the deadline, we’ve already failed and might as wel write off the project.

coloredgrayscale ,

Welp, Task failed, no second chances, or options to deliver afterwards. Game over, toss away the work you’ve completed 90% of.

Just like in school when you failed a test or assignment.

Si_sierra , in Planning is for the weak

Their planning is for the week

Potatos_are_not_friends , in “Hire me”

I feel bad because while I don’t reach for react (I usually pick Vue or vanilla), people’s comments about react is really depressing.

There’s a LOT of shitty react code. And when you see beautiful react implementation, it’s like a work of art.

Unfortunately, react projects have been given to by bootcamps grads with 6 months of experience and it’s like the blind leading the blind…

I wonder if it’s like PHP. Lots of people shit on it because they had to futz around in a garbage project written by garbage developers, fully unaware that it can be elegant in the hands of a professional team who cares about code quality.

tsonfeir OP ,
@tsonfeir@lemm.ee avatar

PHP is great for building APIs to use with React or Vue. I’m happy I have so much back end experience with both good and bad code.

My motto: if a Junior dev can’t figure out what I’m doing after two weeks of training, I’ve failed.

MashedTech ,

I’ll put that to my soul.

DrQuint ,

The problem with some of the comments here is that even “properly” written React CAN hit a performance bump, and optimization is a rather rare skill no matter the programming context (kinda due to little time given to it, so everyone is out of practice).

But I don’t know which ones are the ones talking about that, and which ones are just people annoyed at anything Node in general.

kameecoding ,

I find react stupid because of JSX, Vue is much cleaner easier.

ofc you can create a mess with any tool or framework

tehcpengsiudai ,

When I started my programming journey, JSX was what made me stay sane.

killeronthecorner ,
@killeronthecorner@lemmy.world avatar

I wonder if it’s like PHP. Lots of people shit on it because they had to futz around in a garbage project written by garbage developers, fully unaware that it can be elegant in the hands of a professional team who cares about code quality.

You can apply this reasoning to any [web] technology. The reason it’s so visible for react, and previously PHP, is simply popularity.

sheogorath ,

Yep, finding people who understand React is hard. The majority of people who say they’re an expert in React are either coding bootcamp fresh grads or someone who’s entrenched in writing shitty React so by having them join there’s basically no difference in skill with a fresh grade hire or a fourth year college student intern.

Osnapitsjoey ,

What’s wrong with bootcamps? Honest question, as I’ve been learning to code from a python book and an “expensive” udemi course that was on sale for 20 bucks

I’d never tell people I know how to program though. I’m definitely still learning

sheogorath ,

Sometimes, if all you know is how to use a hammer, everything will look like a nail.

That’s the impression that I got from working with several bootcamp graduates. Most people who enroll are usually people who think that there’s a lot of money to be had being an SWE. However because usually bootcamps are 3-6 months max you’re just being taught how to use a specific tool to accomplish a general use case that’s already been solved many times. However, as an example in my workplace, we deal with a lot of R&D PoC projects and develop our own internal solutions due to security or law requirements from our clients. So if you’re stuck when working in one of our projects due to something, there’s no post related to that in StackOverflow.

In one case, during development I found a bug in one of the third party libraries that we use and after creating an issue in their GitHub, even the library’s maintainer is stumped. We decided to create a new internal library that solves the specific problem we’re having.

If you’re a bootcamp graduate working on that kind of project, it can be shocking.

Having a college degree can help set up your mindset work in a software engineering project.

Although it’s not necessary, because I’ve known a lot of great dev with no CS degree. But it’ll take a lot of time working in projects with a lot of different cases. Maybe it’s just that my workplace doesn’t really have a suitable kind of project for people with not a lot of experience. However lately we’ve hired a lot of fresh grads with good grades and it’s been a breeze when onboarding them to our engineering standards.

We’ve had several hires from bootcamp but there’s only one who’s a good engineer.

Take this with a grain of salt though, as lots of people can testify that they had a good experience with bootcamp grads. So maybe I’m the one who’s unlucky. YMMV.

Osnapitsjoey ,

Ah. See, I’m using bootcamps as a intro type of learning. I’ve also been just doing my own thing by learning how to make scrapers and all that (even though that’s kind of cheating because it’s just scrapy) but I’m trying to learn the fundamentals of the language so that I don’t need to just Google “how to do this” I want to be able to just do it

ramjambamalam ,

Not necessarily “wrong” but a weakness is that they tend to focus on concrete language syntax and skimp on abstract software design, and data structures and algorithms. The result is a programmer who knows how to write code, but may struggle on larger projects or more complicated problems, compared to a computer science or software engineering graduate.

Of course I’ve met developers from applied courses and boot camps who are driven, passionate, and gifted who have gone on to make excellent system designers and software architects, but generally speaking, knowing how to code alone does not make one a software developer.

AtHeartEngineer ,
@AtHeartEngineer@lemmy.world avatar

If you like vue, try svelte(kit). Not that it’s better, but another tool in your toolbox. Svelte stores are pretty nice.

mrsnowflake , in It's routine

Missed an exclamation mark (as in negation) would be better and happens to anyone.

hstde ,

Or using < instead of <= or >

LetterboxPancake ,

Something is either true or false, I would expect to have at least 50% of a chance to get it right on the first try. Nah, I fail to implement it three times because my brain went on vacation without telling me.

bleistift2 , in libmem_cpy-strnrrn-std-clib_Cmvaeffc_ld-TWA_nif.aarch64(32bit)2-0.13.2-23.2.so.7(3).1.1.gz.conf

itoa, atoi

SubArcticTundra ,
@SubArcticTundra@lemmy.ml avatar

_astrnfgets0()

FooBarrington ,

__builtin_PRAGMA_glibc____WIN32___astrnfgets0_musl()

SubArcticTundra ,
@SubArcticTundra@lemmy.ml avatar

__cdecl

executivechimp , in I finally created the perfect JavaScript runtime: No-JS
@executivechimp@discuss.tchncs.de avatar

Is this what they used on motherfuckingwebsite.com ?

FarceMultiplier , in Zero to Hero in 1 hour
@FarceMultiplier@lemmy.ca avatar

FWIW, I suspect these stairs have been photographed before adding wood steps that are deeper/wider. I base that on the low visible height of the bottom step. A 1.5-2 inch wooden slab would normalize the height of each step.

skomposzczet , in Too close to home

I think that’s the only thing I dislike about rust. Not having to use * to dereference but later having to use is tad confusing. I know it’s still clever solution but in this case I prefer c++'s straightforward consistency.

Using ampersand never was problematic for me.

Pfosten ,

C++ does have the problem that references are not objects, which introduces many subtle issues. For example, you cannot use a type like std::vector<int&>, so that templated code will often have to invoke std::remove_reference<T> and so on. Rust opts for a more consistent data model, but then introduces auto-deref (and the Deref trait) to get about the same usability C++ has with references and operator->. Note that C++ will implicitly chain operator-> calls until a plain pointer is reached, whereas Rust will stop dereferencing once a type with a matching method/field is found. Having deep knowledge of both languages, I’m not convinced that C++ features “straightforward consistency” here…

thepianistfroggollum , in The lengths we have to go to

And God forbid you use tabs in a document with spaces instead of tabs (or vice versa)

radix ,
@radix@lemm.ee avatar

:retab is your friend!

beckerist , in The lengths we have to go to

spaces or tabs

GandarfDeGrape ,

Tabs. But really with modern IDE it’s irrelevant. Whatever the tech lead says I guess.

GBU_28 ,

With things like black, flake 8 and Isort I can code however I want, list/format however I want, and commit team compliant content. The dream is real

theneverfox ,

Wait wait wait, what is this black magic and how have I not heard of it?

GBU_28 ,

So you can have a local, and a team config. So at time of commit the code rules your team has selected are enforced. So if I looked at my code, on GitHub, it would look as expected by the team.

If I load it locally, it formats as I like.

Check out the cicd stuff on PRs for github

CoderKat ,

I love such formatters and wish they were even more widespread. In many cases, I really want consistency above all and it’s so dang hard to achieve that without an opinionated formatter. If the formatters isn’t opinionated enough, it just leads to countless human enforced rules that waste time (and lead to an understandable chorus of “why can’t the formatter just do that for meeeee”).

RogueBanana ,

Yeah but outside of that where the code is implemented or in a documentation, tabs are still easier to look through. And it does look pretty as long as there aren’t too many nested functions.

mexicancartel ,

Even with nested functions tabs are neat.

Does you app have too many nested functions?

Use tab width = 2

Do your app have too less nested functions?

Use tab width = 8

Is your app having average number of nested fns?

Use tab width = 4(mostly default)

And all theese can happen without modifying a single byte in the source file, unlike spaces!

reflex ,
@reflex@kbin.social avatar

Doesn't PEP 8 say spaces somewheres?

UlrikHD ,
@UlrikHD@programming.dev avatar

4 spaces, although I’ll die on the hill that tabs should always be used instead of space for indentation. Not just in python.

Ocelot ,

Questions like that are likely to start a war

TheBananaKing ,

semicolons

Agent641 ,

Full colons

Jakylla ,
@Jakylla@sh.itjust.works avatar

4 Spaces, then one tab, then 3 spaces, then 2 tabs, then 2 spaces, then 3 tabs…

Python supports that (and I hate this)

realaether ,

Please elaborate (eg which standard is this defined in?)

Jakylla , (edited )
@Jakylla@sh.itjust.works avatar

Not any standard (and actually not at all something to do for real), but try it, it works


<span style="color:#323232;">def magic(a, b, c):
</span><span style="color:#323232;">    if a > 0:
</span><span style="color:#323232;">    	if b > 0:
</span><span style="color:#323232;">    	   		if c > 0:
</span><span style="color:#323232;">    	   		  return 'All positive'
</span><span style="color:#323232;">    
</span><span style="color:#323232;">    return 'Not all positive'
</span><span style="color:#323232;">
</span><span style="color:#323232;">print(magic(1,2,3))
</span><span style="color:#323232;">print(magic(-1,1,2))
</span><span style="color:#323232;">print(magic(1,-1,0))
</span><span style="color:#323232;">print(magic(-1,-1,-2))
</span>

(you should be able to verify I used both tab and spaces f*cking bad way in this example, like I described)

Output:


<span style="color:#323232;">All positive
</span><span style="color:#323232;">Not all positive
</span><span style="color:#323232;">Not all positive
</span><span style="color:#323232;">Not all positive
</span><span style="color:#323232;">
</span><span style="color:#323232;">
</span><span style="color:#323232;">** Process exited - Return Code: 0 **
</span><span style="color:#323232;">Press Enter to exit terminal
</span>
realaether ,

That’s really interesting. So does that mean the interpreter just checks whether the current line is more indented, less indented, or equal vs. the preceding, without caring by how much?

grozzle ,

“indentation is indentation!” (mr_incredible_cereal.jpg)

it may look messy, but would you actually rather Python didn’t support some inconsistency when the intent is clear?

being exact just for the sake of being pedantic isn’t useful.

kevincox ,
@kevincox@lemmy.ml avatar
  1. Use tabs.
  2. Enable visible whitespace.

Tada, your indentation level is nicely visible.

fckreddit , in I finally created the perfect JavaScript runtime: No-JS

No bugs, no security issues. It’s the perfect runtime.

fkn ,

And yet, somehow there is still a bug in the datetime implementation.

Acters ,

Then we can just catch the error and pretend it never happened

newIdentity , (edited )

Ironically, such a site would more bugs then of it would use Javascript. And security issues are still an issue too.

Basically everything has to be handled through forms and a site reload and hidden components and lots of css :hover events. Have you ever tried making a dropout without Javascript? It isn’t impossible, but really hard.

And such sites exist. Just that they’re mostly Darknet sites like like Dread or Bohemia

vox , (edited )
@vox@sopuli.xyz avatar

dropout menus are actually pretty easy to do without js

all you need is focus-within and friends.

like i recently made one on my personal project (which fully works without js, which is only used for realtime chat functionality and some additional effects, like loading icons in forms and stuff)

live deployment: fortum.pp.ua
recording: streamable.com/4ba0gg

newIdentity ,

That’s pretty impressive. I tried doing something similar a few months ago but couldn’t find anything. Are you using a framework or how do you render the site on the server?

vox ,
@vox@sopuli.xyz avatar

about the menu - it’s just based on focus-within. no need for any terrible hacks.
about the backend - it’s just some basic templates (tera+rocket)

shasta ,

Pretty cool. Btw on your 404 page, the footer is in the center of my screen (vertical center). I am on android using Firefox. I hit the 404 error trying out the search bar. Just thought you might like to know.

vox ,
@vox@sopuli.xyz avatar

yeah it’s unfinished, I’m planning to get back to it soon

malloc , in I finally created the perfect JavaScript runtime: No-JS

Honestly, many of my colleagues need to use this instead of the balls of mud they manage to create.

knobbysideup , in The lengths we have to go to

Programming languages that use white space to delimit structure are annoying at best. I get annoyed at yaml too, but I’m ok once I have a few templates set up.

corytheboyd ,
@corytheboyd@kbin.social avatar

YAML comes with its own unique pains in the ass https://ruudvanasseldonk.com/2023/01/11/the-yaml-document-from-hell

These things actually matter, come up often enough to actually be annoying, and are a bit difficult to explain and learn into people. You’re basically fine if you just string quote everything that you can, but nobody does that.

lemmylommy ,

That was interesting. And possibly the most Dutch name I have ever heard of.

Scribbd ,

Is Dutch name. Source: am Dutch.

mexicancartel ,

Use TABS guys TABS.

AntEater ,
@AntEater@discuss.tchncs.de avatar

Tabs suck. Use a real editor and spaces work fine.

PreachHard ,

Yeah who tf isn’t using tabs as spaces, it isn’t 2010

mexicancartel ,

Why tabs suck? Explain.

Tabs are neat.

Does you app have too many nested functions?

Use tab width = 2

Do your app have too less nested functions?

Use tab width = 8

Is your app having average number of nested fns?

Use tab width = 4(mostly default)

And all theese can happen without modifying a single byte in the source file, unlike spaces!

merc ,

Except that you have to either indent with only tabs or indent with only spaces. Any time you mix tabs and spaces you are just asking for disaster.

If you indent with only tabs you can’t align things except on tab boundaries. If you have a function that takes 10 parameters and want to do it on multiple lines, the alignment of the extra parameters is going to be ugly.

If you indent with only spaces, you can indent things so that all the parameters line up directly underneath the parenthesis, for example.

mexicancartel ,

I agree we shouldn’t mix tabs with spaces. But use tabs always. I could line up parameters together but may not be just under parentheris, and it looks good and readable for me

merc ,

I think it looks like ass, so only spaces for me.

UrbonMaximus , in The lengths we have to go to

Let me introduce you to YAML, you’ll love it!

dansity ,

I got my hair torn out till I setup my home assistant. I f*cking hate it its stupid

lhamil64 ,

One of these days I’ll actually look up how YAML indentation works. Every time I use it it’s trial and error until I stop getting errors.

merc ,

That’s a super risky way to do it. It might stop giving you errors because you finally got the indentation right, or it might stop giving you errors because you got the indentation “right” but not how you you meant to organize the objects.

CoderKat ,

Ugh, there’s some parts of YAML I love, but ultimately it’s a terrible format. It’s just too easy to confuse people. At least it has comments though. It’s so dumb that JSON doesn’t officially have comments. I’ve often parsed “JSON” as YAML entirely for comments, without using a single other YAML feature.

YAML also supports not quoting your strings. Seems great at first, but it gets weird of you want a string that looks like a different type. IIRC, there’s even a major version difference in the handling of this case! I can’t remember the details, but I once had a bug happen because of this.

Performance wise, both YAML and JSON suck. They’re fine for a config file that you just read on startup, but if you’re doing a ton of processing, it will quickly show the performance hit. Binary formats work far better (for a generic one, protobuffers has good tooling and library support while being blazing fast).

vrighter ,

json 5 does support comments. alternatively, yaml is a superset of json. any valid json is also valid yaml. but yaml also supports comments. So you can also write json with comments, and use a yaml parser on it, instead of a standard json parser

sonnenzeit ,

It’s so dumb that JSON doesn’t officially have comments.

So much this.

Used to work at a company where I sometimes had to manually edit the configuration of devices which were written and read in JSON. Super inconvenient if you have to document all changes externally. As a “hack” I would sometimes add extra objects to store strings (the comments). But that’s super dicey as you don’t know if it somehow breaks the parsing. You’re also not guaranteed the order of objects so if the configuration gets read, edited and rewritten your comment might no longer be above/below the change you made.

Always found it baffling that such a basic feature is missing from a spec that is supposed to cover a broad range of use cases.

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