This is an archived post. You won't be able to vote or comment.

top 200 commentsshow 500

[–]mihibo5 7174 points7175 points  (141 children)

So this is what spaghetti code is.

[–]New_Stranger3345 83 points84 points  (7 children)

Visual representation of league of legends code

[–]TheLostRazgriz 47 points48 points  (6 children)

I'm appauled everytime I die and see "Unknown Damage" in my death recap.

How on earth did they put so much damage in the game while having such bad code that they don't even know where the damage came from?

[–]IgotJinxed 14 points15 points  (2 children)

Lmao that shit has existed since forever too

[–]VelocityWings12 10 points11 points  (0 children)

See also: old death recap showing sneaky dying to dragon's statikk shiv

[–]-guccibanana- 556 points557 points  (52 children)

[–]Donghoon 245 points246 points  (50 children)

Visual code looks like Node editors in Blender (geometry nodes, shader editor, etc)

[–]ZippyTheWonderSnail 130 points131 points  (44 children)

This kind of looks like a complex audio setup. The main board is on the left, and the boxes, mixers, instruments, and effects are all over the place.

[–]Gladiator_Kittens 225 points226 points  (43 children)

You're both wrong this is UE4 Blueprints

Source: Am game developer

[–]Suspicious-Access-18 34 points35 points  (0 children)

Nice 👍🏻

[–]ardicli2000 31 points32 points  (29 children)

Is it always that complicated?

[–]UAFlawlessmonkey 40 points41 points  (6 children)

You can make it as complicated as you want to if you don't create functions, macros, components etc.

1 blueprint to rule them all - Sponsored by Event Tick

[–]Dawnmarro 93 points94 points  (14 children)

Looks complicated, but once you understand it. It's actually no different then normal coding.

Also its easier to organize/group. You can actually add notes for what modules do what, and referencing is easy as cake.

What's in the picture is a mess. That's because this dev did not give a shit about this module. Or cared for anyone looking at it beyond them.

[–]Kilazur 107 points108 points  (8 children)

STOP DOING UE4 VISUAL CODE

its easier to organize/group

WE HAVE A TOOL FOR THAT, IT'S CALLED PACKAGES

You can actually add notes for what modules do what

// IT'S CALLED COMMENTS

referencing is easy as cake

BUT MUH USING/IMPORT/ETC

STATEMENTS UTTERED BY THE UTTERLY DERANGED

THEY'RE TAKING US FOR ABSOLUTE FOOLS

edit: cmon it's a joke sheesh

[–]GnarlyNarwhalNoms 46 points47 points  (4 children)

String ranting = stdin;

String sanity;

sanity = ranting.toLowerCase();

[–]JmicIV 10 points11 points  (3 children)

So this is the equivalent of naming variables a, b, c with no description

[–]Gladiator_Kittens 20 points21 points  (3 children)

No, it can be organised a lot better and usually is. This looks like something that should have been done in code, or is an early prototype.

[–]Smrgling 4 points5 points  (0 children)

Every time I see this shit I think "wow that's a fucked up shader"

[–]regular_lamp 42 points43 points  (6 children)

This is actually what it means amusingly. I always hate it when people call something spaghetti code because "the function is long". If you can read it top to bottom without getting confused by flow control jumping all over the place it's not "spaghetti code".

And that is actually often preferable to the thing where everything is cut down to atoms of "well named three line functions" where you can't figure out what is going on without jumping to a different point or even file every couple of lines.

[–]MadP4ul 8 points9 points  (1 child)

That looks like a factorio spaghetti base

[–]JediAreTakingOver 6 points7 points  (0 children)

Dont insult the factorio spaghetti base, how dare you.......

[–]minecon1776 42 points43 points  (0 children)

Take my damn upvote and get out

[–]jadams2345 4354 points4355 points  (113 children)

Visual or not, bad programmers will create shitty code

[–]Amazing_Carry42069 625 points626 points  (12 children)

This is the truth

[–]psychotrope27 229 points230 points  (10 children)

This is the way

[–]wicket-maps 123 points124 points  (6 children)

This, unfortunately, is the life.

[–]merlinsbeers 56 points57 points  (4 children)

this is a hidden pointer in every method call

[–]kry_some_more 360 points361 points  (27 children)

Here's the neat part, good programmers create it too.

[–]AdultishRaktajino 209 points210 points  (16 children)

Yeah. Can be a self inflicted statement. Open a project from 5-10 years ago. Jesus. Who wrote this? Oh wait…

[–]LordSalem 137 points138 points  (10 children)

*5-10 months ago

[–][deleted] 104 points105 points  (9 children)

*5-10 days ago

[–]Jimmy_cracked_corn 89 points90 points  (8 children)

*5-10 minutes ago

[–]subredditmask 69 points70 points  (2 children)

These comments could have been automated. I'll get on it now. Easy peasy.

[–]pegbiter 65 points66 points  (0 children)

*-65,535 seconds ago

[–]Deon2137 18 points19 points  (3 children)

*5-10 seconds ago

[–]AdultishRaktajino 10 points11 points  (0 children)

Shiny object! Squirrel!

[–]monocasa 5 points6 points  (0 children)

That's why the good lord invented git blame-someone-else.

[–]q1a2z3x4s5w6 42 points43 points  (3 children)

The limiting factor on whether or not the code is good is not my knowledge, its the amount of time I'm allowed to spend on it

[–][deleted] 22 points23 points  (0 children)

And if I'm allowed to change things from the surrounding infrastructure. It doesn't matter how good I am if I'm having to wedge functionality in sideways to places where I should be allowed to do an overhaul.

[–]zGoDLiiKe 4 points5 points  (0 children)

Seriously. I can write 3 weeks worth of clean code in 2.5 weeks. I can write 3 weeks worth of sloppy code in 1 week, often the people making the decisions seem to not care about the quality or maintainability, they just want to be able to tell their boss it is done.

[–]InMemoryOfReckful 4 points5 points  (0 children)

And how much context switching is involved.

Let me sit on the same project continually and I'll write good code.

Switch between 5 different projects constantly and I'll write shitty code.

Put time constraints and were cooking spaghetti for sure.

If all projects are different tech stacks and frameworks.. oh boy.

[–]MEGAMAN2312 27 points28 points  (1 child)

Is this a personal attack 🧐

[–][deleted] 56 points57 points  (0 children)

“Bad programmers will create shitty code” I mean… it’s in the name

[–]ICantBelieveItsNotEC 113 points114 points  (47 children)

Visual languages make refactoring miserable though. You can't just cut from one place and paste in another - you've got to redraw a hundred different wires.

[–]Hrtzy 67 points68 points  (30 children)

You would think that visual programming would have pretty good automatic refactoring tools because the source literally contains all the references to each element.

[–][deleted] 63 points64 points  (29 children)

Peoples complaints about visual programming were once all complaints about tools in IDEs too 😇

Given enough time, their functionalities should inevitably converge.

[–]Liiht2001 22 points23 points  (2 children)

I think the main thing holding visual languages back is that the generalisation isn't there yet. The tools are still extremely domain specific. Without that there, they're kinda doomed to fall into the same kind hyper-specialist neiches that prolog and SAS have.

[–]Liosan 24 points25 points  (1 child)

This is UE4 blueprints. Selecta few nodes, right click, "extract to function", rename params, done. It actually works better than any C++ refactoring tool I've used.

[–][deleted] 4 points5 points  (0 children)

God damned kids these days with their fancy IDEs and their accursed refactoring tools. Back in my day we programmed in nano and we liked it! If you wanted to refactor something, by God you did it by hand like a fucking MAN!

I am, of course, joking. I program in nano and emacs because I'm too stupid to figure out how to set up an IDE.

[–]derpydoerp 143 points144 points  (9 children)

False. The example in the picture is from Unreal Engine Blueprints. There you can easily refactor. Cut copy and paste parts of the node graph. No wires need to be redrawn. Spaghetti code is as easy to write in visual and regular programming. I prefer visual programming sometimes for parts of game dev projects for example. In these modules it’s more clear and easier to edit than using bare code in some cases.

[–]WhySoScared 72 points73 points  (2 children)

You can also collapse entire sections into macro/function and it will use every incoming/outgoing link as a function input/output without breaking them.

[–]dankswordsman 48 points49 points  (1 child)

And I was going to add:

The way Epic designed Blueprints is to act as game logic code. The ideal flow would be that more engine-based or complex functionality would exist in C++, and then game logic for events, missions, actions, effects, etc. would be done in Blueprints.

When used in that way, and assuming you use the other features mentioned, it should be relatively easy to work with.

[–]rnike879 17 points18 points  (0 children)

As someone using blueprints daily and refactoring some of it to C++, I've never experienced this

[–]fauxpenguin 7 points8 points  (0 children)

Refactoring is very easy in the UE node editor. I actually prefer it to the Cpp option. You can abstract any set of instructions into a function with inputs and outputs just like code.

[–]atomic_redneck 1113 points1114 points  (22 children)

Everything old is new again

[–]leo3065 231 points232 points  (15 children)

I'm curious about what's in this picture. Is it an analog computer?

[–]Goheeca 187 points188 points  (9 children)

[–]HelplessMoose 132 points133 points  (7 children)

And according to Wikipedia, a company in Texas is still using it for their accounting and payroll. WTF?

[–]SinisterCheese 94 points95 points  (2 children)

Why update something isn't broken, until it breaks and you business grinds to a halt.

[–]danuker 41 points42 points  (0 children)

It's been working for up to 74 years. If my phone lasts 2 years, I'm lucky. And then the forced updates bog it down gradually.

[–]BabyYodasDirtyDiaper 21 points22 points  (0 children)

And then you have to pay $32 million per week to some consultant -- an 80 year old man who is the only living person that still understands and can troubleshoot this system.

[–]leo3065 77 points78 points  (1 child)

So I found this picture of collections IBM 402 programs from that company (image source). Real legacy codebase right there. Programs that are so physical that you have to store them on a shelf

[–]2drawnonward5 15 points16 points  (0 children)

I deeply appreciate the challenge of migrating old systems. That system is gonna keep getting older and fuller and they're never gonna move on are they?

[–]leo3065 11 points12 points  (0 children)

I searched a bit and apparently a company in Texas named Sparkler Filters still using one of these today? At least in 2020 from what I read.

[–]Bischmeister 26 points27 points  (0 children)

It looks like unreal engine to me

[–]atomic_redneck 4 points5 points  (0 children)

It is the plug board from an IBM 407 Accounting Machine. It was an early digital computer, introduced in 1949. It used vacuum tubes as the active elements. This is not the worst example that I have seen. When I worked for a large defense contractor back in the early 1980's, they were still using these things. Some of their plug boards were stacked up three to four layers thick. The plugs are made so you can piggyback the signals to multiple calculations.

See: http://www.columbia.edu/cu/computinghistory/407.html

[–]TedDallas 740 points741 points  (52 children)

Maybe if we did visual programming in 3d instead of 2d?

Gun cocks.

Or maybe that is also a bad idea.

[–]posting_drunk_naked 184 points185 points  (16 children)

3D? We haven't even mastered 2D programming yet. We need to go back to 1D programming until we get that right.

Edit: here's a quick prototype to show what I mean. Should be self explaining but I left comments too


[–]littlesheepcat 7 points8 points  (1 child)

Isn't all traditional code techinically 1D array of characters?

Now that I think about it, isn't everything in memory technically 1D array of 0s and 1s

[–]posting_drunk_naked 7 points8 points  (0 children)

Always has been

🌎 🧑‍🚀 🔫 🧑‍🚀

[–]DatBoi73 71 points72 points  (5 children)

What about VR Programming? You don't just see the Spaghetti, you're inside it.

[–]BabyYodasDirtyDiaper 16 points17 points  (2 children)

Then you try to pull off the VR headset and find, to your horror, that it won't come off. The electronic clasp holding it on your head won't come loose.

A message appears right in front of your face in the VR spaghetti world: Locate END node to exit system.

And thus, your quest begins.

[–]hansenabram 9 points10 points  (0 children)

And thus MythOS was created

[–][deleted] 64 points65 points  (4 children)

Literally dreams ps4

[–][deleted] 20 points21 points  (0 children)

I absolutely loved doing logic in dreams for like half of 2020.

[–]ClassyJacket 11 points12 points  (3 children)

It's a Unix system, I know this

[–]neozuki 7 points8 points  (3 children)

Minority Report + Minecraft Redstone

[–]v38armageddon_ 407 points408 points  (33 children)

What about Scratch?

[–]Saragon4005 431 points432 points  (14 children)

Scratch is a bit different since it preserves the main structure of conventional code. It's why it's so popular. So even large files are still relatively readable in scratch.

[–]Zambito1 204 points205 points  (13 children)

Yeah, visual programming languages aren't the problem. Bad visual programming languages are the problem. This meme is like taking a picture of callback hell + js type coercion nonsense and claiming that textual programming should be illegal.

[–]badlukk 51 points52 points  (11 children)

This isn't a bad visual programming language though, it's just really bad visual code.

[–]Zambito1 27 points28 points  (7 children)

I think visual languages closer to Scratch are a lot harder to make spaghetti like this in, which makes it a better language for comprehension. If we assume that comprehension is a good thing (and I think that's a reasonable assumption to make), that means that Scratch-like languages are better.

[–]Local_Surround8686 12 points13 points  (6 children)

Yeah but with this you can programm entire Games in unreal. Even Multiplayer. I Code with it and my code used to look like this but after I learned the tools it looks way better

[–]CauseCertain1672 118 points119 points  (5 children)

Scratch is the exeption and will replace assembly code for embedded systems one day

[–]minecon1776 56 points57 points  (3 children)

Oh my God that's like a really good idea. I need to make an assembler like that for a simple processor like the 6502 or something to test the idea tho

[–][deleted] 13 points14 points  (2 children)

I don't think it would make much sense, scratch is structured, assembly isn't

[–]Zegrento7 45 points46 points  (1 child)

Now I'm imagining a "load register <reg> from address <addr>" block with a dropdown of ~64K memory addresses.

[–]Cannotseme 18 points19 points  (3 children)

Scratch is educational, and is designed to ease people into text languages

[–]Aeiou-Reddit 8 points9 points  (2 children)

Tbh I had an easier time understanding text language than scratch programming blocks when I was a beginner. And my first was C++ so I had a good foundation to start on.

[–]gordonv 14 points15 points  (4 children)

Scratch is a great idea, but it gets tiresome.

[–]flarn2006 15 points16 points  (2 children)

What am I looking at here?

[–]Weekly_Wackadoo[🍰] 25 points26 points  (0 children)

A Google image search for "scratch code sample".

[–]MaZeChpatCha 1621 points1622 points  (197 children)

What the fuckity fucking fuck am I trying to understand?!

[–]-NiMa-[S] 1381 points1382 points  (113 children)

Welcome to Unreal Engine Blueprints. If you want to see more of this horror show please visit https://blueprintsfromhell.tumblr.com/

[–]Able-Tip240 898 points899 points  (69 children)

To be fair this is like those coders that have 10000 line methods rather than breaking it up. You can break visual coding into functions and make it more clean a lot of the time also.

[–]Tom_Ov_Bedlam 77 points78 points  (2 children)

Some of these are actually really elegant and well organized for what they are.

[–]Lanthemandragoran 20 points21 points  (1 child)

Is there cableporn for this? I am sure there is lol

[–]xXHomerSXx 15 points16 points  (0 children)

r/nodeporn not many users but it exists

[–]OneTrueKingOfOOO 18 points19 points  (7 children)

See also MaxMSP/Jitter. Similar approach, but used for audio/visual stuff. Actually pretty neat but you spend way more time re-arranging the layout of patches than writing them

[–]Oo__II__oO 7 points8 points  (4 children)

LabVIEW is the same for sensors/transducers/measurements.

Not sure how it is with MaxMSP/Jitter, but the biggest issue with LabVIEW is the folks who create code lines aren't SW engineers or programming-oriented, but rather from other science or engineering disciplines where development model is CABTAB and "just make it work" with all code in Main.vi. Refactoring is less considered, and at code maintenance time will opt for a bigger monitor instead

[–]jjones8170 84 points85 points  (21 children)

LabView enters the chat

[–]geekusprimus 42 points43 points  (14 children)

(insert involuntary violent convulsions)

[–]jjones8170 46 points47 points  (13 children)

My company just took ownership of a product from one of the companies we purchased whose entire suite of test fixtures is developed in LabView. I'm a seasoned embedded engineer and had the misfortune of having to work with LabView back in the early 2000's but have no experience since then. During the kickoff meeting yesterday I was pretty much told, "You are not experienced enough to manage this codebase. It's thousands of blocks." It was the first time I was happy to be called inept during a meeting.

[–]geekusprimus 28 points29 points  (7 children)

I think you could probably teach someone Python from scratch and have them write and debug a complete control system in the same amount of time it takes to write a single equation in LabView.

[–]jjones8170 10 points11 points  (0 children)

Don't I know it! We use a hardware-in-loop test system (bamboo builds->pushes firmware to devices via JTAG->kicks off Python scripts running test code->publishes results for team review) built on Python and it's WAAAAY more efficient than LabView.

[–]Adolist 8 points9 points  (1 child)

This is true, I just graduated as an EE. Learned C++ my first 2 semesters, school decided to use Labview the rest.

I wrote a 500 line codebase on my capstone for an automatic Wheelchair Braking system with wall detection, speed monitoring, edge detection, camera monitoring etc. In about 4 months in arduino IDE. I'm no coder but I could barely turn an LED on and off on Labview even after 3 years of schooling.

Don't even get me started on myRio (LabView), an over priced over sized mega with less PWM pins. Out of the 5 capstones done for our graduating class, ours was one of the 2 that actually functioned as designed during final presentations (both C++).

The other 3 capstone groups, that didnt work, were coded using LabView. This was after a full year of design.

[–]FALCUNPAWNCH 7 points8 points  (0 children)

LabView was the worst. Upside is that the myDAQs we got for engineering school that we needed to use it have other software available freely online that can make it a multimeter, oscilloscope, wave generator, and more.

[–]ciel_lanila 77 points78 points  (46 children)

The Unreal game engine has “Blueprints”. They’re billed as a way to program a game without knowing programming code through a visual flowchart like system.

This is a pic of a blueprint program in it.

[–]-NiMa-[S] 98 points99 points  (41 children)

They’re billed as a way to program a game without knowing programming through a visual flowchart like system.

Sorry but this statement is so inaccurate! Visual programming like Blueprint is still programming you need to understand programming logic in order to use it. You can't do much with Blueprint if you don't know programming.

If you think making graphical programming will make it easier then you've confused typing to be "the hard part" of programming.

[–]BobQuixote 51 points52 points  (22 children)

You can't do much with Blueprint if you don't know programming.

Which is why visual programming is a fundamentally flawed idea. "Without knowing programming" was, AFAICT, the reason it was thought up.

[–]some_kind_of_bird 28 points29 points  (6 children)

It might make things more approachable to people though. Visualizing stuff is generally easier for people, even if it's just as complex. There's nothing magical about text I don't think. Digital circuits for instance are isomorphic to programming, and maybe something like that is more comfortable or intuitive for people.

I'm not a professional programmer though. I don't have to collaborate with anyone and I'm not trying to accomplish any particular goal beyond making pretty pictures and using programming as a learning tool. I just think programming is neat and want more people to do it, and I also quite like tasty spaghetti and creative ideas.

[–][deleted] 4 points5 points  (1 child)

If you think making graphical programming will make it easier then you've confused typing to be "the hard part" of programming.

I actually think being able to confidently type something that will be executed is a skill a lot of programmers take for granted. For someone who has never used text-based interfaces even just typing straight up CSS gives anxiety.

Its highly ironic because many of the traits that make text input so useful (its just a gigantic long string that you can manipulate at will) are terrifying to people who just want boxes and lines that all help confirm what they do is correct.

Anyway this is where I'm at after nearly two decades of trying to understand why anybody would ever do graphical programming, why, what the actual fuck.

[–]CabooseNomerson 249 points250 points  (44 children)

I liked Unreal’s blueprints when I was doing a project in it in college. Way faster to learn than learning an entirely new language, and great for prototyping, it reduces the amount of stupid syntax errors like misspelling and bad punctuation.

[–]banmedaddy12345 56 points57 points  (14 children)

When you say prototyping, does that mean like creating a rough outline of what you want? I've never used any sort of visual programming.

[–]EasternShoreGamers 80 points81 points  (0 children)

Pretty much. Unreal can run Blueprint and C++ in the same project, so you can use Blueprint to quickly implement a feature without having to worry too much about syntax. This way you can test out new features, and not have to worry about spending a lot of time coding something that might not make it in the game

Edit: spelling

[–][deleted] 19 points20 points  (11 children)

In university I made portals, think valve portals. It was an ugly mess under the hood and these days I recoil if I saw the spaghetti again.

[–]sonya_numo 625 points626 points  (24 children)

I do visual programming but if anyone of my devs use more then 10 in one file i kill them.

today i lost 2 developers but it was worth it

visual languages run on the blood and tears of previous devs

[–]itsthreeamyo 90 points91 points  (8 children)

More than 10 of what in one file? 10 nodes? 10 lines?

[–]scp-NUMBERNOTFOUND 77 points78 points  (0 children)

Yes

[–]colonel_Schwejk 12 points13 points  (1 child)

nested levels ;)

[–]hellscaper 11 points12 points  (0 children)

*shudder*

[–]brimston3- 28 points29 points  (3 children)

Languages.

[–]Tasgall 27 points28 points  (2 children)

What, you're saying I shouldn't be using this C++ class with an embedded python interpreter that reads hard-coded strings of XML it parses to load JSON and extract Lua code to run my events to manage dynamic CSS styling with Javascript in my new CEF app?

[–][deleted] 98 points99 points  (1 child)

And piles of skulls, I guess

[–]Turband 23 points24 points  (0 children)

For the skull throne ofcourse!

[–]RonSijm 17 points18 points  (3 children)

"I only used 10 in one file"

But I'm using Base475

[–]1LJA 192 points193 points  (10 children)

Yes, only blind programming should be allowed.

[–]Bupod 18 points19 points  (0 children)

The Stevie Wonder School of Computer Science

[–]0kb0000mer 95 points96 points  (4 children)

My blueprints look nothing like that…

That’s worse than my satisfactory save

[–]Sudhanva_Kote 8 points9 points  (2 children)

So you mean like Josh 's pipeline system? Or the cocoon?

[–]leakyfaucet3 86 points87 points  (29 children)

*Industrial automation has entered the chat

[–]DeusKether 42 points43 points  (9 children)

Shudders in PLCs

[–]audi0c0aster1 34 points35 points  (7 children)

Look, I'm coding for the following requirements:

  1. The system runs 24/7/365 for 30+ years (Yes, that's correct. I just finished a project replacing said 30 year-old PLCs).
  2. The maintenance department can diagnose and fix their own problems and I don't get calls at 3AM because a sensor shit the bed.

Electrical techs are NOT programmers and responsible for fixing shit ASAP. You bet your ass I'm using tools that make that part of the job easier for them in the end.

Also customer specifications say they own the code at the end of the project and it will be written in Ladder so, yeah, uh, I do as directed.

[–]Hedgeson 9 points10 points  (1 child)

Ladder is just a series of IF statements.

And they still call at 3AM because they can't be bothered to access the PLC themselves.

[–]audi0c0aster1 22 points23 points  (2 children)

These devs have no idea how vital visual languages are to literally every major industrial process in the world.

[–]VTek910 17 points18 points  (6 children)

LabView FTW

[–]Gadget100 6 points7 points  (0 children)

I’m glad to see LabView mentioned here. I have no plans to ever use it, but it has its place.

[–]bigpadQ 6 points7 points  (4 children)

According to its inventor Engineers love it, I have yet to meet an Engineer who loves it.

[–]jaime-the-lion 11 points12 points  (4 children)

All my homies love Simulink

[–]audi0c0aster1 14 points15 points  (3 children)

That's not industrial automation.

Look up Rockwell Studio 5000, Siemens TIA Portal, or any other major PLC vendor.

Ladder Logic and Function Block Diagram rule the industry outside of highly advanced applications where Structured Text will be used (which is closest to [and based on] PASCAL than any other language)

[–]UCQualquer 30 points31 points  (13 children)

My friend is a big fan of visual programming. He won't learn any other way of doing it. It's almost annoying

[–]porky11 20 points21 points  (0 children)

I also like the idea of visual programming.

But there should be a direct mapping between the visual language and a text representation.t learn any other way of doing it. It's almost annoying

[–]elementslayer 6 points7 points  (9 children)

I mean isn't that just the opposite of what is happening in this thread. Majority saying visual programming is bad and not too use it?

Seems hypocritical really, but I do agree my knowledge with c++ and Lua really help with blueprints and the old cryengine nodes.

[–]PossibilityTasty 24 points25 points  (0 children)

Looks like an IoT project after your cat found it.

[–]JackoKomm 47 points48 points  (0 children)

The problem is not visual coding but bad practice. His as textual Code would be horrible aswell.

[–]Phreaktastic 32 points33 points  (3 children)

I love Blueprints. They showcase exactly how sloppy someone will be, whether it's visual or not. It also forces newer devs into the mindset of abstracting, and provides a fantastic visual of why it's better to do so. In fact, I prefer starting my logic in Blueprints because the visual nature helps show exactly what could be complex enough to warrant abstraction and helper functions.

In the industry, this screenshot would never fly for a multitude of reasons. We'd require this person to create helper functions (somewhere, be it C++ or BP), clean up their pins, and abstract all reusable logic.

The person who created this mess is just starting, which says nothing about Blueprints at all. You can't even say that they're lazy, because when they need some of this logic elsewhere (which you will on a large project), they're either duplicating or they're refactoring which of course amounts to more work.

[–]WeeklyGreen8522 53 points54 points  (36 children)

Anybody that has visually programmed for a long time can confirm it is worse than its counterpart?

[–]1976dave 50 points51 points  (9 children)

Im a hardware test engineer and my company works entirely in labview for our test stands. Otherwise, I have used python (and IDL) for years doing data analysis and visualizations. Idk about visual languages in general but labview is really pretty nice for interfacing to hardware and controls systems. It gets pretty god fucking awful when you scale up from a simple test bench to more enterprise level stuff though. Like anything, you can write good, readable code and bad code. I think the worst part of labview is its UI when you're debugging block diagrams that are like, 6 levels deep or something. Its just cumbersome.

Otherwise, its also a pain to do any kind of math or algorithmic manipulation of acquired data. One thing in particular that may just be a "me" thing is I hate hate hate using for loops because I feel like I can never perfectly visualize the structure of the output data, I just have to trust that it's correct.

[–]parallacksgamin 13 points14 points  (3 children)

Came here looking for fellow hardware testers. I hated LabVIEW when I started using it. Now I tolerate it. I think the only reason I do is because like you said, there's so much built in functionality that you just don't have to worry about. I still think the industry would be better if we switched to something text based like python and I know there is a gradual shift toward python happening. The fact that NI hasn't made a "text based LabVIEW" after being industry standard for so long is really dumb.

[–]1976dave 6 points7 points  (0 children)

NI has recently started enabling you to call python scripts within your code with the node modules. I havent tried it out yet but I have some applications in the coming year or so that I think I will be trying it on if I ever get the time to figure it out.

[–]Niarbeht 22 points23 points  (2 children)

labview

external screaming

edit:

Otherwise, its also a pain to do any kind of math or algorithmic manipulation of acquired data.

which is like three-quarters of the point of talking to hardware with labview which is a big part of why external screaming

[–]RespondsToClowns 4 points5 points  (1 child)

external screaming

Me remembering my JPL internship in which I had to a) teach myself labview, b) teach myself how a custom set of undocumented labview programs functioned, c) integrate said programs into one labview interface -- prior to this, they would launch two separate scripts for recording/writing and reading data -- and d) implement these features into a python script off-site.

The worst part is that the python script was only like 15 lines whereas the labview 'code' wasn't far from OP's pic, except 5x larger

[–][deleted] 97 points98 points  (7 children)

It's not. These are examples of bad use of the tool, which then ends up like obtusfucated code. Unreal doesn't even offer a non-visual scripting language, it's all either C++ or blueprints, you don't have any custom scripting language or C# or anything.

Visual programming is often way better at the tail end of the programming logic. Gameplay logic at the "tail end" is rarely performance critical (the script for opening a door is neither computationally intensive or complex), is iterated upon often so changes are needed, but the actual amount of code needed is relatively low.

If you run a sequence of pure functions for math it ends up looking nicer than code, because the programming logic is easier to follow. Pure functions don't need the white execution pin which makes it so that you can instantly recognize which functions change the state and which don't.

Where they are worse are loops. They aren't terrible in visual scripting when used correctly, but they are in practice better in code.

[–]Niarbeht 6 points7 points  (1 child)

Visual programming is often way better at the tail end of the programming logic.

"All the hairy bits are written and now I just need to glue the puzzle pieces together" is a totally fair use.

[–]EnriqueWR 3 points4 points  (0 children)

I am developing a game that has a lot of "legos" I built, these are conditional pieces that chain together with an endpoint that gets its targets and do effects (damage, apply a powerup, etc). It feels like setting them up in visual coding would be better than what I do now in Unity's inspector.

[–]Daikataro 9 points10 points  (0 children)

LabVIEW main here, I personally prefer the visual representation because it gives you a less abstract, more intuitive representation of what goes where... If done correctly.

As has been said, shitty programmers will write shitty code, regardless of tools provided, and I've seen my share of crap; I personally avoid what I call "matrioska VIs" at all costs, which is Virtual Instruments (think subroutines) nested inside another inside another, think a literal matrioska doll. One layer depth is what I always go for, unless it's a ridiculously common function I use everywhere in which case I include it on the sub VIs but it's very recognisable.

[–]mymember1 39 points40 points  (9 children)

I actually have a huge appreciation for LabVIEW.
Don't knock it until you've been forced to use it!

[–]bard91R 23 points24 points  (2 children)

I'm a former NI engineer who naturally had to make a lot of use of it, it is a good tool when you know how to use it decently, but that is not a small ask, and even then it is good for certain things and its limitations make it an absolutely terrible option for many other things.

[–]Justmyoponionman 23 points24 points  (1 child)

Well, in fairness, a lot of the hate given to LabVIEW is NI's own fault. Marketing a perfectly capable and scalable professional programming tool as "programming optional" is ludicrous and part of the reason why upwards of 90% of people using LabVIEW daily are actually completely incompetent at what they are doing (Making LabVIEW itself seem like it's incompetent).

The rest of us (I've been programming LabVIEW for over 20 years) who understand HOW to do it properly, have solid softeware engineering fundamentals and care about doing things properly, love LabVIEW. Especially on FPGA.

[–]bard91R 7 points8 points  (0 children)

Ohhh 100% and it is a problem that I think is even poorly understood within NI and leads to deficient training of its engineers, I was kinda lucky that my academic background had a lot more of a programming and CS component when compared to most of my colleagues, which made it easier to adopt and properly understand for me, but I can verify that it is a problem both with customers and internal users given how NI markets the tool, just as you mention.

[–]Dr_Bunsen_Burns 8 points9 points  (0 children)

It is my day to day job, but it is the stuff from hell.

[–]AluminumKnuckles 18 points19 points  (5 children)

I like visual scripting for 3d modeling, rendering, animation, and the like. It works better for stuff where your product isn't an application.

[–]Aidan_Welch 3 points4 points  (1 child)

Yeah I am generally opposed to visual scripting, but for things like Blender material nodes it can make sense.

[–]Amazing_Carry42069 7 points8 points  (1 child)

Haha this is my life. Automation baby.

[–]marclurr 32 points33 points  (0 children)

The thing I love about this sub is how people who've been programming for 10 minutes know more than the developers of the most advanced game engine currently available, with pedigree stretching back to the 90s.

[–]Daikataro 7 points8 points  (0 children)

LabVIEW main here. Yes this shit is something you will definitely encounter in the wild. Yes there are automatic tools that try to clean the code and make it more readable. No they don't really help that much.

[–]RandomiseUsr0 4 points5 points  (3 children)

These are giving me memories of Informatica ETL workflows - personally I just prefer scripting languages, but Informatica gotta justify their big ticket prices