this post was submitted on 01 Sep 2023
254 points (96.4% liked)

Programming

17495 readers
144 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
[–] million@lemmy.world 118 points 1 year ago (10 children)

Refactoring is something that should be constantly in a good base, for every story. As soon as people get scared about changing things the codebase is on the road to being legacy.

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

Only if the code base is well tested.

Edit: always add tests when you change code that doesn’t have tests.

load more comments (1 replies)
load more comments (9 replies)
[–] fubo@lemmy.world 93 points 1 year ago* (last edited 1 year ago) (10 children)

Until you know a few very different languages, you don't know what a good language is, so just relax on having opinions about which languages are better. You don't need those opinions. They just get in your way.

Don't even worry about what your first language is. The CS snobs used to say BASIC causes brain damage and that us '80s microcomputer kids were permanently ruined ... but that was wrong. JavaScript is fine, C# is fine ... as long as you don't stop there.

(One of my first programming languages was ZZT-OOP, the scripting language for Tim Sweeney's first published game, back when Epic Games was called Potomac Computer Systems. It doesn't have numbers. If you want to count something, you can move objects around on the game board to count it. If ZZT-OOP doesn't cause brain damage, no language will.)


Please don't say the new language you're being asked to learn is "unintuitive". That's just a rude word for "not yet familiar to me". So what if the first language you used required curly braces, and the next one you learn doesn't? So what if type inference means that you don't have to write int on your ints? You'll get used to it.

You learned how to use curly braces, and you'll learn how to use something else too. You're smart. You can cope with indentation rules or significant capitalization or funny punctuation. The idea that some features are "unintuitive" rather than merely temporarily unfamiliar is just getting in your way.

[–] Walnut356@programming.dev 20 points 1 year ago (6 children)

Please don't say the new language you're being asked to learn is "unintuitive". That's just a rude word for "not yet familiar to me"...The idea that some features are "unintuitive" rather than merely temporarily unfamiliar is just getting in your way.

Well i mean... that's kinda what "unintuitive" means. Intuitive, i.e. natural/obvious/without effort. Having to gain familiarity sorta literally means it's not that, thus unintuitive.

I dont disagree with your sentiment, but these people are using the correct term. For example, python len(object) instead of obj.len() trips me up to this day because 99% of the time i think [thing] -> [action], and most language constructs encourage that. If I still regularly type an object name, and then have to scroll the cursor back over and type "len(", i cant possibly be using my intuition. It's not the language's "fault" - because it's not really "wrong" - but it is unintuitive.

load more comments (6 replies)
load more comments (9 replies)
[–] argv_minus_one@beehaw.org 83 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 17 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)
[–] MrTallyman@programming.dev 68 points 1 year ago (10 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 25 points 1 year ago

This take gets colder as you get more experience.

load more comments (9 replies)
[–] uniqueid198x@lemmy.dbzer0.com 66 points 1 year ago (4 children)

Programing is a lot less important than people and team dynamics

load more comments (4 replies)
[–] Vince@feddit.de 55 points 1 year ago (7 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 progress languages matters a lot
[–] brettvitaz@programming.dev 21 points 1 year ago (3 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 (3 replies)
load more comments (6 replies)
[–] witx@lemmy.sdf.org 51 points 1 year ago (11 children)

Python is only good for short programs

[–] lysdexic@programming.dev 19 points 1 year ago (7 children)

Python is only good for short programs

Was Python designed with enterprise applications in mind?

It sounds like some developers have a Python hammer and they can only envision using that hammer to drive any kind of nail, no matter how poorly.

load more comments (7 replies)
load more comments (10 replies)
[–] corstian@lemmy.world 50 points 1 year ago

Most modern software is way too complex for what it actually does.

[–] asyncrosaurus@programming.dev 48 points 1 year ago (11 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 (11 replies)
[–] Elderos@lemmings.world 43 points 1 year ago* (last edited 1 year ago) (4 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 (4 replies)
[–] r1veRRR@feddit.de 39 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)
[–] hansl@lemmy.ml 35 points 1 year ago (2 children)

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

load more comments (2 replies)
[–] Yearly1845@reddthat.com 32 points 1 year ago (18 children)

Tabs are better than spaces

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

Internet would be better if javascript was never invented.

[–] whoisearth@lemmy.ca 18 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)
load more comments (3 replies)
[–] flamboyantkoala@programming.dev 30 points 1 year ago (8 children)

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

load more comments (8 replies)
[–] Xylight@lemmy.xylight.dev 29 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)
[–] nous@programming.dev 29 points 1 year ago (5 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 (5 replies)
[–] BatmanAoD@programming.dev 27 points 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. (Naturally, this is a hard problem, but I think very few developers are working on it.)

load more comments (6 replies)
[–] OADINC@feddit.nl 26 points 1 year ago* (last edited 1 year ago) (8 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 (8 replies)
[–] chicken@lemmy.dbzer0.com 25 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)
[–] gpopides@lemmy.world 25 points 1 year ago (2 children)

Not everything should be beginner friendly. Trying to nerf things because they are not beginner friendly should not be how tools/patterns of languages are designed.

Its ok to have more advanced topic that require more knowledge and that people don't understand from the first moment they see them.

load more comments (2 replies)
[–] phoenixz@lemmy.ca 23 points 1 year ago (25 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

load more comments (25 replies)
[–] Masterkraft0r@discuss.tchncs.de 23 points 1 year ago* (last edited 1 year ago) (6 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 (6 replies)
[–] NewPerspective@lemmy.world 21 points 1 year ago (13 children)

If white space carries any function that the compiler/interpreter needs to know about like structure or scope, it's probably not a very good programming language.

load more comments (13 replies)
[–] shapis@lemmy.ml 21 points 1 year ago (25 children)
load more comments (25 replies)
[–] IcecreamMelts@lemmy.world 21 points 1 year ago (10 children)

Microsoft has not made a good product. Ever. Every program has issues that should not be there if you're selling it. Yet they get away with it

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

Using single character variable names is always bad practice

load more comments (13 replies)
[–] olafurp@lemmy.world 20 points 1 year ago (1 children)

You can use all the classes, patterns, functions, methods you want but if it's not readable it's garbage.

load more comments (1 replies)
[–] bidenicecream@hexbear.net 20 points 1 year ago* (last edited 1 year ago) (6 children)

Computer hardware has been getting faster and faster for decades at this point, but my computer still slows down. Like WTF. The dumbass programmers take the extra power given to them and squander it instead of optimizing their code. Microsoft word could run pretty well on a windows 98 PC, but the new Word can slow down PCs that are 5-10 years old. Programmers are complete idiots sometimes...

load more comments (6 replies)
[–] popcar2@programming.dev 19 points 1 year ago (9 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.

load more comments (9 replies)
[–] GaveUp@hexbear.net 18 points 1 year ago* (last edited 1 year ago) (2 children)

Everybody trashing on code reviews has never worked with a shit coder before

I'm a shit coder and almost every single review I've made big mistakes like forgetting to delete debug/dead code and there's always meaningful improvements being suggested

load more comments (2 replies)
[–] words_number@programming.dev 18 points 1 year ago (10 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 (10 replies)
[–] escapesamsara@discuss.online 18 points 1 year ago (7 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 17 points 1 year ago (5 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 (5 replies)
load more comments (6 replies)
[–] dpkonofa@lemmy.world 18 points 1 year ago* (last edited 1 year ago) (2 children)

Most frameworks are garbage and most programmers that use them have no idea how they work and that makes them shitty programmers. I hate when people use frameworks without even knowing why they’re using them.

load more comments (2 replies)
[–] mathterdark@lemmy.world 18 points 1 year ago (1 children)

MATLAB is an okay programming language when used in the right context. It’s intended for scientific applications, so trying to do your standard object oriented programming with it gets weird. I think we forget that some things were made for a specific purpose- you know, a hammer can’t do everything and all that.

load more comments (1 replies)
[–] Obscerno@lemm.ee 17 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)
[–] thomasdouwes@sopuli.xyz 17 points 1 year ago (2 children)

Not sure about here but is was a hot take on reddit:
Pointers are not that hard and really useful

load more comments (2 replies)
[–] akd@lemm.ee 17 points 1 year ago (4 children)
load more comments (4 replies)
[–] TheGamingLuddite@hexbear.net 17 points 1 year ago (4 children)

Assembly is fun because it makes you feel like a wizard, even if you're bad and it's not an efficient way to code. Everyone should try it once.

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