this post was submitted on 01 Sep 2023
222 points (100.0% liked)

Programming

423 readers
12 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 1 year ago
MODERATORS
top 50 comments
sorted by: hot top controversial new old
[–] argv_minus_one 134 points 1 year ago (11 children)

Dynamic typing is insane. You have to keep track of the type of absolutely everything, in your head. It's like the assembly of type systems, except it makes your program slower instead of faster.

[–] Cratermaker@discuss.tchncs.de 27 points 1 year ago

Nothing like trying to make sense of code you come across and all the function parameters have unhelpful names, are not primitive types, and have no type information whatsoever. Then you get to crawl through the entire thing to make sense of it.

load more comments (10 replies)
[–] uniqueid198x@lemmy.dbzer0.com 59 points 1 year ago

Programing is a lot less important than people and team dynamics

[–] AdmiralShat@programming.dev 58 points 1 year ago* (last edited 1 year ago) (3 children)

If you don't add comments, even rudimentary ones, or you don't use a naming convention that accurately describes the variables or the functions, you're a bad programmer. It doesn't matter if you know what it does now, just wait until you need to know what it does in 6 months and you have to stop what you're doing an decipher it.

[–] Kolanaki@yiffit.net 14 points 1 year ago* (last edited 1 year ago)

it doesn't matter if you don't know what it does now

If I don't know what it does now my comment of "I have no idea wtf this does" won't help me in 6 months.

load more comments (2 replies)
[–] MrTallyman@programming.dev 52 points 1 year ago (3 children)

My take is that no matter which language you are using, and no matter the field you work in, you will always have something to learn.

After 4 years of professional development, I rated my knowledge of C++ at 7/10. After 8 years, I rated it 4/10. After 15 years, I can confidently say 6.5/10.

[–] Herowyn@jlai.lu 15 points 1 year ago

This take gets colder as you get more experience.

load more comments (2 replies)
[–] Vince@feddit.de 51 points 1 year ago* (last edited 1 year ago) (8 children)

Not sure if these are hot takes:

  • Difficult to test == poorly designed
  • Code review is overrated and often poorly executed, most things should be checked automatically (review should still be done though)
  • Which programming language doesn't matter (within reason), while amount of programming languages matters a lot
[–] brettvitaz@programming.dev 22 points 1 year ago (1 children)

I agree with your first point, but pretty strongly disagree with the other two. Code review is critical. Devs should be discussing changes and design choices. One Dev can not be all things all the time and other people have experience you do not or can remind you of things you forgot. Programming language absolutely matters when you’re not the only dev on the team.

load more comments (1 replies)
load more comments (7 replies)
[–] asyncrosaurus@programming.dev 46 points 1 year ago (8 children)

SPAs are mostly garbage, and the internet has been irreparably damaged by lazy devs chasing trends just to building simple sites with overly complicated fe frameworks.

90% of the internet actually should just be rendered server side with a bit of js for interactivity. JQuery was fine at the time, Javascript is better now and Alpinejs is actually awesome. Nowadays, REST w/HTMX and HATEOAS is the most productive, painless and enjoyable web development can get. Minimal dependencies, tiny file sizes, fast and simple.

Unless your web site needs to work offline (it probably doesn't), or it has to manage client state for dozen/hundreds of data points (e.g. Google Maps), you don't need a SPA. If your site only needs to track minimal state, just use a good SSR web framework (Rails, asp.net, Django, whatever).

load more comments (8 replies)
[–] witx@lemmy.sdf.org 45 points 1 year ago (16 children)

Python is only good for short programs

load more comments (16 replies)
[–] OADINC@feddit.nl 43 points 1 year ago* (last edited 1 year ago) (3 children)

This is the only way;

if (condition) {
    code
}

Not

if (condition)
{
    code
}

Also because of my dyslexia I prefer variable & function names like this; 'File_Acces' I find it easier to read than 'fileAcces'

load more comments (3 replies)
[–] Elderos@lemmings.world 39 points 1 year ago* (last edited 1 year ago) (2 children)

The best codebase I have ever seen and collaborated on was also boring as fuck.

  • Small, immutable modules.
  • Every new features was coded by extension (the 'o' in S.O.L.I.D)
  • All dependencies were resolved by injection.
  • All the application life cycle was managed by configurable scopes.
  • There was absolutely no boiler plate except for the initial injectors.
  • All of the tests were brain-dead and took very minimal effort to write. Tests served both as documentation and specification for modules.
  • "Refactoring" was as simple as changing a constructor or a configuration file.
  • All the input/output of the modules were configurable streams.

There is more to it, but basically, it was a very strict codebase, and it used a lot of opinionated libraries. Not an easy codebase to understand if you're a newbie, but it was absolutely brain dead to maintain and extend on.

Coding actually took very little time of our day, most of it consisted of researching the best tech or what to add next. I think the codebase was objectively strictly better than all other similar software I've seen and worked on. We joked A LOT when it came time to change something in the app pretending it would take weeks and many 8 pointers, then we'd casually make the change while joking about it.

It might sound mythical and bullshity, and it wasn't perfect, it should be said that dependency injection often come in the form of highly opinionated frameworks, but it really felt like what software development should be. It really felt like engineering, boring and predictable, every PO dreams.

That being said, I given up trying to convince people that having life-cycle logic are over the place and fetching dependencies left and right always lead to chaos. Unfortunately I cannot really tell you guys what the software was about because I am not allowed to, but there was a lot of moving parts (hence why we decided to go with this approach). I will also reiterate that it was boring as fuck. If anything, my hot take would be that most programmers are subconsciously lying to themselves, and prefer to code whatever it is they like, instead of what the codebase need, and using whatever tool they like, instead of the tools the project and the team need. Programming like and engineer is not "fun", programming like a cowboy and ignoring the tests is a whole lot of fun.

load more comments (2 replies)
[–] hansl@lemmy.ml 37 points 1 year ago (1 children)

Hot take: people who don’t like code reviews have never been part of a good code review culture.

load more comments (1 replies)
[–] r1veRRR@feddit.de 37 points 1 year ago (5 children)

Compiler checked typing is strictly superior to dynamic typing. Any criticism of it is either ignorance, only applicable to older languages or a temporarily missing feature from the current languages.

Using dynamic languages is understandable for a lot of language "external" reasons, just that I really feel like there's no good argument for it.

load more comments (5 replies)
[–] Yearly1845@reddthat.com 36 points 1 year ago (6 children)

Tabs are better than spaces

load more comments (6 replies)
[–] qwerty@discuss.tchncs.de 35 points 1 year ago (1 children)

Internet would be better if javascript was never invented.

[–] whoisearth@lemmy.ca 19 points 1 year ago (1 children)

The JavaScript ecosystem is made worse by the legions of "developers" in it which amount to bro-velopers that put no thought into if something is needed before they create it. There's a strong overlap between the idiots in crypto and JavaScript developers that needs to be decoupled drastically.

load more comments (1 replies)
[–] phoenixz@lemmy.ca 30 points 1 year ago (16 children)

Go with what works

Error messages should contain the information that caused the error. Your average Microsoft error "error 37253" is worthless to me

Keep functions or methods short. Anything longer than 20 - 50 lines is likely too long

Comment why is happening, not what

PHP is actually a really nice language to work with both for web and command line utils

Don't over engineer, KISS. Keep It Simple Stupid

SOLID is quite okay but sometimes there are solid reasons to break those rules

MVC is a PITA in practice, avoid it when possible

[–] SlikPikker@lemmy.ca 16 points 1 year ago (9 children)

PHP is actually a really nice language to work with both for web and command line utils

Pervert.

load more comments (9 replies)
load more comments (15 replies)
[–] Xylight@lemmy.xylight.dev 28 points 1 year ago (1 children)

Make your app use native components instead of making your own crappy theme for the 782th time

load more comments (1 replies)
[–] flamboyantkoala@programming.dev 28 points 1 year ago

Agile in it’s current implementation with excessive meetings wastes more time than the mistakes it tries to avoid.

[–] Masterkraft0r@discuss.tchncs.de 27 points 1 year ago* (last edited 1 year ago) (2 children)

As an embedded firmware guy for 10ish years:

C can die in a fire. It's "simplicity" hides the emergent complexity by using it as it has nearly no compile time checks for anything and nearly no potential for sensible abstraction. It's like walking on an infinite tight rope in fog while an earth quake is happening.

For completely different reasons: The same is true for C++ but to a far lesser extent.

load more comments (2 replies)
[–] Buttons@programming.dev 25 points 1 year ago (4 children)

Shorter code is almost always better.

Should you use a class? Should you use a Factory pattern or some other pattern? Should you reorganize your code? Whichever results in the least code is probably best.

A nice thing about code length is it's objective. We can argue all day about which design pattern makes more sense, but we can agree on which of two implementations is shorter.

It takes a damn good abstraction to beat having shorter code.

load more comments (4 replies)
[–] shapis@lemmy.ml 25 points 1 year ago (23 children)
load more comments (23 replies)
[–] BatmanAoD@programming.dev 24 points 1 year ago* (last edited 1 year ago) (6 children)

The programming languages you use, and the variety of languages you learn, deeply influence how you think about software design.

Software would be much more reliable (in general) if Erlang had become one of the dominant languages for development.

Go sacrifices too much for superficial simplicity; but I would like to see a language that's nearly as easy to learn, but has a better type system and fewer footguns.

Unit testing is often overrated. It is not good for discovering or protecting against most bugs.

Build/test/deploy infrastructure is a genuinely hard problem that needs better tooling, particularly for testability.

load more comments (6 replies)
[–] words_number@programming.dev 23 points 1 year ago (5 children)

JS is horse shit. Instead of trying to improve it or using that high level scripting language as a compilation target (wtf?!), we should deprecate it entirely and put all efforts into web assembly.

load more comments (5 replies)
[–] ahmed@discuss.tchncs.de 23 points 1 year ago (7 children)

Oop is overrated

I never can understand classes

load more comments (7 replies)
[–] popcar2@programming.dev 23 points 1 year ago (8 children)

Web development feels like it's stuck in the early 2000's. I've ranted a lot about it over the years but I just don't know how everyone is okay with it. I'm sure tons of people will disagree.

HTML is bad. The language itself feels unintuitive and is clunky compared to modern markdown languages, and let's be honest, your webpage just consists of nested <div> tags.

CSS is bad. Who knew styling can be so unintuitive and unmanageable? Maybe it made sense 25 years ago, but now it's just terrible. It's very clunkily integrated with HTML too in my opinion. Styling and markdown should be one easier to use language where 50% of it isn't deprecated.

Javascript has been memed to death so I won't even go there. Typescript is OK I suppose.

And now for my hottest take: ~10+ years ago I saw web building tools like Wix and I completely expected web development to head in the direction using a GUI to create, style, and script from one interface, even allowing you to create and see dynamic content instantly. I've seen competitors and waited for "the big one" that's actually free and open source and good enough to be used professionally. It never happened. Web dev has just gone backwards and stuck in its old ways, now it's a bloated mess that takes way more time than it deserves.

The Godot engine is actually a pretty good option for creating GUI apps and it's exactly what I envisioned web dev should've been this past decade. One language, intuitive interface, simple theming and easy rapid development... Shame it never happened.

[–] lysdexic@programming.dev 18 points 1 year ago* (last edited 1 year ago) (1 children)

HTML is bad. The language itself feels unintuitive and is clunky compared to modern markdown languages, and let’s be honest, your webpage just consists of nested tags.

My websites do not consist of nested divs. Your webpages might just consist of nested divs, but only if you are clueless about what you're doing and are oblivious to basic stuff like accessibility support.

CSS is bad. Who knew styling can be so unintuitive and unmanageable? Maybe it made sense 25 years ago, but now it’s just terrible. It’s very clunkily integrated with HTML too in my opinion.

Being unmanageable is the output of the developer team, not the languages they use. Decoupling Presentation from the data and semantics never ceases to make sense. CSS has many issues but the way its integrated with HTML is certainly not one of them.

Frankly, you sound like you blame your tools a lot.

load more comments (1 replies)
load more comments (7 replies)
[–] Obscerno@lemm.ee 22 points 1 year ago (4 children)

We use too many libraries. This may be an actual unpopular opinion though. I find that the more a library tries to do, and the more dependencies it has itself, the more hesitant I am to use it. It just feels like a tower of cards ready to fall at any moment.

I'm not a very trusting person and work alone though so this might just be an emotional decision. But it is nice having a project be composed of code that does just what is needed and nothing else. It makes it easier to fix bugs and especially to maintain the code.

I do use libraries, but only if they're absolutely necessary or if they're very focused and don't try to do a million things. It's not about size but complexity.

load more comments (4 replies)
[–] nous@programming.dev 22 points 1 year ago (6 children)

In unit testing, a "unit" does not have to be the smallest possible section of code. It can be a while class or module or even set of related classes/modules. Testing individual functions in isolation leads to brittle tests that easily break during refactoring. Testing overall system behaviour results in more robust tests that require fewer changes during refactoring which gives you more confidence then you have not introduced a regression.

load more comments (6 replies)
[–] TehPers 21 points 1 year ago (2 children)

When writing software that will be deployed to a production environment, it's better to slow down and take the time needed to write a higher quality, more durable solution than to rush and quickly kick a product out the door.

I don't know why this is a hot take, but sometimes it feels like it is.

load more comments (2 replies)
[–] hellishharlot@programming.dev 21 points 1 year ago (7 children)

Using single character variable names is always bad practice

load more comments (7 replies)
[–] Swiggles@lemmy.blahaj.zone 21 points 1 year ago (15 children)

Python is stupid. Using non printable characters as anything other than token separation is just asking for trouble.

load more comments (15 replies)
[–] chicken@lemmy.dbzer0.com 20 points 1 year ago (4 children)

I am not smart enough to effectively code with certain languages and design patterns and that's ok. There is nothing wrong with accessibility being prioritized or with making tradeoffs for the sake of reducing complexity.

load more comments (4 replies)
[–] escapesamsara@discuss.online 20 points 1 year ago (10 children)

Python is legitimately the best language by far for the vast majority of non-performance critical tasks, and most tasks that need to be developed for are not performance critical.

[–] foo@withachanceof.com 16 points 1 year ago (4 children)

Heh, I was about to comment how my hot take is that Python is overrated. It's... fine and I don't really have anything against it for the most part, but I greatly prefer Ruby to Python.

I'm speaking purely about the language itself here, not any libraries available for it (since someone will always point out how great Python is for data work).

load more comments (4 replies)
load more comments (9 replies)
[–] akd@lemm.ee 18 points 1 year ago (3 children)
load more comments (3 replies)
[–] rk96@lemmy.one 18 points 1 year ago

PHP aint all that bad

[–] pelotron@midwest.social 17 points 1 year ago

Carbon? Just what we were all hoping for, yet another programming language from Google. They can keep it.

[–] Gnubyte@lemdit.com 17 points 1 year ago* (last edited 1 year ago) (1 children)

🌶️🥵Many people consume Facebook meta company's tech stack wholesale, don't know how to actually traditionally program their way out of a paper bag, and web dev and devops caused a massive layoff (250k people) at the end of 2022, start of 2023 because it was all vaporware. They consume the same software in droves if the other guy uses it.

There is an entire subculture around it that is just a bunch of medium.com writers, YouTubers and twitter handles just trying to get the clicks for their ad money. Some of these guys have never written valid software or done anything noteworthy. If you meet them head on you'd find they have enormous egos and can't find a counter argument when presented with reason.

I'll even add on that there are many programmers who don't know how to code outside a web app.

Why is something like [react, graphql, react ssr, devops, tailwind, unit tests, containers] vaporware?

  • there are other frameworks even with component libraries that are easier to read the code for large codebases, better maintained, and have cohesive full stack solutions, and even faster to develop in, to name one quasarJS or even just plain ecmascript
  • if you look at the anatomy of these enterprises using these solutions they've evolved to have micro front ends requiring armies of workers.
  • devops is a sales term, the actual implementation of it is so contextual that you'd probably find you don't need a full time job for it half the time and most are relatively easy to setup inside of a business quarter
  • not everything is Facebook scale: unless you're padding your resume why did some of these get adopted? How complicated does your app need to be? Did you really need to transpile JavaScript for it?
  • unit tests were code to test your code that you're going to have to functionally test anyways: you're telling me that you have to write your code...twice? How the hell did this ever get justified to mangers? Why did the culture not evolve into literal automated smoke tests of the actual builds, instead of testing whether a function that is probably type annotated is going to fire anyways???
  • docker/containers suck ass: great that they solved a problem but created a whole new one. we moved to python and JS which were JIT without artifacts and suddenly everything needs a generalized build system to run it. C lang variants and Rust lang compile to a binary you can just run... Ship the small ass binary not an entire container to run your shitty web app

You know the stuff I don't hear about?

  • Javascript and Python were steps in the evolution but never the end goal. I'd even say the same of java. There are new solutions but JavaScript in the browser especially should be replaced.
  • eye appeal is buy appeal
  • that eye appeal shouldn't always mean you need to use a library or framework; vanilla apps work okay too.
  • binaries/artifacts/installer packages > containers
  • automated testing of the actual end product
  • well written logging to the point someone can tell what the application was doing without seeing code
  • using all these compsci algorithms to actually write new products and searches from scratch instead of being a framework baby: do you actually need ELK or Splunk for your search? Really?
  • you probably don't need MySQL for a lot of projects, I bet you an async library with sqlite would be the same for many of these projects.
  • small teams with feature rich apps using SSR, the value of an SSR web app
  • the value of a SPA
  • the value of traditional desktop software and not using REST APIs
load more comments (1 replies)
[–] NBJack@reddthat.com 17 points 1 year ago* (last edited 1 year ago) (3 children)

Oh boy, here we go (inhales):

Agile isn't that bad. People just believe they are more productive if they are "heads down" and not held accountable for what they write/do.

Functional programming isn't that great and doesn't solve all of the world's problems; it just pushes the issues with state to other parts of your design, and doesn't scale well in deeply nested solutions.

IDEs with proper code support (i.e. automatic structure analysis, autocomplete, etc.) are one of the best ways to deal with a large codebase that needs refactoring. Doing widescale refactors without one is asking for trouble. If you believe you don't need it, either your codebase is just that small (which is fine) or playing with fire.

Much of the advice out there on architecture and tooling isn't properly contextualized on the codebase, market, and team situation. If you believe you have the One True Architecture Solution, you are naive. (Ex. Microservices, large complex code pipelines, monorepos, etc.) Be especially wary of anything from FAANG engineering blogs unless you are also in another letter of FAANG.

There. Got it out of my system. Have fun dissecting it.

load more comments (3 replies)
[–] akselmo@lemmy.kde.social 17 points 1 year ago (4 children)
load more comments (4 replies)
[–] whoisearth@lemmy.ca 15 points 1 year ago (8 children)

SQL is the core language that everyone should be required to learn first and foremost.

load more comments (8 replies)
[–] Templa 15 points 1 year ago (1 children)

My experience with people from university is that they have extremely strong opinions about things they don't know very much how they work outside theory. There is this syndrome that you have to do everything from scratch with low level languages and keep shitting on anything that uses abstraction to make your life easier.

I don't know why people in this industry have this need of feeling that they're better than others.

load more comments (1 replies)
[–] ArmainAP@programming.dev 15 points 1 year ago* (last edited 1 year ago)

I really love the project structure of C++. I know that it is an archaic design developed like this due to lack of resources, but I find packages extremely offputting.

The first reason is that splitting declaration and implementation across files makes it easier to figure out what something does.

Second reason is that I feel that I have more control over libraries and packages that have to be manually added to a project rather than using a package manager.

Third, I feel like modern languages iterate over too many versions too fast. C++ has version releases too, but I feel that versioning is handled better from time, compatibility and stability point of view.

[–] Kirkkh@lemm.ee 15 points 1 year ago (1 children)

That ML is just a paradigm and won’t do much of what people believe it eventually will.

load more comments (1 replies)
load more comments
view more: next ›