5 ms·
The more I learn C the more I hate it. At first it seems simple and easy but reading "Expert C Programming" is reading a laundry list of what's really messed up
by optforfon 10y ago
The more I learn C the more I hate it. At first it seems simple and easy but reading "Expert C Programming" is reading a laundry list of what's really messed up with the language. 80% of the problems would be solved by some sane syntactic sugar that compiles down to C
- dsfuoi 10y agoWhy are you learning it?
- ams6110 10y agoI would say generally I feel that way about any language I've learned. Initially they are pretty easy and the examples given include slick solutions to contrived problems. Then you get into wanting to do real work and you learn about all the corner cases and ambiguities and landmines that are hidden farther afield. Can anyone name a language that they've grown to like more the more they learned about it? I would guess maybe only those in the LISP family would make the cut.
- RodericDay 10y agoI'm not a super genius programmer by any means, but I've had a lot of pleasant surprises learning about the depths of Python.
- renox 10y agoI disagree: no static typing --> annoying runtime errors, no 'use strict'..
- jsmith0295 10y agoWhile I like static typing, there's a lot more that goes into making a language good or bad than that. On the whole, python seems pretty good to me. I'd take it over Java 90% of the time.
- mikevm 10y agoI learned to appreciate static typing after "diving into" a large Python codebase. Even with a good IDE (PyCharm), it was freaking hard to understand what the heck was going on. With all the fun in quick prototyping, there's no way I'm going to use a dynamic language for anything serious.
- nstart 10y agoIf a Python code base that's large carries no tests it can be a nightmare to walk through (I've walked through my own ones that I wrote before I had learnt testing too). Statically types languages are great but if they are also oop I find that unless someone really knows how to hold back on the "make things an interface" mentality you can end up with a large codebase that looks just as crazy as a dynamically typed one. Point here being that everyone's mileage will vary with dynamic and statically typed languages. But over time as the code base grows, the helpfulness of the language type becomes less (to the point of irrelevance). Instead the value of how cleanly the code has been written and maintained matters much more. Code with good tests, classes that are divided logically, well named methods and variables, etc, should be able to tell you what you are looking for regardless of language type.
- ArkyBeagle 10y agoMy favorite language remains 'C'. You don't have to even look at the corner cases, landmines and ambiguities - use the subset of the language that works. Other than things like signed integer weirdness, most complaints about 'C' revolve around the library. Well, don't use those parts of the library.
- deleted 10y ago[deleted]
- optforfon 10y agoExcept that generally the point of using C is to squeeze performance out of your alogorithms - so you can't limit yourself. But even the simple straightforward stuff has been done just sloppily. I think we just take for granted that it's part of the learning curve and that programming just isn't easy. And eventually your fingers memorize all the nuanced and sure if you don't screw up it all works. But it's designed in a way where you end up shooting yourself in the foot. It's hard to reason about pointer and reference notations, everyone eventually miss a break in a switch - const is weird, arrays vs. pointers is weird. Symbols are needlessly overloaded to do different hings. Things that seems like they'd work for strange reasons don't EXAMPLE: foo(const char p) { } main(int argc, char argv) { foo(argv); } I really really recommend opening up "Expert C Programming". I promise by page 50 you will be angry - not because there are so many gotchas, but because most of them are completely fixable. Just no one has bothered to do it
- MichaelBurge 10y agoHaskell can be annoying to work with in the beginning, since the slick quicksort examples don't really explain why you'd want to use it to write something real. But then your project grows bigger, and the type system maintains sanity in a way you don't otherwise see. Other languages usually use tons of unit tests everywhere to enable refactoring, but then they bog you down if you really need to change something. I guess it has problems with records, space leaks, and deployment to old machines. Maybe ML or F# are just as good for this purpose; I haven't really used them.
- jsmith0295 10y agoObjective-C, actually. I had really only used Java and a little C++ and PHP before I learned it to start doing iOS development (still iPhone OS at the time), and while I initially hated the syntax and found it confusing, I really ended up appreciating a lot about how things were done in the language. Although that was mostly things which originated in Smalltalk.
- steffan 10y agoI have really enjoyed Scala. The more depth I gain in the language, the more I appreciate it. It has the ability to be compact without being overly terse, and is very readable if you don't get too crazy with using symbol overloading and overly-complicated types.
- groovy2shoes 10y ago> Can anyone name a language that they've grown to like more the more they learned about it? I would guess maybe only those in the LISP family would make the cut. You're correct that a few of the Lisps have had this effect for me (Scheme, Common Lisp, EuLisp, Le-Lisp, elisp), but there have been a few dialects that I came to like less and less as I learned them (note that I do not necessarily dislike them, rather I'm disappointed by them): Clojure, Newlisp, and Racket, for example. There are a few non-Lisps that I find myself liking more and more as I use them: Kitten and Mantra. They're both concatenative languages that take somewhat different approaches from the usual Forth-likes. I'm still not super proficient with them, though, so it's possible that the derivative of my fondness for them will invert yet. I've also had that experience with ksh (believe it or not) and Vim (a DSL for editing, if you will). There have also been a few languages that have had a sort of "roller coaster" effect: at first they excited me greatly, then as I learned them better and better, I liked them more, then less, then more…. Some examples that come to mind are C#, Datalog, Haskell, Modula-3, OCaml, Prolog, Rust, and Standard ML.
- AKrumbach 10y ago> Can anyone name a language that they've grown to like more the more they learned about it? I would guess maybe only those in the LISP family would make the cut. Well, personally I've fallen in love with using FORTH for when I'm doing my hardware hacking (mostly on Arduino). I don't think that anybody would call it 'in the LISP family', but the language has similar grammar-extension capabilities, and I adore it for that.
- greydius 10y ago> Can anyone name a language that they've grown to like more the more they learned about it? Haskell
- ArkyBeagle 10y agoMy guess is that liking/not liking 'C' depends on how interested you are in its representation model. If you're actively disinterested in how things work as bits in memory, then I can't blame you a ... bit.
- rayiner 10y agoNo the representation model is fine. It's where C tries to be something other than portable assembly where it goes awry. E.g. C has more syntax for arrays than actually exists at runtime, which leads to surprising behavior. The problem with array arguments discussed in the LKML thread posted above is a great example.
- ArkyBeagle 10y agoI am having trouble identifying "the LKML thread."
- kecks 10y agoI think he meant this: https://lkml.org/lkml/2015/9/3/428 https://lkml.org/lkml/2015/9/3/428 (It's Torvalds on a bug made harder to spot by using array arguments in C, which you shouldn't do.)
- ArkyBeagle 10y agoThanks so much! Agreed.
- m_mueller 10y agosorry for OT, but: g+ share: 0, reddit share: 1k. .. so I guess it becomes clear why Google is deemphasising this.
- deleted 10y ago[deleted]
- pjmlp 10y ago
- aldanor 10y agoTry learning Rust :)
- PopsiclePete 10y agoYou might like Go....I find it's 90% of the good-ness of C with only like 10% of that badness