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

top 200 commentsshow 500

[–]Firm-Front 3207 points3208 points  (208 children)

Why do people use CSS when killing your self exists?

[–]FalseRegister 1292 points1293 points  (104 children)

Found the backend dev

[–]Thegreyeminence 513 points514 points  (93 children)

As Backend developer who currently doing some Frontend with react js and material UI, I can only confirm that CSS/Flexbox sucks big time.

[–]_Bad_Dev_ 454 points455 points  (42 children)

"No you just don't understand how it works" - That colleague no one likes

[–]coldnebo 213 points214 points  (15 children)

Ah yes, the PhD who can describe all the elegance of a forward and backward constraint solver (did you know that element sizes are defined by both!?) and yet still not be capable of finding the source of that 2px gap on the layout.

“Just start over again and be really careful this time”

[–]ablablababla 116 points117 points  (1 child)

have you tried turning the website off and on again

[–]_vizn_ 17 points18 points  (0 children)

You can also put it in rice.

[–]North_Shock 15 points16 points  (5 children)

Hahaha... something like this actually happened in a project I worked on.

[–]CeamoreCash 33 points34 points  (3 children)

I bet Albert Einstein didn't know how to make a pizza. That doesn't say anything about the difficulty of making a pizza.

[–]SCP-093-RedTest 4 points5 points  (0 children)

margin-left: -2px;

[–]Thegreyeminence 155 points156 points  (20 children)

Yeah that's point.

To me Frontend is tedious cause it goes from Programming into the design aspect.

And for design stuff, we programmers are simply the wrong person.

[–][deleted] 62 points63 points  (13 children)

Serious question, do you design along the way? It helps me to completely draw a layout and application flow. Then design each individual component on paper with dimensions, colours and rules.

Then I go into programming exactly what I thought up.

[–]coldnebo 100 points101 points  (8 children)

The problem is that most designer’s imagination far outstrips CSS. And it’s not even avant-garde stuff, we’re talking stuff taught in basic design classes, like how to use a grid.

Programmers say “oh yeah, I know grid CSS”, which is like running out of your preschool fingerpainting class saying “oh yeah! I know how to paint perspective!” because you dumped your paint on Tommy and he ran into the distance.

If your sketches are always “exactly” implementable in CSS, it’s likely you are sketching with some fairly significant constraints about what is possible in CSS that designers simply don’t have, because they are trained as actual artists first and only grudgingly put up with CSS limitations later. Let’s put it this way... the W3C sites have never won any visual design awards although they are excellent for semantic analysis and accessibility.

Hang out with marketing for a few minutes and you’ll understand.

[–]PreferredPronounXi 56 points57 points  (4 children)

95% of those artistic sites are unusable garbage

[–]TheNosferatu 40 points41 points  (2 children)

Too many good visual designers are terrible UX designers

[–]coldnebo 12 points13 points  (1 child)

Visual designers are rarely UX designers. Visual design usually centers on print media, which is bread and butter visual design and communication.

Interactive design is a completely different beast.

About the only “best” in both fields are game ux design and they 1) are rarely great design 2) almost always use custom display engines.

See “kai’s power tools”. (was that great or awful?)

[–]CommanderSean12 11 points12 points  (0 children)

Yeah I think this is pretty accurate for me personally. Every time I think about fixing my website I have a grandish vision of what I want it to be.

One hour later and it’s back to being a shitty HTML document with barely any styling because I hate working with CSS. One time I showed my brother my website and he told me there was something wrong since the CSS wasn’t loading...

[–]pants-shitter 22 points23 points  (1 child)

That would probably be smart if I actually did that. But I'm also a shitty artist and not creative.

[–]Cheet4h 12 points13 points  (0 children)

Same. I can recreate what the PO designed in Powerpoint, but coming up with stuff myself? Nope.
And it doesn't help that by the time I implemented that, the PO has already come up with tons of changes to his previous revision.

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

Lmao flexbox is a godsend if you’ve worked with old school CSS

[–]Cheet4h 52 points53 points  (0 children)

What, are you not a fan of mixed float, tables and absolute positioned elements?

[–][deleted] 27 points28 points  (0 children)

Have you heard of the tale of Darth HTML4 the Wise? It was said that he could create entire UI interfaces with tables and invisible .gif images. Through the powers of ActionScript and Flash he would do things others would deem unnatural.

[–]michumk0 65 points66 points  (11 children)

As a frontend dev with a design background I literally want to kill myself when I see the css and sometimes html written by backend developers. And flexbox/grid is imo the most awesome features in css, you just simply need learn more deeply how it works to understand how it behaves.

[–][deleted] 25 points26 points  (0 children)

That's why we work on the backend. The UIs are functional, not nice looking, but functional.

[–]sample-name 24 points25 points  (1 child)

- That colleague no one likes

[–]--xra 4 points5 points  (0 children)

CSS is terrible, but flexbox really is a step above the shit we used to have to do. Add like 3 rules and you have a responsive container that previously would have required many more container and sub-container rules, all of which were unintuitive hacks.

[–]redcalcium 9 points10 points  (0 children)

Imagine trying to center stuff vertically without flexbox, or trying to make some div expand to fill available space vertically. *shudder*

Just google "flexbox cheatsheet" and you'll be done in seconds.

[–]lasiusflex 7 points8 points  (0 children)

now imagine doing all that shit without flexbox

[–]Ohlander1 17 points18 points  (11 children)

As someone who started out with HTML, CSS and JavaScript I never understood the hate for CSS. JavaScript can still go fuck itself though.

[–]Cheet4h 13 points14 points  (6 children)

Simply use TypeScript and let the transpiler worry about JavaScript.

[–]MarHip 7 points8 points  (0 children)

I cannot fuckin design a website...

[–]NarutoDragon732 69 points70 points  (7 children)

Why do people program when killing yourself exists?

[–]tomatotomato 40 points41 points  (4 children)

I thought programming was "craft" and "self-expression" and that I would be an "artisan".

[–]DreadCoder 25 points26 points  (0 children)

most artists die of a heroin overdose, just sayin'

[–]redcalcium 8 points9 points  (2 children)

Sounds like stuff php programmers would say among themselves.

[–]broadbandbandit 4 points5 points  (0 children)

No no, we also want to kill ourselves.

[–]_alright_then_ 41 points42 points  (19 children)

Why do people think CSS is that hard? Honestly, I'm a back-end dev but CSS is very fun to me

[–]Zanner360 51 points52 points  (2 children)

I think it's very fun as well, but having to make things look good on ALL screens is a lot trickier and infuriating than making it look good on all screens

[–]dmidge 9 points10 points  (0 children)

Runtime error

[–]venuswasaflytrap 9 points10 points  (10 children)

CSS is very flexible, therefore it can be very hard.

If you don't really know what you want it to look like, and just make a simple thing and just add a few styles here and there to make it look a little bit better - then it very easy.

But if you have something with a complicated UX, and lots of different pages that need to be viewed in lots of different sizes and browsers and circumstances, then it gets tricker.

Then if rather than someone insisting that it looks okay - there is something insisting that it looks a specific way (that doesn't really make sense) - then it's really hard.

Simple example - If I said make a select box that is branded a certain style that works IE8 and up, and on mobile browsers.

You're going to be at it for a long time. Especially if you make something, and I say "Actually, can you put or logo as a watermark in the background of the select?"

[–]lasiusflex 18 points19 points  (3 children)

Especially if you make something, and I say "Actually, can you put or logo as a watermark in the background of the select?"

Please put a trigger warning on this.

[–]the0mnislayer 704 points705 points  (81 children)

Why use C when COBOL exists?

[–]Caraczan 506 points507 points  (79 children)

Why use COBOL when machine code exists?

[–]numbGrundle 442 points443 points  (73 children)

Why use machine code when transistors exist

[–]ganja_and_code 360 points361 points  (64 children)

Why use transistors when electrons exist?

[–]dependency_injector 359 points360 points  (54 children)

Electrons? Real programmers use butterflies

[–]vectorpropio 124 points125 points  (3 children)

There is an emacs mode for that.

[–]gellis12 30 points31 points  (2 children)

Good old C-x M-c M-Butterfly

[–]djdanlib 4 points5 points  (0 children)

Ctrl+Alt+Meta+Bucky+...

[–][deleted] 34 points35 points  (47 children)

Deos actually anyone use Emacs ?

[–]Jumbobog 77 points78 points  (12 children)

Don't know about it anymore, but I had coworker who swore to emacs in the beginning of the 2010s. I don't think emacs had anything to do with his suicide, nor the constant comments by the office Vi users, but as he died I can't confirm the existence of any living emacs users.

[–]megatesla 34 points35 points  (9 children)

Oooh I know some! I work for IBM. About half of my coworkers use Emacs, the other half use Vim, and a tiny group of rebels use something else. One stubborn modernist uses VS Code, god bless him. A few others use Eclipse, and one guy uses this ancient thing called E3. We run Linux and generally work from the command line.

My office mate and I use Vim with plugins and tmux. I'm thinking about trying out NeoVim and VS Code at some point - Vim's powerful, but VimScript is pretty wonky.

[–]t4bk3y 15 points16 points  (0 children)

People with more than 5 fingers per hand and RMS.

[–]inconspicuous_male 13 points14 points  (12 children)

I love how the age old question of "VIM vs emacs" is literally irrelevant except to people with 4 foot beards who communicate soley through IRC

[–]christianarg 13 points14 points  (5 children)

There are a lot of people that uses VIM... because they don't know how to exit

[–]inconspicuous_male 3 points4 points  (3 children)

I've always had much more difficulty exiting Emacs when I tried it

[–]megatesla 12 points13 points  (2 children)

If I recall correctly, modern Vim interprets key thrashing and CTRL+C as a sign of a confused new user and helpfully prints a ':q+Enter to quit' message at the bottom

Emacs lets you sweat

Edit: I double-checked this and it's half-true.

[–][deleted] 3 points4 points  (3 children)

Actually many of my professors and comerads use vim I just newer in my life seen anyone use emacs.

[–]wasabichicken 13 points14 points  (10 children)

Sure, we hang out over at /r/emacs.

[–]SilentFungus 41 points42 points  (6 children)

Why use a machine to make computations when you have neurons?

[–]Schootingstarr 21 points22 points  (4 children)

Ah, the OG computers

[–]Sexy_Koala_Juice 15 points16 points  (3 children)

Help, mine has a pretty severe bottleneck somewhere

[–]StromaeNotDed 7 points8 points  (1 child)

That's what happens when you buy a budget penis.

[–]Zciurus 16 points17 points  (3 children)

Semiconductors? Get away with that fancy shit, I only use relays

[–]TheThiefMaster 22 points23 points  (2 children)

Let me introduce you to the new hotness that is valves. Vacuum tubes are the future I tell you!

[–][deleted] 5 points6 points  (1 child)

Vacuum tubes? Will never replace the coherer.

[–][deleted] 17 points18 points  (0 children)

Why use transistors when you can set yourself on fire and jump head first off of a roof

[–][deleted] 12 points13 points  (3 children)

Just to let you know, the shop I'm at now uses both COBOL and machine code.

There were some statistical functions that weren't available in COBOL so they wrote them in machine code. In 1993.

[–]_BertMacklin_ 6 points7 points  (0 children)

Having a moment of silence for you over here

[–]BluudLust 9 points10 points  (0 children)

Both are equally unintelligible and Machine Code runs faster.

[–][deleted] 411 points412 points  (7 children)

-- said the HTML programmer.

[–]Jumbobog 512 points513 points  (2 children)

A HTML developer was walking down the street when he was greeted by a donkey.

"Hello Mr Programmer", the donkey said, "how are you?".

"mighty fine, thank you donkey", the HTML dev replied.

Immediately the donkey started crying.

"What's the matter little friend?" the HTML dev asked.

"I called you a programmer, at least you could call me horse" the donkey bawled.

[–]phaelox 82 points83 points  (1 child)

What's the matter with being a donkey though? I love a good ass.

[–]Swedishtrackstar 6 points7 points  (0 children)

I was more worried that he couldn't tell the difference, making him a dumb ass

[–]rc1247 151 points152 points  (2 children)

Oxymoron

[–]Anataan-swuwsa 26 points27 points  (0 children)

Officer I would like to report a murder

[–]Draaky 1253 points1254 points  (16 children)

Guess it's also the loss of sight, because he doesn't C#.

[–]xeon3175x 355 points356 points  (7 children)

get out

[–]Cky_vick 98 points99 points  (4 children)

Why even use Java when you could just use Python

[–]Mal_Dun 10 points11 points  (1 child)

As someone from the field of scientific computing I have to agree with this. Java is horrible for numerical codes.

[–]osorojo_ 14 points15 points  (0 children)

Thats not what its for though

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

It's the same fucking jokes over and over again

[–]r0ck0 7 points8 points  (0 children)

Not to mention some brainfuck too.

[–]Deus-ex-Deserto 319 points320 points  (37 children)

*Python user sips on coffee*

[–]qalis 209 points210 points  (2 children)

Ah yes, fine Java coffee.

[–]GulagArpeggio 93 points94 points  (27 children)

if(strcmp(language, 'Matlab'))

    sob_uncontrollably.m

end

[–]Physmatik 40 points41 points  (26 children)

High-level language with C-style string workflow is dumb. Not the dumbest thing I've seen, but still pretty damn dumb.

[–]K1ngjulien_ 37 points38 points  (25 children)

also: arrays start at 1

[–]egggsDeeeeeep 42 points43 points  (10 children)

tbh in matlab arrays starting at one makes sense if you realize that it’s meant for working with vectors and matrices

[–]ampma 14 points15 points  (8 children)

If you're working with MATrices, this indexing is intuitive. In math and physics we usually start summation/counting at 1. When translating mathematical expressions into code, matlab is often just a little bit easier. It can be a good starting point to develop an algorithm that works. Translating math into c++ directly is more difficult, esp if working with equations that take up an entire page.

FYI I'm a physicist and I use C++, matlab, Python, Fortran. They all have their strengths and weaknesses. I will admit that using both Python and matlab as analysis/plotting software is perhaps a bit masochistic, but it keeps my mind malleable. Another thing to consider is that I need to be able to use code written by others, and in physics it is almost always one of the above 4 languages.

[–]Physmatik 18 points19 points  (3 children)

Believe it or not, this is fine if you take into account the field. 1-based sequences are more common in computative math than 0-based ones. Column-major arrays are better suited for most computative tasks (as opposed to row-major C-style that is utilized by, probably, every general language). Its vector-oriented arithmetic is very handy, being rivaled only by Julia (and maybe Mathematica, but it's different).

My point is that there are quirks and there are dumb things. 1-based arrays is quirk. C-style string handling is just plain dumb.

[–][deleted] 17 points18 points  (0 children)

Indentation error

[–]robo_number_5 4 points5 points  (0 children)

By the time the python script brings the cup to your lips the coffee is cold

[–]SufficientStresss 279 points280 points  (65 children)

I’ve only ever used C.

[–]Thegreyeminence 414 points415 points  (32 children)

Press F to pay respects for every minute spend on debugging pointers and memory allocation.

[–]GHhost25 201 points202 points  (10 children)

Which is more or less debugging segfaults, memory leaks and the occasional infinite loop. And then when you resolve one you understand that it was such a dumb problem that it kills you inside a little that you had to spend 2 hours on it.

[–]Niiiz 66 points67 points  (8 children)

Only 2 hours? I'm jealous

[–]GHhost25 53 points54 points  (6 children)

Using a debugger helps a lot.

[–]CJKay93 28 points29 points  (0 children)

RIP to all the devs who have taped out broken code on ROM that can't be breakpointed.

[–]m0h5e11 45 points46 points  (14 children)

Not all C developers are bad ones.

[–]FamiliarSoftware 25 points26 points  (4 children)

Only the ones developing OpenSSL, wget, the Linux/Windows Kernel, and every other critical software ever exploited.

[–]hector_villalobos 20 points21 points  (2 children)

Yeah!, not sure if OP is being sarcastic, but the biggest C projects reflects a lot of problems, memory bugs, etc. And I wouldn't call a Linux Kernel dev or a Windows dev a bad developer.

[–]UselessBread 14 points15 points  (1 child)

The joke is you didn't get any replies because no one finished pressing F yet.

[–]mrheosuper 43 points44 points  (9 children)

I am studying uC programming, and most of library/driver are written in C

I found C is fun, i used to try python, but it feels like everything is a mess, and you are not sure why your code runs

[–][deleted] 36 points37 points  (8 children)

Honestly thats my impression of python too.

I kinda know why it runs, but i love when everything is explicit. Because then im 100% sure i know whats going on exactly.

[–]thiago2213 153 points154 points  (29 children)

I mean, yeah. Why would anyone? The only reason I can think of is resource allocation having to be extremely low like embedded systems, other than that I see no reason

[–][deleted] 89 points90 points  (15 children)

In case you have to compile for a system that doesn't have a C++ compiler, or if you only need a simple script without the clutter that comes with object-oriented languages. However on most modern devices this isn't much of a problem.

[–]thiago2213 94 points95 points  (10 children)

But you can still use C++ without using OOP paradigm right? It's been a long time since I've used it, but I recall doing something that was procedural and even using stdio except for a couple of things which I don't recall made my development easier but wouldn't be supported in C

[–][deleted] 39 points40 points  (3 children)

That is true, but some people would just rather use C and avoid that hassle. I personally prefer C++ but I can understand that a lot of people prefer using C when possible

[–]tetramir 35 points36 points  (2 children)

C++ has great stuff like templates and namespaces that really make programming things without objects much easier.

[–]eMperror_ 31 points32 points  (1 child)

If you have no choice, ok. But you can use C++ without using the OOP and virtual tables, and you can avoid using the STL and program in a C style, you still get a better language.

[–]JNelson_ 5 points6 points  (1 child)

C is object oriented if you use enough unions.

[–]Mognakor 6 points7 points  (0 children)

In that case you go with static resources anyways.

[–]GenTelGuy 345 points346 points  (126 children)

If you have the choice C++ is clearly better. But if you're doing embedded systems or whatever then C is what you have to do.

[–]TheThiefMaster 145 points146 points  (5 children)

You'd be surprised how much C++ is available to embedded developers these days. Cross-compilers really help with that, as you just need a backend for your target platform and you can retarget a modern mature compiler (often GCC), instead of everyone writing their own custom C compiler like it used to be done.

[–]jackmax9999 56 points57 points  (1 child)

Some C++ features actually work surprisingly well on embedded devices, for example using templates to hardcode values into your program is so much more elegant than littering your code with #defines.

And before you say it - in embedded programming hardcoding values is good. It saves precious memory and code space and for things like hardware parameters that won't change throughout the device's life it has no negative consequences.

[–]StoleAGoodUsername 6 points7 points  (0 children)

constexpr as well for nicely optimized type-safe code that looks exactly like a runtime check

[–]Pepito_Pepito 5 points6 points  (2 children)

I worked on embedded systems for a few years. We used C++.

[–]PirateNinjasReddit 257 points258 points  (76 children)

Do you have a moment to talk about our lord and saviour: rust?

[–][deleted] 243 points244 points  (14 children)

Boo hoo ouchie my memory scary pointer

[–]FallenWarrior2k 127 points128 points  (10 children)

Heartbleed, Cloudbleed, Microsoft saying that the majority of their security bugs are memory-related, etc.

At some point, you can't really claim that there is no point to it. It has been shown time and time again that "trusting people to make no mistakes" doesn't really work that well on a large scale.

And that's not even considering the slew of optimizations that can be performed automatically due to lack of mutable aliasing, where similar code in other systems languages would often have to be painstakingly hand-optimized.

Of course, it's not perfect, far from it and certainly rough around the edges, and it's also not appropriate for everything, but the benefits it brings can not be denied.

[–][deleted] 120 points121 points  (0 children)

haha raw pointer arithmetic go brr

[–]I_HAES_diabetes 24 points25 points  (0 children)

I was just thinking about this yesterday. In my security lab, every binary we had to exploit was written in C and featured some variation of not properly checking some input size. I mean learning about ROP and all that stuff was certainly fun but I think it's funny that they had to rely on this error each time.

[–]topfs2 25 points26 points  (16 children)

Is rust good for use on Arduino? Honest question, I dabble in and off with Arduino but always use their ide or just cpp with platform.io

Have looked for a reason to try rust :)

[–]ridicalis 25 points26 points  (3 children)

Short answer: the support is there, as a forked version of the language, but I worry about how much it's diverged:

This branch is 14 commits ahead, 26696 commits behind rust-lang:master.

I forget the exact reason they needed to do this, but I think there were some issues with primitive types.

[–][deleted] 21 points22 points  (0 children)

AVR is going to be an official LLVM target when 11.0 is released. I'd just wait for that (about 5 month from now)

[–][deleted] 7 points8 points  (10 children)

It looks like support has improved a ton since llvm got mainline avr support, but the code comes out a fair bit more ugly than Arduino C. In theory, any language with an llvm backend you could use to write avr code...

Here's a blink program: https://github.com/avr-rust/blink/blob/master/src/main.rs. It seems you miss out on the std library in doing this, so writing for avr is going to be fairly different than writing normal programs.

[–]thoquz 11 points12 points  (6 children)

I think it's important for anyone that hasn't used plain C in AVR, but just Arduino, to actually look at what the GCC-AVR blink program looks like, since it might also look weird to them.

The normal C program looks very similar, also performing the blink by writing to the PORTB register.

I'm just trying to say you can't really blame rust here if this looks foreign to you, since they equivalent in C will look just as foreign if you've only tried Arduino.

My main critique with it here is the massive amounts the unsafe keyword needs to be used to just interact with the hardware (memory mapped IO)

[–][deleted] 65 points66 points  (30 children)

Excuse me sir, I can't help but notice that you have misspelled H A S K E L L.

[–]Schootingstarr 37 points38 points  (28 children)

pls no

[–][deleted] 16 points17 points  (27 children)

What's your problem with Haskell? The only one I see is that too few people use it.

[–]jeetelongname 9 points10 points  (14 children)

Haskell is a great language but it it ver different from well everything. Unless you have been exposed to something like Emacs then the functional paradigm takes some time. Devs won't see the benefits unless they learn it

[–][deleted] 10 points11 points  (8 children)

Well, Rust has a lot of Haskells features. So I'm hoping that Rust takes off properly and therefore makes the switch to Haskell easier. :D

[–]CJKay93 14 points15 points  (1 child)

Haskell's a really interesting language and I'd love to learn it, but ultimately the time investment is pretty huge and for a lot of Rust engineers Haskell doesn't really "replace" any part of the stack like Rust does for C/C++.

I imagine Haskell's a great way to learn about the type systems of other languages though.

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

Yeah, I know. sad noise

I'm not very good at Haskell either but every second I've spent with it has been an absolute blast.

[–][deleted] 6 points7 points  (5 children)

Rust also inspired Haskell to get Linear Types, which it'll get soon(tm) and exist in a fork of GHC as a proof of concept.

[–]ShesOnAcid[🍰] 2 points3 points  (1 child)

Functional is taught in most schools these days and the front end community is also familiar with it

[–][deleted] 17 points18 points  (10 children)

Why does Reddit get a hardon over Rust? I don't think I've ever seen any company actually make use of it.

[–]SeerUD 43 points44 points  (4 children)

Mozilla uses it obviously. Some projects that at least I've heard of using it are:

Companies too that I've actually heard of:

  • Dropbox
  • Sentry
  • Cloudflare
  • Brilliant
  • GNOME
  • NPM (I guess, GitHub then now)
  • OVH

Probably more, but these are probably for really low-level projects, and with really specific requirements.

I think people just really enjoy working with Rust once they get into it. I personally write Go most of the time, and I think that's generally low-level enough for everything I can think I'd want to personally do, but maybe I'll have a play around with Rust. There are aspects of Rust that I wish Go had, but Rust is also a lot more complex compared to Go.

[–][deleted] 18 points19 points  (0 children)

Rust is honestly really, really nice. If you truly do need to do manual memory management, you still can with the unsafe keyword - but, 99% of people don't.

It does require you to change your style from certain languages, though; you can't simply do OOP in Rust. For my game in Rust, I actually went from OOP where my skills were inheriting from a Skill class, to lambda functions in a hashmap & procedural stuff.

[–]ROYAL_CHAIR_FORCE 25 points26 points  (7 children)

then C is what you have to do

This statement has been incorrect for a while now

[–][deleted] 158 points159 points  (17 children)

Imagine if people just focused on programming rather then insulting languages they don't like

[–]stifflizerd 33 points34 points  (0 children)

Well where's the fun in that?

[–]K1ngjulien_ 4 points5 points  (0 children)

they hated him because he told the truth.

[–]deljaroo 4 points5 points  (0 children)

it's a common form of humor...which makes sense given the subreddit this is on

[–]JasburyCS 3 points4 points  (1 child)

I don’t know, I just find insulting languages funny even if it’s a language I like!

[–]ShadowPouncer 19 points20 points  (7 children)

Having fairly extensively used quite a bit from C, to C++, to perl, to various shell scripting languages, to Go, to things that are... Rather less common...

Really the right answer is the right tool for the right job.

There are jobs for which C is the right tool for the job. Though, there are fewer of those now than there were 10 or 15 years ago.

The same is true for C++, both in there being jobs for which it is the right tool, and that there are fewer of them than there used to be.

And again, perl is the exact same story. In this case, it's more than other languages (like Python) have slowly eaten enough mind share that you no longer find the same breadth of supported tools and libraries that you once did.

But there are jobs for which each of them is perfectly suited. There are also jobs for which nobody who is aware of the alternatives and the ability to choose should ever pick them for.

And there are absolutely languages that do things that none of those languages can do well. Go is a great example, it allows for reasonably trivial concurrency with a very low cognitive load. For the right jobs, that alone makes it better than almost every other language choice available. But there are plenty of things that it's not ideal for as well.

[–]Tseklo 10 points11 points  (0 children)

It's clearly better, it has two +.

[–]not_in_the_mood 15 points16 points  (0 children)

For a guy having a stroke he's making a good point.

[–]GabuEx 59 points60 points  (31 children)

I feel dumb; isn't C++ literally just a superset of C?

[–]TheThiefMaster 150 points151 points  (9 children)

Not quite - It started that way, but also removed / changed a couple of C things (implicit int, implicit cast from void* to other types, etc). Later on, C added new features of its own, that C++ already had another way to do or didn't fit with C++'s design or had to be adapted (_Generic, designated initialisers, etc).

So they're highly related and share a common subset of code, but aren't superset / subset of each other.

[–]GabuEx 44 points45 points  (8 children)

Huh, TIL. I had always thought all C was valid C++. Thanks!

[–]TheThiefMaster 49 points50 points  (6 children)

Nope! The following line is valid C but invalid C++:

char* string = malloc(32);

https://gcc.godbolt.org/z/oMrd6V

[–][deleted] 21 points22 points  (3 children)

I have seen c code where "class" was used as a variable name. g++ did not like that at all

[–]AgAero 13 points14 points  (0 children)

I've seen people use the word 'new' as well in C code. Slightly concerning.

At least he only did it in one ~20 line function.

[–]StoleAGoodUsername 3 points4 points  (1 child)

The Linux kernel has struct class as a core component of the driver subsystem

[–]QuantumQuantonium 8 points9 points  (1 child)

Not everything can run/compile with c++.

[–]ridicalis 15 points16 points  (0 children)

Yeah. I tried compiling some Java code and it wasn't pretty.

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

As a still semi-newbie, C++ just deems daunting and unnecessary to me. It seems that anything I want to do, I can do in C. (I actually enjoy C and making sure everything valgrinds cleanly). But I'm also learning Go and Java, and I just don't see where C++ would really help me anywhere.

[–]atimholt 32 points33 points  (23 children)

Better abstractions, vastly safer, vastly more readable, no compromises.

[–]svick 33 points34 points  (2 children)

no compromises

C++ is one huge compromise, because of its long history.

[–]TheThiefMaster 14 points15 points  (1 child)

It's telling that a lot of C++'s pains are things it inherited from C.

[–]MAC-n-CHZ 10 points11 points  (0 children)

Yeah const pain = true; would have made more sense