Bootstrap 2.3 Released
blog.getbootstrap.com
blog.getbootstrap.com
Does anyone know the best way to do things like this, if a converter doesn't exist? It would be nice if the docs still had old versions, sort of like WordPress or PHP docs do, where you can see what is depreciated and how to change/upgrade things to newer versions.
The best solution I've been able to cook up is adapting their changelog into a step-by step tutorial for developers to use when upgrading, though I'd love to hear any suggestions on improving that process!
We were targeting to have it out more for 2.x to 3.0 as that will be a bigger jump.
Note I think this applies primarily to the CSS part of Bootstrap which I consider to be more of a template than a library or framework; the JavaScript plugins are always pretty painless to upgrade.
I absolutely detest camelCase. It ranks down there with good-old Hungarian notation.
So, I am now wondering, why this change? Are people finally coming to their senses?
border-radius <- css dashes
document.createElement <- js camel (except constants, etc.)
etc…
obj.getSomethingById() <-- theirs
obj.redraw_panel() <-- mine
Non-native English speakers sometimes prefer to name variables in their native language for the same reason.Also, non-english variables are an abomination! I've worked with code with some finnish variables. Not only is it harder to grok, it's actively distracting.
No, there isn't. It's one of those typical things that novice programmers fret about. Consistency within a code base is much more important than which style is used exactly. Having the style be a compile parameter would make sense to me, not switching from one to the other.
I know this is a commonly held belief, and I held it too for a short while. But then, I was managing a project that ran on both Linux (lower_case_name libraries), Windows (CapitalizeEachWord), had components in Python (ClassesAreLikeThis but variables_like_this), Java (camelCaseIsAnAbomination) and even some VB6 (don't even remember the convention).
Utterly inconsistent. And it didn't make any difference to readability or maintainability, once people accepted that there actually is no single standard we can use.
In my opinion, it's one of these things like, e.g. significant whitespace or C brace style, that people believe make a difference because they have an example - in which the difference is often not attributable to the feature being discussed.
int my_counter; char hostName[256]; double LIFESPAN;
doesn't make for pleasant reading, I'm sure you agree.
Our main codebase used unix_conventional_names. Then, a GUI (FLTK, C++) was added, with classes like Fl_DoubleWindow; Every GUI part now had two conventions.
Then, it turned out that the abstractions FLTK gave on Windows needed a small nudge. So we added some Windows-specific stuff; that module had calls like FLTK Fl_RadioButton, Win32's TrackMouse, our main code's "user_action_t".
Then we added needed to add Python scripting (implementing a native Python module in C) - and since the most maintainable way to do that was to have the C names and Python names correspond, there's a module that also had Python convention names in it. Lather, rinse, repeat with JNI.
So, I would guess ~ 70% of the files ended up being "uniform convention" (with one convention, depending on source code language), and 30% had mixed conventions of up to 4 conventions.
And it didn't make anything a little bit unreadable. It's no more distracting than changing fonts in a document every paragraph (and occasionally in the middle of a paragraph) between several readable standard fonts (arial, courier, consolas, ...). It looks weird and bothering for the first few days, but is not actually distracting or hampering in any way.
And if anyone is going to reply "but new people who come into the codebase will be confused" - that codebase was moving millions of dollars per day, and was nontrivial enough that I wouldn't allow anyone to commit a change on their first week, often their first month, without two other people reviewing it (experienced people got only one person to review their code).
By the time anyone knew the code well enough to make a change, they weren't bothered by the multiple conventions either.
> doesn't make for pleasant reading, I'm sure you agree.
only lifespan, the upper case implying constantness when it isn't, bothers me. Other than that - pleasant as day.
As the other replier wrote, having different style variables and naming conventions in the same project - really, the same file - is somewhat distracting.
<?php $x = 55;
$numberOfPeopleEmailed = 23;
$What_The_User_Chose = $_POST['chosen'];
do_something_withVarName($x);
$sFirst_Name = _$_POST['name'];
it gets distracting. While it's been rare for me, I've occasionally dealt with large files with different styles of var naming contributed by different people. It's far more of a mental nuisance than tabs-v-spaces (I'm a tabs guy, fwiw).
I think you might be generalizing a little too far here. I've been programming for over thirty years in more languages than I care to remember. Every so often a meme of some sort raises to the surface and the sheep jump on it. Hungarian notation was probably one of the ugliest of all. Case sensitivity is another. And, case sensitivity added to camel case just makes your job that much harder for no good reason at all:
autoDetectMotorPhaseAngleAndSpeed
Is horribly unreadable and gives you many opportunities to make a typing mistake and cause development delays.
auto-detect-motor-phase-angle-and-speed
Is super-easy to read and type. Less entry errors and legible code are important. If you think that this is a newbie "mistake", well, they are right.
As I can't find any data, I've asked on programmers.stackexchange.com. http://programmers.stackexchange.com/questions/186407/are-th...
From one of the answers:
"results indicate a significant improvement in time and lower visual effort with the underscore style. The interaction of Experience with Style indicates that novices benefit twice as much with respect to time, with the underscore style."
Having said what I said, I'll program in any language and abide by any convention if required. That's just what you have to do as a programmer. No issues there. If a client requires camelCase, so be it, it's not like it is crippling.
If I have the freedom to do so, I tend to be very pragmatic about my own projects. I don't subscribe to fads both in my personal life and in software development. Camel case and Hungarian notation are just fads that, when surfaced, may or may not survive the test of time. The second, for the most part, did not. We'll see what happens with Camel case. None of this crap is necessary to write good code, or code that is bug-free, or code that makes you money.
Life goes on. Those who love to camelCase, hey, it's OK, not the end of the world.
The following rule will match for values of the "lang" attribute that begin with "en", including "en", "en-US", and "en-cockney":
*[lang|="en"] { color : red }
So you may now be able to select with CSS elements with that syntax, for example matching all text-warning, text-info, text-center etc with just *[class|="text"] { font-weight: bold }
Correct me if I'm wrong.I don't know if it would be practical or not. Other than that it just a matter of preference, CSS classes tends to be generally separated by dashes from my point of view, whether I prefer Camel Case or not.
[1]: http://www.w3.org/TR/CSS2/selector.html#attribute-selectors
Represents an element with the att attribute, its value either being exactly "val" or beginning with "val" immediately followed by "-" (U+002D).
it should match text-foo or text but not textFoo
JustTestingThis
Hmm. I think it only matters to me that the author picks one and stays with it. But that means that all libraries he uses has to use the same one. Which is why languages tend to prefer one over the other. e.g. Java using CaMeLcAsE
To have them mixed in one code base would be like a micro context switch.
It's "justTestingThis" not "JustTestingThis" if we are talking camel case.
So yeah, camel case and case sensitivity add unnecessary fragility to programming. Which is the reason I don't like the fad. You accidentally made my case.
It's useful.
just-testing-this ---> just_testing_this
JustTestingThis ---> justTestingThis
The second one is less dramatic but the first one would in most languages subtract testing and this from just.
Also, all their CSS classes were kebab-case anyway, so it makes sense that they'd change their variables to match. It's a nice move towards consistency.
Put it this way: I can trivially write an Emacs minor mode that detects cameCase and shows them as dashes and vice-versa.
This should be something each programmer could decide on its own, as long as the commits are using the same convention.
Now, also, maybe maybe maybe that it shouldn't be language recommandations but specs defined in the language.
A bit like how the Go language close shut the big mouths of people advocating for this or that place for brackets.
For what it's worth I'd configure my text editor to show names using dashes instead of camelCase...
Tab vs. spaces will not cause code to break, mistyping camel case in a case sensitive language does. Neither camel case nor case sensitivity makes programming easier, better, faster, less error-prone, clearer, more accurate, et. In other words, it serves no useful purpose other than feeding a fad.
Tab vs. spaces? Don't really care. There are good reasons for going ether way. As long as the tab key does the indentation I, personally, couldn't care less which way it goes. My code will not break if I enter a bunch of spaces instead of tabs.
Well, mixing them can. Python, for example.
I'll play with that and see. I can't think of any other language where this might matter.
Should I look for anything in particular or simply tabs vs space in indentation on any code?
# Problems from ProjectEuler.net
# http://projecteuler.net/problem=1
def problem_1():
return sum([n for n in range(1000) if (n%3 == 0) or (n%5 == 0)])
def problem_1a():
return sum(set(range(3,1000,3) + range(5,1000,5)))
# http://projecteuler.net/problem=2
def problem_2():
sequence = [1,2]
while sequence[-1] < 4000000:
sequence.append(sum(sequence[-2:]))
if sequence[-1] > 4000000:
sequence.pop()
return sum([n for n in sequence if (n%2 == 0)])
I did say I was just getting started!I'll try the above and other code I wrote with a mixture of tabs and spaced and see what happens. Interesting. If Python actually breaks because of that it's a shame. I really like the language. Is it a matter of IDE interpreter (type code and execute interactively) vs. command-line interpreter (same as previous) vs. module execution (i.e.: "python my_module.py" from the command prompt)?
CoffeeScript as well, if I recall the indentation rules correctly.
For that reason, I prefer using camel case.
What's interesting is underscores are not considered word separators in many text editors.
The only disadvantage to this is that all startups are now 'lazy' and begin using bootstrap default theme colors and styles -- which makes all website look the same. I'm not sure whether I feel that we're losing creativity for people who want to play with colors or we're losing the ability to actually code up some CSS to make things pretty. (Just my opinion).
Dropping support for IE7 was a good idea. I believe that is the next browser we're killing after IE6, right? After all, who keeps versions of browser these days? I mean I lost count when Chrome updates for me -- and Firefox is on rapid release (18) now. I can't keep up remember all these numbers and browsers!
Please keep up the good work! Bootstrap is an awesome framework for the web!
Also, some things are difficult to modify. What if I want two navbars, one with a different height than the other? Some tweaks seem pretty difficult to make.
We've long had lots of open source infrastructure like Linux, Rails, Postgres, Apache, and so on and so forth that was very much a "by programmers, for programmers" affair. It's very nice to get some "design" infrastructure - Bootstrap has made my sites look a lot better, and I get compliments from people.
So, a big thanks to the bootstrap guys!
The only exceptions are "primary" buttons (which was blue by default but based on the link color the last time I checked), info which is pale blue, and code samples which are pink.
I'm not in the slightest way artistic, but I feel if those (incredibly easily overriden) usages hold you back from expressing yourself with color then you're probably best not to bother and so it's a net-win either way.
On a more personal note, it feels immature -- titling a section "Oh shit what" just for the sake of irony dilutes the meaning of what they're conveying. The info would be equally effective without it, and it's just filler.
I know people just want to have fun, but why not save the swearing for personal blog posts rather than a large (and growing) open source project?
Being open source, perhaps there's a fork opportunity for 'Bootstrap without the swearing'.
If I'm reading a webcomic or some subreddit then fine.
It's that their usage of profanity is lame. They're trying to be cool and funny, and it's very much neither of these. If they could actually managed the be humorous with profanity, then maybe I wouldn't mind it so much but this blog post really reeks of someone who is desperately trying to be funny and yet miserably fails.
Modals are all responsive and ____ now.
How random.I see one occurrence of 'shit'. I'm not sure how I feel about your pansy ass semi-outrage of someone else's release page language.
Oh, wait. I feel nothing, approximately what this entire conversation thread is worth.
re.findall(r"[^a-zA-Z]([a-zA-Z]+)(?=[^a-zA-Z])", ..)I have a personal pet peeve with people using 'Internet slang' outside _humor_ places on the Internet (some people I know overuse it to the point of annoyance), and so the discomfort I feel reading these terms sneaks up to my impressions of Bootstrap and its authors. Of course, rationally I know it's a good product made by outstanding people, so I still use it without refrain, though.
Removing its support is good because it was adding tons of CSS code.
That's an absurd generalization.
Interesting.
The only thing to that effect I see right now is that responsive less files will no longer be separate from the core. That will probably mean that I will be forced to support mobile platforms.
Is there more to it?
(Aside, wishing someone would take a deeper look at https://github.com/twitter/bootstrap/issues/4935)
I currently have scenarios where I want the same version on the desktop and mobile. That's trivial because I simply don't include the responsive CSS file.
In 3.0 the media queries are part of the core. So I can't just leave the responsive CSS out. Further, it's mobile-first so things like the navbar would be collapsed by default on a mobile device. I would be forced to negate that to get an uncollapsed navbar on a mobile device (as desktop version).
why?
CSS transitions are just total shit to deal with in javascript.
What people often don't realize is that there is an event for transitionEnd in javascript – but this isn't always fired in a reliable way – only when a transition successfully ends (which isn't all the time).
This is incredibly problematic because often really important functionality is tied to the completion of transitions.
Because these functions never finish, sometimes you're left with dead dom nodes or weird incomplete states.
What's more, there isn't a performance benefit to using css transitions – the benefit is that they were suppose to be make transitions easier and provide a nice separation of style from logic – but they end up being incredibly more difficult and because of the necessary fallback logic, the styles end up leaking back into your logic anyways. It's a pain in the neck :/
With bootstrap we really just want to give everyone the most reliable product we can, and css transitions just aren't that.
Also, from what I hear, the spec is basically dead in the water – and a reliable cancel event isn't in the works (unless this has changed in the last month or so)… which is more of a reason to consider alternatives.
Most likely we will end up going with some sort of combination. CSS transitions when we don't need a reliable "complete" event – and css transitions when we don't really care (though this case is becoming more infrequent).
If you're not having any problems you must be very lucky and/or are only using a subset of the tools they provide, it's not going to be a drop in update for most people, hence the 3.0 version.
For that, I will always looooooooooooooove yoooooooooooooouuuuuuuu ooooooooooooh Iiiiiiiiiiii will always loooooooooove yooooooooooooouuuuuuuu.
Thank you.